Moved collections to complex

This commit is contained in:
Kevin Frantz
2018-11-22 20:50:05 +01:00
parent e702e356a0
commit e63b265ee4
12 changed files with 17 additions and 17 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Entity\Source\Complex\Collection;
use App\Entity\Source\AbstractSource;
use App\Entity\Attribut\CollectionAttribut;
use Doctrine\Common\Collections\Collection;
use App\Entity\Source\SourceInterface;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity
* @ORM\Table(name="source_collection")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"member" = "TreeCollectionSource"})
*
* @author kevinfrantz
*/
abstract class AbstractCollectionSource extends AbstractSource implements CollectionSourceInterface
{
use CollectionAttribut;
/**
* @var Collection|SourceInterface[]
* @ORM\ManyToMany(targetEntity="App\Entity\Source\AbstractSource",inversedBy="memberships")
* @ORM\JoinTable(name="source_group_members")
*/
protected $collection;
public function __construct()
{
parent::__construct();
$this->collection = new ArrayCollection();
}
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Entity\Source\Complex\Collection;
use App\Entity\Source\SourceInterface;
use App\Entity\Attribut\CollectionAttributInterface;
interface CollectionSourceInterface extends SourceInterface, CollectionAttributInterface
{
}

View File

@@ -0,0 +1,18 @@
<?php
namespace App\Entity\Source\Complex\Collection;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Attribut\CollectionAttribut;
/**
* @author kevinfrantz
*
* @todo remove deprecated trait membersattribut
* @ORM\Table(name="source_group")
* @ORM\Entity
*/
class TreeCollectionSource extends AbstractCollectionSource implements TreeCollectionSourceInterface
{
use CollectionAttribut;
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Entity\Source\Complex\Collection;
/**
* @author kevinfrantz
*/
interface TreeCollectionSourceInterface extends CollectionSourceInterface
{
}