mirror of
https://github.com/ToxicCrack/PrintABrick.git
synced 2025-06-01 03:30:18 -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.
|
* Category.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="ldraw_category")
|
* @ORM\Table(name="ldraw_category")
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\CategoryRepository")
|
||||||
*/
|
*/
|
||||||
class Category
|
class Category
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
* Keyword.
|
* Keyword.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="ldraw_keyword")
|
* @ORM\Table(name="ldraw_keyword")
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\KeywordRepository")
|
||||||
*/
|
*/
|
||||||
class Keyword
|
class Keyword
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
* Model.
|
* Model.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="ldraw_model")
|
* @ORM\Table(name="ldraw_model")
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\ModelRepository")
|
||||||
*/
|
*/
|
||||||
class Model
|
class Model
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
/**
|
/**
|
||||||
* Part.
|
* Part.
|
||||||
*
|
*
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\Part_RelationRepository")
|
||||||
* @ORM\Table(name="ldraw_part_relation")
|
* @ORM\Table(name="ldraw_part_relation")
|
||||||
*/
|
*/
|
||||||
class Part_Relation
|
class Part_Relation
|
||||||
|
@ -10,7 +10,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
* Type.
|
* Type.
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="ldraw_type")
|
* @ORM\Table(name="ldraw_type")
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\TypeRepository")
|
||||||
*/
|
*/
|
||||||
class Type
|
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