src/Entity/MediaObject.php line 73
<?php
// api/src/Entity/MediaObject.php
namespace App\Entity;
use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Put;
use ApiPlatform\Metadata\Delete;
use App\Controller\CreateMediaObjectAction;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
use Doctrine\DBAL\Types\Types;
use Symfony\Component\Serializer\Annotation\MaxDepth;
#[Vich\Uploadable]
#[ORM\Entity]
#[ApiResource(
normalizationContext: ['groups' => ['media_object:read']],
denormalizationContext: ['groups' => ['media_object:write']],
types: ['https://schema.org/MediaObject'],
operations: [
new Get(),
new GetCollection(),
new Delete(),
new Put(),
new Post(
controller: CreateMediaObjectAction::class,
deserialize: false,
validationContext: ['groups' => ['Default', 'media_object_create']],
openapiContext: [
'requestBody' => [
'content' => [
'multipart/form-data' => [
'schema' => [
'type' => 'object',
'properties' => [
'file' => [
'type' => 'string',
'format' => 'binary'
]
]
]
]
]
]
]
)
],
order: ['sort' => 'DESC', 'id' => 'DESC'],
)]
#[ApiFilter(SearchFilter::class, properties: [
'product.id' => 'exact',
'orders.id' => 'exact',
'orders.account.user.id' => 'exact',
])]
#[ORM\HasLifecycleCallbacks]
class MediaObject
{
#[Groups(['media_object:read', 'product:read', 'cat:read', 'user_like:read', 'pre_order_product:read', 'pre_order:read', 'order:read', 'order_product:read','order_product:read','user:read', 'account:read', 'load_invoice:read', 'worker:read', 'account_worker:read', 'job:read', 'site_product:read', 'news:read', 'slider:read', 'gallery:read','gallery_items:read', 'menu:read', 'user_docs:read', 'product_releted:read', 'materials:read', 'objects:read', 'projects:read', 'posts:read', 'page:read', 'pageInfo:read', 'documents:read'])]
#[ORM\Id, ORM\Column, ORM\GeneratedValue]
private ?int $id = null;
#[ApiProperty(types: ['https://schema.org/contentUrl'])]
#[Groups(['media_object:read', 'product:read', 'cat:read', 'user_like:read', 'pre_order_product:read', 'pre_order:read', 'order:read', 'order_product:read','order_product:read', 'user:read', 'account:read', 'load_invoice:read', 'worker:read', 'account_worker:read', 'job:read', 'site_product:read', 'news:read', 'slider:read', 'gallery:read','gallery_items:read', 'menu:read', 'user_docs:read', 'product_releted:read', 'materials:read', 'objects:read', 'projects:read', 'posts:read', 'page:read', 'pageInfo:read', 'documents:read'])]
public ?string $contentUrl = null;
#[Vich\UploadableField(mapping: "media_object", fileNameProperty: "filePath")]
#[Assert\NotNull(groups: ['media_object_create'])]
public ?File $file = null;
#[Groups(['media_object:read', 'product:read', 'cat:read', 'user_like:read', 'pre_order_product:read', 'pre_order:read', 'order:read', 'order_product:read','order_product:read', 'user:read', 'account:read', 'load_invoice:read', 'worker:read', 'account_worker:read', 'job:read', 'site_product:read', 'gallery:read','gallery_items:read', 'menu:read', 'projects:read'])]
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
public $uploadTimestamp;
#[Groups(['media_object:read', 'product:read', 'user_like:read', 'pre_order_product:read', 'pre_order:read', 'order:read', 'order_product:read','order_product:read','user:read', 'account:read', 'load_invoice:read', 'worker:read', 'account_worker:read', 'job:read', 'cat:read', 'site_product:read', 'gallery:read','gallery_items:read', 'menu:read', 'projects:read'])]
#[ORM\Column(nullable: true)]
private ?bool $main = null;
#[ORM\Column(nullable: true)]
#[Groups(['media_object:read', 'product:read', 'cat:read', 'user_like:read', 'pre_order_product:read', 'pre_order:read', 'order:read', 'order_product:read','order_product:read', 'user:read', 'account:read', 'load_invoice:read', 'worker:read', 'account_worker:read', 'job:read', 'site_product:read', 'gallery:read','gallery_items:read'])]
public ?string $filePath = null;
#[Groups(['media_object_create'])]
#[ORM\ManyToOne(inversedBy: 'media')]
#[ORM\JoinColumn(name: 'product_id', referencedColumnName: 'id', onDelete: 'SET NULL')]
private ?Products $product = null;
#[Groups(['media_object_create'])]
#[ORM\ManyToOne(inversedBy: 'mediaObjects')]
private ?Orders $orders = null;
#[Groups(['media_object:read', 'media_object_create'])]
#[ORM\Column(length: 100, nullable: true)]
private ?string $type = null;
#[Groups(['media_object:read', 'media_object_create'])]
#[ORM\Column(length: 255, nullable: true)]
private ?string $name = null;
#[Groups(['media_object_create'])]
#[ORM\ManyToOne(inversedBy: 'mediaObjects')]
private ?User $users = null;
#[ORM\OneToMany(mappedBy: 'media', targetEntity: UsersDocs::class)]
private Collection $usersDocs;
#[Groups(['media_object_create'])]
#[ORM\ManyToOne(inversedBy: 'media')]
private ?AccountWorker $accountWorker = null;
#[Groups(['media_object_create'])]
#[ORM\ManyToOne(inversedBy: 'media')]
private ?FormAnswer $formAnswer = null;
#[Groups(['media_object_create'])]
#[ORM\ManyToOne(inversedBy: 'mediaObjects', cascade:['persist'])]
private ?Jobs $job = null;
#[ORM\OneToMany(mappedBy: 'photo', targetEntity: Workers::class, cascade:['persist'])]
private Collection $workers;
#[ORM\OneToMany(mappedBy: 'document', targetEntity: AccountJobsList::class, cascade:['persist'])]
private Collection $accountJobsLists;
#[ORM\OneToMany(mappedBy: 'commandment', targetEntity: Jobs::class, cascade:['persist'])]
private Collection $commandment_jobs;
#[ORM\OneToMany(mappedBy: 'graph', targetEntity: Jobs::class, cascade:['persist'])]
private Collection $graph_jobs;
#[ORM\OneToMany(mappedBy: 'protocole', targetEntity: Jobs::class, cascade:['persist'])]
private Collection $protocole_jobs;
#[ORM\OneToMany(mappedBy: 'mainMedia', targetEntity: Products::class)]
private Collection $MainProducts;
#[Groups(['media_object:read', 'product:read', 'user_like:read', 'pre_order_product:read', 'pre_order:read', 'order:read', 'order_product:read','order_product:read','user:read', 'account:read', 'load_invoice:read', 'worker:read', 'account_worker:read', 'job:read', 'site_product:read', 'cat:read', 'news:read', 'product_releted:read', 'materials:read', 'objects:read', 'projects:read', 'posts:read', 'page:read', 'pageInfo:read'])]
#[ORM\Column(nullable: true)]
private ?int $size = null;
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'resizeImagings')]
private ?self $resizeImgParent = null;
#[Groups(['media_object:read', 'product:read', 'user_like:read', 'pre_order_product:read', 'pre_order:read', 'order:read', 'order_product:read','order_product:read','user:read', 'account:read', 'load_invoice:read', 'worker:read', 'account_worker:read', 'job:read', 'site_product:read', 'cat:read', 'news:read', 'slider:read', 'gallery:read','gallery_items:read', 'user_docs:read', 'product_releted:read', 'materials:read', 'posts:read', 'objects:read', 'projects:read', 'posts:read', 'page:read', 'pageInfo:read'])]
#[ORM\OneToMany(mappedBy: 'resizeImgParent', targetEntity: self::class, cascade:['persist', 'remove'])]
private Collection $resizeImagings;
#[ORM\OneToMany(mappedBy: 'media', targetEntity: SiteProductsMedia::class, cascade:['persist', 'remove'])]
private Collection $siteProductsMedia;
#[ORM\OneToMany(mappedBy: 'media', targetEntity: Category::class, cascade:['persist'])]
private Collection $categories;
#[ORM\OneToMany(mappedBy: 'media', targetEntity: Slide::class)]
private Collection $slides;
#[ORM\OneToMany(mappedBy: 'mainMediaHover', targetEntity: Products::class)]
private Collection $productsHover;
#[ORM\OneToMany(mappedBy: 'media', targetEntity: News::class)]
private Collection $news;
/**
* @var Collection<int, GalleryItems>
*/
#[ORM\OneToMany(mappedBy: 'media', targetEntity: GalleryItems::class)]
private Collection $galleryItems;
/**
* @var Collection<int, MenuItems>
*/
#[ORM\OneToMany(mappedBy: 'media', targetEntity: MenuItems::class)]
private Collection $menuItems;
/**
* @var Collection<int, VacancyRequest>
*/
#[ORM\OneToMany(mappedBy: 'media', targetEntity: VacancyRequest::class)]
private Collection $vacancyRequests;
/**
* @var Collection<int, MaterialMedia>
*/
#[ORM\OneToMany(mappedBy: 'media', targetEntity: MaterialMedia::class)]
private Collection $materialMedia;
/**
* @var Collection<int, Accounts>
*/
#[ORM\OneToMany(mappedBy: 'media', targetEntity: Accounts::class, cascade:['all'])]
private Collection $accounts;
/**
* @var Collection<int, Objects>
*/
#[ORM\OneToMany(mappedBy: 'mainMedia', targetEntity: Objects::class, cascade:['all'])]
private Collection $objects;
/**
* @var Collection<int, Projects>
*/
#[ORM\OneToMany(mappedBy: 'mainMedia', targetEntity: Projects::class)]
private Collection $projects;
/**
* @var Collection<int, Posts>
*/
#[ORM\OneToMany(mappedBy: 'mainMedia', targetEntity: Posts::class)]
private Collection $posts;
#[ORM\OneToMany(mappedBy: 'mobileMedia', targetEntity: Slide::class)]
private Collection $MobileSlides;
#[Groups(['media_object:read', 'media_object:write', 'product:read', 'user_like:read', 'pre_order_product:read', 'pre_order:read', 'order:read', 'order_product:read','order_product:read','user:read', 'account:read', 'load_invoice:read', 'worker:read', 'account_worker:read', 'job:read', 'site_product:read', 'cat:read', 'news:read', 'product_releted:read'])]
#[ORM\Column(nullable: true)]
private ?int $sort = null;
/**
* @var Collection<int, Documents>
*/
#[ORM\OneToMany(mappedBy: 'media', targetEntity: Documents::class)]
private Collection $documents;
public function __construct()
{
$this->usersDocs = new ArrayCollection();
$this->workers = new ArrayCollection();
$this->accountJobsLists = new ArrayCollection();
$this->commandment_jobs = new ArrayCollection();
$this->graph_jobs = new ArrayCollection();
$this->protocole_jobs = new ArrayCollection();
$this->MainProducts = new ArrayCollection();
$this->resizeImagings = new ArrayCollection();
$this->siteProductsMedia = new ArrayCollection();
$this->categories = new ArrayCollection();
$this->slides = new ArrayCollection();
$this->productsHover = new ArrayCollection();
$this->news = new ArrayCollection();
// $this->galleryItems = new ArrayCollection();
$this->menuItems = new ArrayCollection();
$this->vacancyRequests = new ArrayCollection();
$this->materialMedia = new ArrayCollection();
$this->accounts = new ArrayCollection();
$this->objects = new ArrayCollection();
$this->MobileSlides = new ArrayCollection();
$this->projects = new ArrayCollection();
$this->posts = new ArrayCollection();
$this->documents = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getUploadTimestamp(): ?\DateTimeInterface
{
return $this->uploadTimestamp;
}
public function getProduct(): ?Products
{
return $this->product;
}
public function setProduct(?Products $product): self
{
$this->product = $product;
return $this;
}
public function getOrders(): ?Orders
{
return $this->orders;
}
public function setOrders(?Orders $orders): self
{
$this->orders = $orders;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getUsers(): ?User
{
return $this->users;
}
public function setUsers(?User $users): self
{
$this->users = $users;
return $this;
}
public function getAccountWorker(): ?AccountWorker
{
return $this->accountWorker;
}
public function setAccountWorker(?AccountWorker $accountWorker): self
{
$this->accountWorker = $accountWorker;
return $this;
}
public function setFormAnswer(?FormAnswer $formAnswer): self
{
$this->formAnswer = $formAnswer;
return $this;
}
/**
* @return Collection<int, UsersDocs>
*/
public function getUsersDocs(): Collection
{
return $this->usersDocs;
}
public function addUsersDoc(UsersDocs $usersDoc): static
{
if (!$this->usersDocs->contains($usersDoc)) {
$this->usersDocs->add($usersDoc);
$usersDoc->setMedia($this);
}
return $this;
}
public function getJob(): ?Jobs
{
return $this->job;
}
public function setJob(?Jobs $job): self
{
$this->job = $job;
return $this;
}
/**
* @return Collection<int, Workers>
*/
public function getWorkers(): Collection
{
return $this->workers;
}
public function addWorker(Workers $worker): self
{
if (!$this->workers->contains($worker)) {
$this->workers->add($worker);
$worker->setPhoto($this);
}
return $this;
}
public function removeUsersDoc(UsersDocs $usersDoc): static
{
if ($this->usersDocs->removeElement($usersDoc)) {
// set the owning side to null (unless already changed)
if ($usersDoc->getMedia() === $this) {
$usersDoc->setMedia(null);
}
}
return $this;
}
public function removeWorker(Workers $worker): self
{
if ($this->workers->removeElement($worker)) {
// set the owning side to null (unless already changed)
if ($worker->getPhoto() === $this) {
$worker->setPhoto(null);
}
}
return $this;
}
/**
* @return Collection<int, AccountJobsList>
*/
public function getAccountJobsLists(): Collection
{
return $this->accountJobsLists;
}
public function addAccountJobsList(AccountJobsList $accountJobsList): self
{
if (!$this->accountJobsLists->contains($accountJobsList)) {
$this->accountJobsLists->add($accountJobsList);
$accountJobsList->setDocument($this);
}
return $this;
}
public function removeAccountJobsList(AccountJobsList $accountJobsList): self
{
if ($this->accountJobsLists->removeElement($accountJobsList)) {
// set the owning side to null (unless already changed)
if ($accountJobsList->getDocument() === $this) {
$accountJobsList->setDocument(null);
}
}
return $this;
}
/**
* @return Collection<int, Jobs>
*/
public function getCommandmentJobs(): Collection
{
return $this->commandment_jobs;
}
public function addCommandmentJob(Jobs $commandmentJob): self
{
if (!$this->commandment_jobs->contains($commandmentJob)) {
$this->commandment_jobs->add($commandmentJob);
$commandmentJob->setCommandment($this);
}
return $this;
}
public function removeCommandmentJob(Jobs $commandmentJob): self
{
if ($this->commandment_jobs->removeElement($commandmentJob)) {
// set the owning side to null (unless already changed)
if ($commandmentJob->getCommandment() === $this) {
$commandmentJob->setCommandment(null);
}
}
return $this;
}
/**
* @return Collection<int, Jobs>
*/
public function getGraphJobs(): Collection
{
return $this->graph_jobs;
}
public function addGraphJob(Jobs $graphJob): self
{
if (!$this->graph_jobs->contains($graphJob)) {
$this->graph_jobs->add($graphJob);
$graphJob->setGraph($this);
}
return $this;
}
public function removeGraphJob(Jobs $graphJob): self
{
if ($this->graph_jobs->removeElement($graphJob)) {
// set the owning side to null (unless already changed)
if ($graphJob->getGraph() === $this) {
$graphJob->setGraph(null);
}
}
return $this;
}
/**
* @return Collection<int, Jobs>
*/
public function getProtocoleJobs(): Collection
{
return $this->protocole_jobs;
}
public function addProtocoleJob(Jobs $protocoleJob): self
{
if (!$this->protocole_jobs->contains($protocoleJob)) {
$this->protocole_jobs->add($protocoleJob);
$protocoleJob->setProtocole($this);
}
return $this;
}
public function removeProtocoleJob(Jobs $protocoleJob): self
{
if ($this->protocole_jobs->removeElement($protocoleJob)) {
// set the owning side to null (unless already changed)
if ($protocoleJob->getProtocole() === $this) {
$protocoleJob->setProtocole(null);
}
}
return $this;
}
public function isMain(): ?bool
{
return $this->main;
}
public function setMain(?bool $main): self
{
$this->main = $main;
return $this;
}
/**
* @return Collection<int, Products>
*/
public function getMainProducts(): Collection
{
return $this->MainProducts;
}
public function addMainProduct(Products $mainProduct): self
{
if (!$this->MainProducts->contains($mainProduct)) {
$this->MainProducts->add($mainProduct);
$mainProduct->setMainMedia($this);
}
return $this;
}
public function removeMainProduct(Products $mainProduct): self
{
if ($this->MainProducts->removeElement($mainProduct)) {
// set the owning side to null (unless already changed)
if ($mainProduct->getMainMedia() === $this) {
$mainProduct->setMainMedia(null);
}
}
return $this;
}
#[ORM\PrePersist]
public function setCreatedAtValue(): void
{
$this->uploadTimestamp = new \DateTime();
}
public function getSize(): ?int
{
return $this->size;
}
public function setSize(?int $size): static
{
$this->size = $size;
return $this;
}
public function getResizeImgParent(): ?self
{
return $this->resizeImgParent;
}
public function setResizeImgParent(?self $resizeImgParent): static
{
$this->resizeImgParent = $resizeImgParent;
return $this;
}
/**
* @return Collection<int, self>
*/
public function getResizeImagings(): Collection
{
return $this->resizeImagings;
}
public function addResizeImging(self $resizeImging): static
{
if (!$this->resizeImagings->contains($resizeImging)) {
$this->resizeImagings->add($resizeImging);
$resizeImging->setResizeImgParent($this);
}
return $this;
}
public function removeResizeImging(self $resizeImging): static
{
if ($this->resizeImagings->removeElement($resizeImging)) {
// set the owning side to null (unless already changed)
if ($resizeImging->getResizeImgParent() === $this) {
$resizeImging->setResizeImgParent(null);
}
}
return $this;
}
/**
* @return Collection<int, SiteProductsMedia>
*/
public function getSiteProductsMedia(): Collection
{
return $this->siteProductsMedia;
}
public function addSiteProductsMedium(SiteProductsMedia $siteProductsMedium): static
{
if (!$this->siteProductsMedia->contains($siteProductsMedium)) {
$this->siteProductsMedia->add($siteProductsMedium);
$siteProductsMedium->setMedia($this);
}
return $this;
}
public function removeSiteProductsMedium(SiteProductsMedia $siteProductsMedium): static
{
if ($this->siteProductsMedia->removeElement($siteProductsMedium)) {
// set the owning side to null (unless already changed)
if ($siteProductsMedium->getMedia() === $this) {
$siteProductsMedium->setMedia(null);
}
}
return $this;
}
/**
* @return Collection<int, Category>
*/
public function getCategories(): Collection
{
return $this->categories;
}
public function addCategory(Category $category): static
{
if (!$this->categories->contains($category)) {
$this->categories->add($category);
$category->setMedia($this);
}
return $this;
}
public function removeCategory(Category $category): static
{
if ($this->categories->removeElement($category)) {
// set the owning side to null (unless already changed)
if ($category->getMedia() === $this) {
$category->setMedia(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->setMedia($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->getMedia() === $this) {
$slide->setMedia(null);
}
}
return $this;
}
/**
* @return Collection<int, Products>
*/
public function getProductsHover(): Collection
{
return $this->productsHover;
}
public function addProductsHover(Products $productsHover): static
{
if (!$this->productsHover->contains($productsHover)) {
$this->productsHover->add($productsHover);
$productsHover->setMainMediaHover($this);
}
return $this;
}
public function removeProductsHover(Products $productsHover): static
{
if ($this->productsHover->removeElement($productsHover)) {
// set the owning side to null (unless already changed)
if ($productsHover->getMainMediaHover() === $this) {
$productsHover->setMainMediaHover(null);
}
}
return $this;
}
/**
* @return Collection<int, News>
*/
public function getNews(): Collection
{
return $this->news;
}
public function addNews(News $news): static
{
if (!$this->news->contains($news)) {
$this->news->add($news);
$news->setMedia($this);
}
return $this;
}
public function removeNews(News $news): static
{
if ($this->news->removeElement($news)) {
// set the owning side to null (unless already changed)
if ($news->getMedia() === $this) {
$news->setMedia(null);
}
}
return $this;
}
/**
* @return Collection<int, GalleryItems>
*/
public function getGalleryItems(): Collection
{
return $this->galleryItems;
}
public function addGalleryItem(GalleryItems $galleryItem): static
{
if (!$this->galleryItems->contains($galleryItem)) {
$this->galleryItems->add($galleryItem);
$galleryItem->setMedia($this);
}
return $this;
}
public function removeGalleryItem(GalleryItems $galleryItem): static
{
if ($this->galleryItems->removeElement($galleryItem)) {
// set the owning side to null (unless already changed)
if ($galleryItem->getMedia() === $this) {
$galleryItem->setMedia(null);
}
}
return $this;
}
/**
* @return Collection<int, MenuItems>
*/
public function getMenuItems(): Collection
{
return $this->menuItems;
}
public function addMenuItem(MenuItems $menuItem): static
{
if (!$this->menuItems->contains($menuItem)) {
$this->menuItems->add($menuItem);
$menuItem->setMedia($this);
}
return $this;
}
public function removeMenuItem(MenuItems $menuItem): static
{
if ($this->menuItems->removeElement($menuItem)) {
// set the owning side to null (unless already changed)
if ($menuItem->getMedia() === $this) {
$menuItem->setMedia(null);
}
}
return $this;
}
/**
* @return Collection<int, VacancyRequest>
*/
public function getVacancyRequests(): Collection
{
return $this->vacancyRequests;
}
public function addVacancyRequest(VacancyRequest $vacancyRequest): static
{
if (!$this->vacancyRequests->contains($vacancyRequest)) {
$this->vacancyRequests->add($vacancyRequest);
$vacancyRequest->setMedia($this);
}
return $this;
}
public function removeVacancyRequest(VacancyRequest $vacancyRequest): static
{
if ($this->vacancyRequests->removeElement($vacancyRequest)) {
// set the owning side to null (unless already changed)
if ($vacancyRequest->getMedia() === $this) {
$vacancyRequest->setMedia(null);
}
}
return $this;
}
/**
* @return Collection<int, MaterialMedia>
*/
public function getMaterialMedia(): Collection
{
return $this->materialMedia;
}
public function addMaterialMedium(MaterialMedia $materialMedium): static
{
if (!$this->materialMedia->contains($materialMedium)) {
$this->materialMedia->add($materialMedium);
$materialMedium->setMedia($this);
}
return $this;
}
public function removeMaterialMedium(MaterialMedia $materialMedium): static
{
if ($this->materialMedia->removeElement($materialMedium)) {
// set the owning side to null (unless already changed)
if ($materialMedium->getMedia() === $this) {
$materialMedium->setMedia(null);
}
}
return $this;
}
/**
* @return Collection<int, Accounts>
*/
public function getAccounts(): Collection
{
return $this->accounts;
}
public function addAccount(Accounts $account): static
{
if (!$this->accounts->contains($account)) {
$this->accounts->add($account);
$account->setMedia($this);
}
return $this;
}
public function removeAccount(Accounts $account): static
{
if ($this->accounts->removeElement($account)) {
// set the owning side to null (unless already changed)
if ($account->getMedia() === $this) {
$account->setMedia(null);
}
}
return $this;
}
/**
* @return Collection<int, Objects>
*/
public function getObjects(): Collection
{
return $this->objects;
}
public function addObject(Objects $object): static
{
if (!$this->objects->contains($object)) {
$this->objects->add($object);
$object->setMainMedia($this);
}
return $this;
}
public function removeObject(Objects $object): static
{
if ($this->objects->removeElement($object)) {
// set the owning side to null (unless already changed)
if ($object->getMainMedia() === $this) {
$object->setMainMedia(null);
}
}
return $this;
}
/**
* @return Collection<int, Slide>
*/
public function getMobileSlides(): Collection
{
return $this->MobileSlides;
}
public function addMobileSlide(Slide $mobileSlide): static
{
if (!$this->MobileSlides->contains($mobileSlide)) {
$this->MobileSlides->add($mobileSlide);
$mobileSlide->setMobileMedia($this);
}
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->setMainMedia($this);
}
return $this;
}
public function removeMobileSlide(Slide $mobileSlide): static
{
if ($this->MobileSlides->removeElement($mobileSlide)) {
// set the owning side to null (unless already changed)
if ($mobileSlide->getMobileMedia() === $this) {
$mobileSlide->setMobileMedia(null);
}
return $this;
}
}
public function removeProject(Projects $project): static
{
if ($this->projects->removeElement($project)) {
// set the owning side to null (unless already changed)
if ($project->getMainMedia() === $this) {
$project->setMainMedia(null);
}
}
return $this;
}
public function getSort(): ?int
{
return $this->sort;
}
public function setSort(?int $sort): static
{
$this->sort = $sort;
return $this;
}
/**
* @return Collection<int, Posts>
*/
public function getPosts(): Collection
{
return $this->posts;
}
public function addPost(Posts $post): static
{
if (!$this->posts->contains($post)) {
$this->posts->add($post);
$post->setMainMedia($this);
}
return $this;
}
public function removePost(Posts $post): static
{
if ($this->posts->removeElement($post)) {
// set the owning side to null (unless already changed)
if ($post->getMainMedia() === $this) {
$post->setMainMedia(null);
}
}
return $this;
}
/**
* @return Collection<int, Documents>
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Documents $document): static
{
if (!$this->documents->contains($document)) {
$this->documents->add($document);
$document->setMedia($this);
}
return $this;
}
public function removeDocument(Documents $document): static
{
if ($this->documents->removeElement($document)) {
// set the owning side to null (unless already changed)
if ($document->getMedia() === $this) {
$document->setMedia(null);
}
}
return $this;
}
}