diff --git a/src/AppBundle/Entity/LDraw/Category.php b/src/AppBundle/Entity/LDraw/Category.php index 905488b..1f97c82 100644 --- a/src/AppBundle/Entity/LDraw/Category.php +++ b/src/AppBundle/Entity/LDraw/Category.php @@ -10,7 +10,7 @@ use Doctrine\ORM\Mapping as ORM; * Category. * * @ORM\Table(name="ldraw_category") - * @ORM\Entity + * @ORM\Entity(repositoryClass="AppBundle\Repository\CategoryRepository") */ class Category { diff --git a/src/AppBundle/Entity/LDraw/Keyword.php b/src/AppBundle/Entity/LDraw/Keyword.php index 19f7012..496e6c0 100644 --- a/src/AppBundle/Entity/LDraw/Keyword.php +++ b/src/AppBundle/Entity/LDraw/Keyword.php @@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM; * Keyword. * * @ORM\Table(name="ldraw_keyword") - * @ORM\Entity + * @ORM\Entity(repositoryClass="AppBundle\Repository\KeywordRepository") */ class Keyword { diff --git a/src/AppBundle/Entity/LDraw/Model.php b/src/AppBundle/Entity/LDraw/Model.php index 6ec4064..4e78540 100644 --- a/src/AppBundle/Entity/LDraw/Model.php +++ b/src/AppBundle/Entity/LDraw/Model.php @@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM; * Model. * * @ORM\Table(name="ldraw_model") - * @ORM\Entity + * @ORM\Entity(repositoryClass="AppBundle\Repository\ModelRepository") */ class Model { diff --git a/src/AppBundle/Entity/LDraw/Part_Relation.php b/src/AppBundle/Entity/LDraw/Part_Relation.php index e0242e5..683abaf 100644 --- a/src/AppBundle/Entity/LDraw/Part_Relation.php +++ b/src/AppBundle/Entity/LDraw/Part_Relation.php @@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM; /** * Part. * - * @ORM\Entity + * @ORM\Entity(repositoryClass="AppBundle\Repository\Part_RelationRepository") * @ORM\Table(name="ldraw_part_relation") */ class Part_Relation diff --git a/src/AppBundle/Entity/LDraw/Type.php b/src/AppBundle/Entity/LDraw/Type.php index 9fede63..6d18957 100644 --- a/src/AppBundle/Entity/LDraw/Type.php +++ b/src/AppBundle/Entity/LDraw/Type.php @@ -10,7 +10,7 @@ use Doctrine\ORM\Mapping as ORM; * Type. * * @ORM\Table(name="ldraw_type") - * @ORM\Entity + * @ORM\Entity(repositoryClass="AppBundle\Repository\TypeRepository") */ class Type { diff --git a/src/AppBundle/Repository/BaseRepository.php b/src/AppBundle/Repository/BaseRepository.php new file mode 100644 index 0000000..0e7f080 --- /dev/null +++ b/src/AppBundle/Repository/BaseRepository.php @@ -0,0 +1,19 @@ +_em->persist($entity); + $this->_em->flush($entity); + } + + public function delete($entity) { + $this->_em->remove($entity); + $this->_em->flush($entity); + } +} \ No newline at end of file diff --git a/src/AppBundle/Repository/CategoryRepository.php b/src/AppBundle/Repository/CategoryRepository.php new file mode 100644 index 0000000..e39226d --- /dev/null +++ b/src/AppBundle/Repository/CategoryRepository.php @@ -0,0 +1,11 @@ +