mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Refactored Collection Sources
This commit is contained in:
@@ -6,7 +6,7 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use JMS\Serializer\Annotation\Exclude;
|
||||
use App\Entity\AbstractEntity;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Source\Attribut\GroupSourcesAttribut;
|
||||
use App\Entity\Attribut\GroupSourcesAttribut;
|
||||
use App\Entity\Meta\RelationInterface;
|
||||
use App\Entity\Attribut\RelationAttribut;
|
||||
use App\Entity\Meta\Relation;
|
||||
@@ -14,6 +14,7 @@ use App\Entity\Attribut\LawAttribut;
|
||||
use App\Entity\Meta\LawInterface;
|
||||
use App\Entity\Meta\Law;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Entity\Source\Collection\MemberCollectionSource;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -41,7 +42,7 @@ abstract class AbstractSource extends AbstractEntity implements SourceInterface
|
||||
* @todo Implement that just one table on database level is needed!
|
||||
* @todo Rename table to use the right schema
|
||||
*
|
||||
* @var Collection|GroupSource[]
|
||||
* @var Collection|MemberCollectionSource[]
|
||||
* @ORM\ManyToMany(targetEntity="GroupSource",mappedBy="members")
|
||||
*/
|
||||
protected $groups;
|
||||
|
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Source\GroupSourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait GroupSourcesAttribut
|
||||
{
|
||||
/**
|
||||
* @var Collection|GroupSourceInterface[]
|
||||
*/
|
||||
protected $groups;
|
||||
|
||||
/**
|
||||
* @return Collection|GroupSourceInterface[]
|
||||
*/
|
||||
public function getGroupSources(): Collection
|
||||
{
|
||||
return $this->groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection|GroupSourceInterface[] $groups
|
||||
*/
|
||||
public function setGroupSources(Collection $groups): void
|
||||
{
|
||||
$this->groups = $groups;
|
||||
}
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Source\GroupSourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface GroupSourcesAttributInterface
|
||||
{
|
||||
/**
|
||||
* @param Collection|GroupSourceInterface[] $groups
|
||||
*/
|
||||
public function setGroupSources(Collection $groups): void;
|
||||
|
||||
/**
|
||||
* @return Collection|GroupSourceInterface[]
|
||||
*/
|
||||
public function getGroupSources(): Collection;
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace App\Entity\Source\Collection;
|
||||
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
class AbstractCollectionSource extends AbstractSource implements CollectionSourceInterface
|
||||
{
|
||||
}
|
||||
|
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace App\Entity\Source\Collection;
|
||||
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
||||
interface CollectionSourceInterface extends SourceInterface
|
||||
{}
|
||||
|
@@ -1,19 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source;
|
||||
namespace App\Entity\Source\Collection;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Attribut\MembersAttributInterface;
|
||||
use App\Entity\Attribut\MembersAttribut;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="source_group")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
final class GroupSource extends AbstractSource implements MembersAttributInterface
|
||||
final class MemberCollectionSource extends AbstractCollectionSource implements MemberCollectionSourceInterface
|
||||
{
|
||||
use MembersAttribut;
|
||||
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Collection;
|
||||
|
||||
use App\Entity\Attribut\MembersAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface MemberCollectionSourceInterface extends MembersAttributInterface,CollectionSourceInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace App\Entity\Source\Collection\Queue;
|
||||
|
||||
use App\Entity\Attribut\MembersAttributInterface;
|
||||
use App\Entity\Source\Collection\CollectionSourceInterface;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
||||
/**
|
||||
* @todo Implement integration test for two user accessing queue! Check if log works!
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface QueueSourceInterface extends CollectionSourceInterface, MembersAttributInterface
|
||||
{
|
||||
public function getPointerPosition():int;
|
||||
|
||||
public function getNextElement():SourceInterface;
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source;
|
||||
|
||||
use App\Entity\Attribut\MembersAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* @todo Map the not jet mapped functions!
|
||||
*/
|
||||
interface GroupSourceInterface extends MembersAttributInterface
|
||||
{
|
||||
}
|
@@ -4,7 +4,7 @@ namespace App\Entity\Source;
|
||||
|
||||
use App\Entity\Attribut\IdAttributInterface;
|
||||
use App\Entity\EntityInterface;
|
||||
use App\Entity\Source\Attribut\GroupSourcesAttributInterface;
|
||||
use App\Entity\Attribut\GroupSourcesAttributInterface;
|
||||
use App\Entity\Attribut\LawAttributInterface;
|
||||
use App\Entity\Attribut\RelationAttributInterface;
|
||||
|
||||
|
Reference in New Issue
Block a user