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:
parent
cb8ecfc66b
commit
77f0e169c1
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
19
src/AppBundle/Repository/BaseRepository.php
Normal file
19
src/AppBundle/Repository/BaseRepository.php
Normal 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);
|
||||
}
|
||||
}
|
11
src/AppBundle/Repository/CategoryRepository.php
Normal file
11
src/AppBundle/Repository/CategoryRepository.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace AppBundle\Repository;
|
||||
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class CategoryRepository extends BaseRepository
|
||||
{
|
||||
|
||||
}
|
11
src/AppBundle/Repository/KeywordRepository.php
Normal file
11
src/AppBundle/Repository/KeywordRepository.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace AppBundle\Repository;
|
||||
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class KeywordRepository extends BaseRepository
|
||||
{
|
||||
|
||||
}
|
11
src/AppBundle/Repository/ModelRepository.php
Normal file
11
src/AppBundle/Repository/ModelRepository.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace AppBundle\Repository;
|
||||
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class ModelRepository extends BaseRepository
|
||||
{
|
||||
|
||||
}
|
8
src/AppBundle/Repository/PartRepository.php
Normal file
8
src/AppBundle/Repository/PartRepository.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace AppBundle\Repository;
|
||||
|
||||
|
||||
class PartRepository extends BaseRepository
|
||||
{
|
||||
}
|
11
src/AppBundle/Repository/Part_RelationRepository.php
Normal file
11
src/AppBundle/Repository/Part_RelationRepository.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace AppBundle\Repository;
|
||||
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class Part_RelationRepository extends BaseRepository
|
||||
{
|
||||
|
||||
}
|
8
src/AppBundle/Repository/TypeRepository.php
Normal file
8
src/AppBundle/Repository/TypeRepository.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace AppBundle\Repository;
|
||||
|
||||
|
||||
class TypeRepository extends BaseRepository
|
||||
{
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user