Allow ceating and editing snips

This commit is contained in:
Tim
2023-04-04 00:36:35 +02:00
parent 921dcf1e97
commit dce2fbff42
7 changed files with 75 additions and 32 deletions

View File

@ -21,7 +21,7 @@ class SnipRepository extends ServiceEntityRepository
parent::__construct($registry, Snip::class);
}
public function save(Snip $entity, bool $flush = false): void
public function save(Snip $entity, bool $flush = true): void
{
$this->getEntityManager()->persist($entity);
@ -30,7 +30,7 @@ class SnipRepository extends ServiceEntityRepository
}
}
public function remove(Snip $entity, bool $flush = false): void
public function remove(Snip $entity, bool $flush = true): void
{
$this->getEntityManager()->remove($entity);
@ -38,29 +38,4 @@ class SnipRepository extends ServiceEntityRepository
$this->getEntityManager()->flush();
}
}
// /**
// * @return Snip[] Returns an array of Snip objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('s.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Snip
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}