Implemented Members attribut and optimized membership

This commit is contained in:
Kevin Frantz
2018-11-24 18:13:04 +01:00
parent a64541a9ad
commit cb1316a380
11 changed files with 116 additions and 28 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\Collection;
use App\Entity\Source\SourceInterface;
/**
* @author kevinfrantz
*/
trait MembersAttribut
{
/**
* @var Collection|SourceInterface[]
*/
protected $memberships;
/**
* @return Collection|SourceInterface[]
*/
public function getMembers(): Collection
{
return $this->memberships;
}
/**
* @param Collection|SourceInterface[] $members
*/
public function setMembers(Collection $members): void
{
$this->memberships = $members;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\Collection;
use App\Entity\Source\SourceInterface;
/**
* @author kevinfrantz
*/
interface MembersAttributInterface
{
/**
* @param Collection|SourceInterface[] $members
*/
public function setMembers(Collection $members): void;
/**
* @return Collection|SourceInterface[]
*/
public function getMembers(): Collection;
}

View File

@@ -3,7 +3,7 @@
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\Collection;
use App\Entity\Source\Complex\Collection\TreeCollectionSourceInterface;
use App\Entity\Source\SourceInterface;
/**
* @author kevinfrantz
@@ -11,12 +11,12 @@ use App\Entity\Source\Complex\Collection\TreeCollectionSourceInterface;
trait MembershipsAttribut
{
/**
* @var Collection|TreeCollectionSourceInterface[]
* @var Collection|SourceInterface[]
*/
protected $memberships;
/**
* @return Collection|TreeCollectionSourceInterface[]
* @return Collection|SourceInterface[]
*/
public function getMemberships(): Collection
{
@@ -24,7 +24,7 @@ trait MembershipsAttribut
}
/**
* @param Collection|TreeCollectionSourceInterface[] $memberships
* @param Collection|SourceInterface[] $memberships
*/
public function setMemberships(Collection $memberships): void
{

View File

@@ -3,7 +3,7 @@
namespace App\Entity\Attribut;
use Doctrine\Common\Collections\Collection;
use App\Entity\Source\Complex\Collection\TreeCollectionSourceInterface;
use App\Entity\Source\SourceInterface;
/**
* @author kevinfrantz
@@ -11,12 +11,12 @@ use App\Entity\Source\Complex\Collection\TreeCollectionSourceInterface;
interface MembershipsAttributInterface
{
/**
* @param Collection|TreeCollectionSourceInterface[] $groups
* @param Collection|SourceInterface[] $groups
*/
public function setMemberships(Collection $memberships): void;
/**
* @return Collection|TreeCollectionSourceInterface[]
* @return Collection|SourceInterface[]
*/
public function getMemberships(): Collection;
}