1
0
mirror of https://github.com/ToxicCrack/PrintABrick.git synced 2025-05-27 17:30:07 -07:00

Add entity repositories

This commit is contained in:
David Hübner 2017-03-16 02:43:10 +01:00
parent cb8ecfc66b
commit 77f0e169c1
12 changed files with 84 additions and 5 deletions

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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

View File

@ -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
{

View File

@ -0,0 +1,19 @@
<?php
namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;
class BaseRepository extends EntityRepository
{
public function save($entity) {
$this->_em->persist($entity);
$this->_em->flush($entity);
}
public function delete($entity) {
$this->_em->remove($entity);
$this->_em->flush($entity);
}
}

View File

@ -0,0 +1,11 @@
<?php
namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;
class CategoryRepository extends BaseRepository
{
}

View File

@ -0,0 +1,11 @@
<?php
namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;
class KeywordRepository extends BaseRepository
{
}

View File

@ -0,0 +1,11 @@
<?php
namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;
class ModelRepository extends BaseRepository
{
}

View File

@ -0,0 +1,8 @@
<?php
namespace AppBundle\Repository;
class PartRepository extends BaseRepository
{
}

View File

@ -0,0 +1,11 @@
<?php
namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;
class Part_RelationRepository extends BaseRepository
{
}

View File

@ -0,0 +1,8 @@
<?php
namespace AppBundle\Repository;
class TypeRepository extends BaseRepository
{
}