<?php | |||||
namespace Lc\PietroBundle\Doctrine\Extension; | |||||
interface DescriptionProjectInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\PietroBundle\Doctrine\Extension; | |||||
use Lc\PietroBundle\Model\ThematicInterface; | |||||
use Lc\PietroBundle\Model\SubthematicInterface; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
trait DescriptionProjectTrait | |||||
{ | |||||
/** | |||||
* @ORM\Column(type="text") | |||||
*/ | |||||
private $description; | |||||
/** | |||||
* @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\ThematicInterface") | |||||
*/ | |||||
private $thematic; | |||||
/** | |||||
* @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\SubthematicInterface") | |||||
*/ | |||||
private $subthematic; | |||||
public function getDescription(): ?string | |||||
{ | |||||
return $this->description; | |||||
} | |||||
public function setDescription(string $description): self | |||||
{ | |||||
$this->description = $description; | |||||
return $this; | |||||
} | |||||
public function getThematic(): ?ThematicInterface | |||||
{ | |||||
return $this->thematic; | |||||
} | |||||
public function setThematic(?ThematicInterface $thematic): self | |||||
{ | |||||
$this->thematic = $thematic; | |||||
return $this; | |||||
} | |||||
public function getSubthematic(): ?SubthematicInterface | |||||
{ | |||||
return $this->subthematic; | |||||
} | |||||
public function setSubthematic(?SubthematicInterface $subthematic): self | |||||
{ | |||||
$this->subthematic = $subthematic; | |||||
return $this; | |||||
} | |||||
} |
namespace Lc\PietroBundle\Form\Dream; | namespace Lc\PietroBundle\Form\Dream; | ||||
use Lc\PietroBundle\Model\Dream; | |||||
use Lc\PietroBundle\Model\DreamModel; | |||||
use Lc\PietroBundle\Model\Subthematic; | use Lc\PietroBundle\Model\Subthematic; | ||||
use Lc\PietroBundle\Model\Thematic; | use Lc\PietroBundle\Model\Thematic; | ||||
use Lc\SovBundle\Doctrine\EntityManager; | use Lc\SovBundle\Doctrine\EntityManager; | ||||
{ | { | ||||
$resolver->setDefaults( | $resolver->setDefaults( | ||||
[ | [ | ||||
'data_class' => $this->em->getEntityName(Dream::class), | |||||
'data_class' => $this->em->getEntityName(DreamModel::class), | |||||
'context' => 'backend' | 'context' => 'backend' | ||||
] | ] | ||||
); | ); |
<?php | |||||
namespace Lc\PietroBundle\Model; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use App\Doctrine\Extension\DescriptionProjectInterface; | |||||
use App\Doctrine\Extension\DescriptionProjectTrait; | |||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
/** | |||||
* @ORM\MappedSuperclass() | |||||
*/ | |||||
abstract class Dream implements DescriptionProjectInterface, EntityInterface | |||||
{ | |||||
use DescriptionProjectTrait; | |||||
/** | |||||
* @ORM\ManyToOne(targetEntity=IndividualData::class, inversedBy="dream") | |||||
*/ | |||||
private $individualData; | |||||
public function __toString() | |||||
{ | |||||
return "Nos rêves"; | |||||
} | |||||
public function getIndividualData(): ?IndividualData | |||||
{ | |||||
return $this->individualData; | |||||
} | |||||
public function setIndividualData(?IndividualData $individualData): self | |||||
{ | |||||
$this->individualData = $individualData; | |||||
return $this; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\PietroBundle\Model; | |||||
interface DreamInterface | |||||
{ | |||||
} |
<?php | |||||
namespace Lc\PietroBundle\Model; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectInterface; | |||||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectTrait; | |||||
/** | |||||
* @ORM\MappedSuperclass() | |||||
*/ | |||||
abstract class DreamModel implements DescriptionProjectInterface, DreamInterface | |||||
{ | |||||
use DescriptionProjectTrait; | |||||
/** | |||||
* @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\IndividualDataInterface", inversedBy="dream") | |||||
*/ | |||||
private $individualData; | |||||
public function __toString() | |||||
{ | |||||
return "Nos rêves"; | |||||
} | |||||
public function getIndividualData(): ?IndividualDataInterface | |||||
{ | |||||
return $this->individualData; | |||||
} | |||||
public function setIndividualData(?IndividualDataInterface $individualData): self | |||||
{ | |||||
$this->individualData = $individualData; | |||||
return $this; | |||||
} | |||||
} |
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class IndividualData extends AbstractData | |||||
abstract class IndividualData extends AbstractData implements IndividualDataInterface | |||||
{ | { | ||||
/** | /** | ||||
private $introAnswer; | private $introAnswer; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity=Revolt::class, mappedBy="individualData", cascade={"persist", "remove"}) | |||||
* @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\RevoltInterface", mappedBy="individualData", cascade={"persist", "remove"}) | |||||
*/ | */ | ||||
protected $revolt; | protected $revolt; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity=Dream::class, mappedBy="individualData", cascade={"persist", "remove"}) | |||||
* @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\DreamInterface", mappedBy="individualData", cascade={"persist", "remove"}) | |||||
*/ | */ | ||||
protected $dream; | protected $dream; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity=ProjectBoost::class, mappedBy="individualData", cascade={"persist", "remove"}) | |||||
* @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\ProjectBoostInterface", mappedBy="individualData", cascade={"persist", "remove"}) | |||||
*/ | */ | ||||
protected $projectBoost; | protected $projectBoost; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity=ProjectInspiring::class, mappedBy="individualData", cascade={"persist", "remove"}) | |||||
* @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\ProjectInspiringInterface", mappedBy="individualData", cascade={"persist", "remove"}) | |||||
*/ | */ | ||||
protected $projectInspiring; | protected $projectInspiring; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity=Territory::class, inversedBy="individualData") | |||||
* @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\TerritoryInterface", inversedBy="individualData") | |||||
*/ | */ | ||||
protected $territory; | protected $territory; | ||||
} | } | ||||
/** | /** | ||||
* @return Collection|Revolt[] | |||||
* @return Collection|RevoltInterface[] | |||||
*/ | */ | ||||
public function getRevolt(): Collection | public function getRevolt(): Collection | ||||
{ | { | ||||
return $this->revolt; | return $this->revolt; | ||||
} | } | ||||
public function addRevolt(Revolt $revolt): self | |||||
public function addRevolt(RevoltInterface $revolt): self | |||||
{ | { | ||||
if (!$this->revolt->contains($revolt)) { | if (!$this->revolt->contains($revolt)) { | ||||
$this->revolt[] = $revolt; | $this->revolt[] = $revolt; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function removeRevolt(Revolt $revolt): self | |||||
public function removeRevolt(RevoltInterface $revolt): self | |||||
{ | { | ||||
if ($this->revolt->removeElement($revolt)) { | if ($this->revolt->removeElement($revolt)) { | ||||
// set the owning side to null (unless already changed) | // set the owning side to null (unless already changed) | ||||
} | } | ||||
/** | /** | ||||
* @return Collection|Dream[] | |||||
* @return Collection|DreamInterface[] | |||||
*/ | */ | ||||
public function getDream(): Collection | public function getDream(): Collection | ||||
{ | { | ||||
return $this->dream; | return $this->dream; | ||||
} | } | ||||
public function addDream(Dream $dream): self | |||||
public function addDream(DreamInterface $dream): self | |||||
{ | { | ||||
if (!$this->dream->contains($dream)) { | if (!$this->dream->contains($dream)) { | ||||
$this->dream[] = $dream; | $this->dream[] = $dream; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function removeDream(Dream $dream): self | |||||
public function removeDream(DreamInterface $dream): self | |||||
{ | { | ||||
if ($this->dream->removeElement($dream)) { | if ($this->dream->removeElement($dream)) { | ||||
// set the owning side to null (unless already changed) | // set the owning side to null (unless already changed) | ||||
} | } | ||||
/** | /** | ||||
* @return Collection|ProjectBoost[] | |||||
* @return Collection|ProjectBoostInterface[] | |||||
*/ | */ | ||||
public function getProjectBoost(): Collection | public function getProjectBoost(): Collection | ||||
{ | { | ||||
return $this->projectBoost; | return $this->projectBoost; | ||||
} | } | ||||
public function addProjectBoost(ProjectBoost $projectBoost): self | |||||
public function addProjectBoost(ProjectBoostInterface $projectBoost): self | |||||
{ | { | ||||
if (!$this->projectBoost->contains($projectBoost)) { | if (!$this->projectBoost->contains($projectBoost)) { | ||||
$this->projectBoost[] = $projectBoost; | $this->projectBoost[] = $projectBoost; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function removeProjectBoost(ProjectBoost $projectBoost): self | |||||
public function removeProjectBoost(ProjectBoostInterface $projectBoost): self | |||||
{ | { | ||||
if ($this->projectBoost->removeElement($projectBoost)) { | if ($this->projectBoost->removeElement($projectBoost)) { | ||||
// set the owning side to null (unless already changed) | // set the owning side to null (unless already changed) | ||||
} | } | ||||
/** | /** | ||||
* @return Collection|ProjectInspiring[] | |||||
* @return Collection|ProjectInspiringInterface[] | |||||
*/ | */ | ||||
public function getProjectInspiring(): Collection | public function getProjectInspiring(): Collection | ||||
{ | { | ||||
return $this->projectInspiring; | return $this->projectInspiring; | ||||
} | } | ||||
public function addProjectInspiring(ProjectInspiring $projectInspiring): self | |||||
public function addProjectInspiring(ProjectInspiringInterface $projectInspiring): self | |||||
{ | { | ||||
if (!$this->projectInspiring->contains($projectInspiring)) { | if (!$this->projectInspiring->contains($projectInspiring)) { | ||||
$this->projectInspiring[] = $projectInspiring; | $this->projectInspiring[] = $projectInspiring; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function removeProjectInspiring(ProjectInspiring $projectInspiring): self | |||||
public function removeProjectInspiring(ProjectInspiringInterface $projectInspiring): self | |||||
{ | { | ||||
if ($this->projectInspiring->removeElement($projectInspiring)) { | if ($this->projectInspiring->removeElement($projectInspiring)) { | ||||
// set the owning side to null (unless already changed) | // set the owning side to null (unless already changed) | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getTerritory(): ?Territory | |||||
public function getTerritory(): ?TerritoryInterface | |||||
{ | { | ||||
return $this->territory; | return $this->territory; | ||||
} | } | ||||
public function setTerritory(?Territory $territory): self | |||||
public function setTerritory(?TerritoryInterface $territory): self | |||||
{ | { | ||||
$this->territory = $territory; | $this->territory = $territory; | ||||
<?php | |||||
namespace Lc\PietroBundle\Model; | |||||
interface IndividualDataInterface | |||||
{ | |||||
} |
namespace Lc\PietroBundle\Model; | namespace Lc\PietroBundle\Model; | ||||
use App\Repository\ProjectBoostRepository; | |||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use App\Doctrine\Extension\DescriptionProjectInterface; | |||||
use App\Doctrine\Extension\DescriptionProjectTrait; | |||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectInterface; | |||||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectTrait; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class ProjectBoost implements DescriptionProjectInterface, EntityInterface | |||||
abstract class ProjectBoost implements DescriptionProjectInterface, ProjectBoostInterface | |||||
{ | { | ||||
use DescriptionProjectTrait; | use DescriptionProjectTrait; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity=IndividualData::class, inversedBy="projectBoost") | |||||
* @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\IndividualDataInterface", inversedBy="projectBoost") | |||||
*/ | */ | ||||
private $individualData; | private $individualData; | ||||
<?php | |||||
namespace Lc\PietroBundle\Model; | |||||
interface ProjectBoostInterface | |||||
{ | |||||
} |
namespace Lc\PietroBundle\Model; | namespace Lc\PietroBundle\Model; | ||||
use App\Repository\ProjectInspiringRepository; | |||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use App\Doctrine\Extension\DescriptionProjectInterface; | |||||
use App\Doctrine\Extension\DescriptionProjectTrait; | |||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectInterface; | |||||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectTrait; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class ProjectInspiring implements DescriptionProjectInterface, EntityInterface | |||||
abstract class ProjectInspiring implements DescriptionProjectInterface, ProjectInspiringInterface | |||||
{ | { | ||||
use DescriptionProjectTrait; | use DescriptionProjectTrait; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity=IndividualData::class, inversedBy="projectInspiring") | |||||
* @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\IndividualDataInterface", inversedBy="projectInspiring") | |||||
*/ | */ | ||||
private $individualData; | private $individualData; | ||||
return "Les actions inspirantes"; | return "Les actions inspirantes"; | ||||
} | } | ||||
public function getIndividualData(): ?IndividualData | |||||
public function getIndividualData(): ?IndividualDataInterface | |||||
{ | { | ||||
return $this->individualData; | return $this->individualData; | ||||
} | } | ||||
public function setIndividualData(?IndividualData $individualData): self | |||||
public function setIndividualData(?IndividualDataInterface $individualData): self | |||||
{ | { | ||||
$this->individualData = $individualData; | $this->individualData = $individualData; | ||||
<?php | |||||
namespace Lc\PietroBundle\Model; | |||||
interface ProjectInspiringInterface | |||||
{ | |||||
} |
namespace Lc\PietroBundle\Model; | namespace Lc\PietroBundle\Model; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use App\Doctrine\Extension\DescriptionProjectInterface; | |||||
use App\Doctrine\Extension\DescriptionProjectTrait; | |||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectInterface; | |||||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectTrait; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class Revolt implements DescriptionProjectInterface, EntityInterface | |||||
abstract class Revolt implements DescriptionProjectInterface, RevoltInterface | |||||
{ | { | ||||
use DescriptionProjectTrait; | use DescriptionProjectTrait; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity=IndividualData::class, inversedBy="revolt") | |||||
* @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\IndividualDataInterface", inversedBy="revolt") | |||||
*/ | */ | ||||
private $individualData; | private $individualData; | ||||
return "Nos révoltes"; | return "Nos révoltes"; | ||||
} | } | ||||
public function getIndividualData(): ?IndividualData | |||||
public function getIndividualData(): ?IndividualDataInterface | |||||
{ | { | ||||
return $this->individualData; | return $this->individualData; | ||||
} | } | ||||
public function setIndividualData(?IndividualData $individualData): self | |||||
public function setIndividualData(?IndividualDataInterface $individualData): self | |||||
{ | { | ||||
$this->individualData = $individualData; | $this->individualData = $individualData; | ||||
<?php | |||||
namespace Lc\PietroBundle\Model; | |||||
interface RevoltInterface | |||||
{ | |||||
} |
namespace Lc\PietroBundle\Model; | namespace Lc\PietroBundle\Model; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class Subthematic implements EntityInterface | |||||
abstract class Subthematic implements SubthematicInterface | |||||
{ | { | ||||
/** | /** | ||||
* @ORM\Column(type="string", length=255) | * @ORM\Column(type="string", length=255) | ||||
private $name; | private $name; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity=Thematic::class, inversedBy="subthematic") | |||||
* @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\ThematicInterface", inversedBy="subthematic") | |||||
*/ | */ | ||||
private $thematic; | private $thematic; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getThematic(): ?Thematic | |||||
public function getThematic(): ?ThematicInterface | |||||
{ | { | ||||
return $this->thematic; | return $this->thematic; | ||||
} | } | ||||
public function setThematic(?Thematic $thematic): self | |||||
public function setThematic(?ThematicInterface $thematic): self | |||||
{ | { | ||||
$this->thematic = $thematic; | $this->thematic = $thematic; | ||||
<?php | |||||
namespace Lc\PietroBundle\Model; | |||||
interface SubthematicInterface | |||||
{ | |||||
} |
namespace Lc\PietroBundle\Model; | namespace Lc\PietroBundle\Model; | ||||
use App\Repository\TerritoryRepository; | |||||
use Doctrine\Common\Collections\ArrayCollection; | use Doctrine\Common\Collections\ArrayCollection; | ||||
use Doctrine\Common\Collections\Collection; | use Doctrine\Common\Collections\Collection; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\DevAliasInterface; | use Lc\SovBundle\Doctrine\Extension\DevAliasInterface; | ||||
use Lc\SovBundle\Doctrine\Extension\DevAliasTrait; | use Lc\SovBundle\Doctrine\Extension\DevAliasTrait; | ||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class Territory implements EntityInterface, DevAliasInterface | |||||
abstract class Territory implements TerritoryInterface, DevAliasInterface | |||||
{ | { | ||||
use DevAliasTrait; | use DevAliasTrait; | ||||
private $name; | private $name; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity=IndividualData::class, mappedBy="territory") | |||||
* @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\IndividualDataInterface", mappedBy="territory") | |||||
*/ | */ | ||||
private $individualData; | private $individualData; | ||||
return $this->individualData; | return $this->individualData; | ||||
} | } | ||||
public function setIndividualData(?IndividualData $individualData): self | |||||
public function setIndividualData(?IndividualDataInterface $individualData): self | |||||
{ | { | ||||
$this->individualData = $individualData; | $this->individualData = $individualData; | ||||
} | } | ||||
/** | /** | ||||
* @return Collection|Territory[] | |||||
* @return Collection|TerritoryInterface[] | |||||
*/ | */ | ||||
public function getTerritory(): Collection | public function getTerritory(): Collection | ||||
{ | { | ||||
return $this->territory; | return $this->territory; | ||||
} | } | ||||
public function addTerritory(Territory $territory): self | |||||
public function addTerritory(TerritoryInterface $territory): self | |||||
{ | { | ||||
if (!$this->territory->contains($territory)) { | if (!$this->territory->contains($territory)) { | ||||
$this->territory[] = $territory; | $this->territory[] = $territory; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function removeTerritory(Territory $territory): self | |||||
public function removeTerritory(TerritoryInterface $territory): self | |||||
{ | { | ||||
if ($this->territory->removeElement($territory)) { | if ($this->territory->removeElement($territory)) { | ||||
// set the owning side to null (unless already changed) | // set the owning side to null (unless already changed) |
<?php | |||||
namespace Lc\PietroBundle\Model; | |||||
interface TerritoryInterface | |||||
{ | |||||
} |
namespace Lc\PietroBundle\Model; | namespace Lc\PietroBundle\Model; | ||||
use App\Repository\ThematicRepository; | |||||
use Doctrine\Common\Collections\ArrayCollection; | use Doctrine\Common\Collections\ArrayCollection; | ||||
use Doctrine\Common\Collections\Collection; | use Doctrine\Common\Collections\Collection; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class Thematic implements EntityInterface | |||||
abstract class Thematic implements ThematicInterface | |||||
{ | { | ||||
/** | /** | ||||
private $name; | private $name; | ||||
/** | /** | ||||
* @ORM\OneToMany(targetEntity=Subthematic::class, mappedBy="thematic", cascade={"persist", "remove"}) | |||||
* @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\SubthematicInterface", mappedBy="thematic", cascade={"persist", "remove"}) | |||||
*/ | */ | ||||
private $subthematic; | private $subthematic; | ||||
} | } | ||||
/** | /** | ||||
* @return Collection|Subthematic[] | |||||
* @return Collection|SubthematicInterface[] | |||||
*/ | */ | ||||
public function getSubthematic(): Collection | public function getSubthematic(): Collection | ||||
{ | { | ||||
return $this->subthematic; | return $this->subthematic; | ||||
} | } | ||||
public function addSubthematic(Subthematic $subthematic): self | |||||
public function addSubthematic(SubthematicInterface $subthematic): self | |||||
{ | { | ||||
if (!$this->subthematic->contains($subthematic)) { | if (!$this->subthematic->contains($subthematic)) { | ||||
$this->subthematic[] = $subthematic; | $this->subthematic[] = $subthematic; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function removeSubthematic(Subthematic $subthematic): self | |||||
public function removeSubthematic(SubthematicInterface $subthematic): self | |||||
{ | { | ||||
if ($this->subthematic->removeElement($subthematic)) { | if ($this->subthematic->removeElement($subthematic)) { | ||||
// set the owning side to null (unless already changed) | // set the owning side to null (unless already changed) |
<?php | |||||
namespace Lc\PietroBundle\Model; | |||||
interface ThematicInterface | |||||
{ | |||||
} |
namespace Lc\PietroBundle\Repository\Dream; | namespace Lc\PietroBundle\Repository\Dream; | ||||
use Lc\PietroBundle\Model\Dream; | |||||
use Lc\PietroBundle\Model\DreamModel; | |||||
use Lc\SovBundle\Repository\AbstractRepository; | use Lc\SovBundle\Repository\AbstractRepository; | ||||
use Doctrine\Persistence\ManagerRegistry; | use Doctrine\Persistence\ManagerRegistry; | ||||
{ | { | ||||
public function __construct(ManagerRegistry $registry) | public function __construct(ManagerRegistry $registry) | ||||
{ | { | ||||
parent::__construct($registry, Dream::class); | |||||
parent::__construct($registry, DreamModel::class); | |||||
} | } | ||||
} | } |
use Knp\Component\Pager\PaginatorInterface; | use Knp\Component\Pager\PaginatorInterface; | ||||
use Lc\PietroBundle\Repository\Search\SearchRepositoryQuery; | use Lc\PietroBundle\Repository\Search\SearchRepositoryQuery; | ||||
class DreamRepositoryQuery extends SearchRepositoryQuery | |||||
class DreamRepositoryQuery extends SearchRepositoryQuery implements DreamRepositoryQueryInterface | |||||
{ | { | ||||
public function __construct(DreamRepository $repository, PaginatorInterface $paginator) | public function __construct(DreamRepository $repository, PaginatorInterface $paginator) | ||||
{ | { |
<?php | |||||
namespace Lc\PietroBundle\Repository\Dream; | |||||
interface DreamRepositoryQueryInterface | |||||
{ | |||||
} |
namespace Lc\PietroBundle\Repository\Dream; | namespace Lc\PietroBundle\Repository\Dream; | ||||
use Lc\PietroBundle\Repository\Search\SearchStore; | use Lc\PietroBundle\Repository\Search\SearchStore; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
class DreamStore extends SearchStore | |||||
class DreamStore extends SearchStore implements DreamStoreInterface | |||||
{ | { | ||||
protected $query; | protected $query; | ||||
public function __construct(DreamRepositoryQuery $query) | |||||
public function __construct(DreamRepositoryQueryInterface $query) | |||||
{ | { | ||||
$this->query = $query; | $this->query = $query; | ||||
} | } | ||||
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||||
{ | |||||
return $query; | |||||
} | |||||
} | } |
<?php | |||||
namespace Lc\PietroBundle\Repository\Dream; | |||||
interface DreamStoreInterface | |||||
{ | |||||
} |