src/Entity/Slider.php line 28
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\SliderRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use ApiPlatform\Metadata\ApiFilter;use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\Entity(repositoryClass: SliderRepository::class)]#[ApiResource(normalizationContext: ['groups' => ['slider:read']],denormalizationContext: ['groups' => ['slider:write']],order: ['id' => 'DESC'],)]#[ApiFilter(SearchFilter::class,properties: ['slug' => 'ipartial','name' => 'ipartial',])]class Slider{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['slider:read', 'slider:write', 'page:read', 'pageInfo:read'])]private ?int $id = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['slider:read', 'slider:write', 'page:read', 'pageInfo:read'])]private ?string $name = null;#[ORM\Column(length: 100, nullable: true)]#[Groups(['slider:read', 'slider:write', 'page:read', 'pageInfo:read'])]private ?string $slug = null;#[ORM\Column(type: Types::TEXT)]#[Groups(['slider:read', 'slider:write', 'page:read', 'pageInfo:read'])]private ?string $content = null;#[ORM\OneToMany(mappedBy: 'slider', targetEntity: PageInfos::class)]#[Groups(['slider:read', 'slider:write'])]private Collection $pageInfos;#[ORM\OneToMany(mappedBy: 'slider', targetEntity: Projects::class)]#[Groups(['slider:read', 'slider:write'])]private Collection $projects;#[ORM\OneToMany(mappedBy: 'slider', targetEntity: Slide::class)]#[Groups(['slider:read', 'slider:write', 'page:read', 'pageInfo:read'])]private Collection $slides;#[ORM\OneToMany(mappedBy: 'slider', targetEntity: Pages::class)]private Collection $pages;#[Groups(['slider:read', 'slider:write', 'page:read', 'pageInfo:read'])]#[ORM\ManyToOne(inversedBy: 'sliders')]private ?Languages $language = null;#[Groups(['slider:read', 'slider:write', 'page:read', 'pageInfo:read'])]#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'translations')]private ?self $translation = null;/*** @var Collection<int, self>*/#[Groups(['slider:read', 'slider:write', 'page:read', 'pageInfo:read'])]#[ORM\OneToMany(mappedBy: 'translation', targetEntity: self::class)]private Collection $translations;public function __construct(){$this->pageInfos = new ArrayCollection();$this->projects = new ArrayCollection();$this->slides = new ArrayCollection();$this->pages = new ArrayCollection();$this->translations = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(?string $name): static{$this->name = $name;return $this;}public function getSlug(): ?string{return $this->slug;}public function setSlug(?string $slug): static{$this->slug = $slug;return $this;}public function getContent(): ?string{return $this->content;}public function setContent(string $content): static{$this->content = $content;return $this;}/*** @return Collection<int, PageInfos>*/public function getPageInfos(): Collection{return $this->pageInfos;}public function addPageInfo(PageInfos $pageInfo): static{if (!$this->pageInfos->contains($pageInfo)) {$this->pageInfos->add($pageInfo);$pageInfo->setSlider($this);}return $this;}public function removePageInfo(PageInfos $pageInfo): static{if ($this->pageInfos->removeElement($pageInfo)) {// set the owning side to null (unless already changed)if ($pageInfo->getSlider() === $this) {$pageInfo->setSlider(null);}}return $this;}/*** @return Collection<int, Projects>*/public function getProjects(): Collection{return $this->projects;}public function addProject(Projects $project): static{if (!$this->projects->contains($project)) {$this->projects->add($project);$project->setSlider($this);}return $this;}public function removeProject(Projects $project): static{if ($this->projects->removeElement($project)) {// set the owning side to null (unless already changed)if ($project->getSlider() === $this) {$project->setSlider(null);}}return $this;}/*** @return Collection<int, Slide>*/public function getSlides(): Collection{return $this->slides;}public function addSlide(Slide $slide): static{if (!$this->slides->contains($slide)) {$this->slides->add($slide);$slide->setSlider($this);}return $this;}public function removeSlide(Slide $slide): static{if ($this->slides->removeElement($slide)) {// set the owning side to null (unless already changed)if ($slide->getSlider() === $this) {$slide->setSlider(null);}}return $this;}/*** @return Collection<int, Pages>*/public function getPages(): Collection{return $this->pages;}public function addPage(Pages $page): static{if (!$this->pages->contains($page)) {$this->pages->add($page);$page->setSlider($this);}return $this;}public function removePage(Pages $page): static{if ($this->pages->removeElement($page)) {// set the owning side to null (unless already changed)if ($page->getSlider() === $this) {$page->setSlider(null);}}return $this;}public function getLanguage(): ?Languages{return $this->language;}public function setLanguage(?Languages $language): static{$this->language = $language;return $this;}public function getTranslation(): ?self{return $this->translation;}public function setTranslation(?self $translation): static{$this->translation = $translation;return $this;}/*** @return Collection<int, self>*/public function getTranslations(): Collection{return $this->translations;}public function addTranslation(self $translation): static{if (!$this->translations->contains($translation)) {$this->translations->add($translation);$translation->setTranslation($this);}return $this;}public function removeTranslation(self $translation): static{if ($this->translations->removeElement($translation)) {// set the owning side to null (unless already changed)if ($translation->getTranslation() === $this) {$translation->setTranslation(null);}}return $this;}}