| Current Path : /var/www/v3.cesa.co.za/src/ContentBundle/Entity/ |
| Current File : /var/www/v3.cesa.co.za/src/ContentBundle/Entity/Files.php |
<?php
namespace App\ContentBundle\Entity;
use App\ContactBundle\Entity\MessageAttachment;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* Files
*
* @ORM\Table(name="files", indexes={
* @ORM\Index(name="deleted_idx", columns={"deleted"}),
* @ORM\Index(name="approved_idx", columns={"approved"}),
* @ORM\Index(name="is_public_idx", columns={"is_public"}),
* @ORM\Index(name="is_live_idx", columns={"is_live"}),
* @ORM\Index(name="is_adult_idx", columns={"is_adult"}),
* @ORM\Index(name="rental_product_id_idx", columns={"rental_product_id"})
* })
* @ORM\Entity(repositoryClass="App\ContentBundle\Repository\FilesRepository")
* @ORM\HasLifecycleCallbacks
*/
class Files
{
/**
* @ORM\Id
* @ORM\Column(type="string", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
*/
private $id;
/**
* @ORM\Column(type="text")
*/
private $original_file_name;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $is_cached;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $approved;
/**
* @ORM\Column(type="string", length=50, options={"default": 0})
*/
private $border;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $deleted;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $is_public;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $is_live;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $is_adult;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $rental_product_id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $created_by;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $updated_at;
/**
* @ORM\OneToMany(targetEntity="App\ContactBundle\Entity\MessageAttachment", mappedBy="files", cascade={"persist", "remove"})
*/
private $message_attachment;
public function __construct()
{
$this->message_attachment = new ArrayCollection();
}
public function getId(): ?string
{
return $this->id;
}
public function getOriginalFileName(): ?string
{
return $this->original_file_name;
}
public function setOriginalFileName(string $original_file_name): static
{
$this->original_file_name = $original_file_name;
return $this;
}
public function isIsCached(): ?bool
{
return $this->is_cached;
}
public function setIsCached(bool $is_cached): static
{
$this->is_cached = $is_cached;
return $this;
}
public function isApproved(): ?bool
{
return $this->approved;
}
public function setApproved(bool $approved): static
{
$this->approved = $approved;
return $this;
}
public function getBorder(): ?string
{
return $this->border;
}
public function setBorder(string $border): static
{
$this->border = $border;
return $this;
}
public function isDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(bool $deleted): static
{
$this->deleted = $deleted;
return $this;
}
public function isIsPublic(): ?bool
{
return $this->is_public;
}
public function setIsPublic(bool $is_public): static
{
$this->is_public = $is_public;
return $this;
}
public function isIsLive(): ?bool
{
return $this->is_live;
}
public function setIsLive(bool $is_live): static
{
$this->is_live = $is_live;
return $this;
}
public function isIsAdult(): ?bool
{
return $this->is_adult;
}
public function setIsAdult(bool $is_adult): static
{
$this->is_adult = $is_adult;
return $this;
}
public function getRentalProductId(): ?string
{
return $this->rental_product_id;
}
public function setRentalProductId(?string $rental_product_id): static
{
$this->rental_product_id = $rental_product_id;
return $this;
}
public function getCreatedBy(): ?string
{
return $this->created_by;
}
public function setCreatedBy(?string $created_by): static
{
$this->created_by = $created_by;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): static
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeInterface $updated_at): static
{
$this->updated_at = $updated_at;
return $this;
}
/**
* @return Collection<int, MessageAttachment>
*/
public function getMessageAttachment(): Collection
{
return $this->message_attachment;
}
public function addMessageAttachment(MessageAttachment $messageAttachment): static
{
if (!$this->message_attachment->contains($messageAttachment)) {
$this->message_attachment->add($messageAttachment);
$messageAttachment->setFiles($this);
}
return $this;
}
public function removeMessageAttachment(MessageAttachment $messageAttachment): static
{
if ($this->message_attachment->removeElement($messageAttachment)) {
// set the owning side to null (unless already changed)
if ($messageAttachment->getFiles() === $this) {
$messageAttachment->setFiles(null);
}
}
return $this;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAtValue()
{
$this->setCreatedAt(new \DateTime());
}
/**
* @ORM\PrePersist
*/
public function setUpdatedAtValue()
{
$this->setUpdatedAt(new \DateTime());
}
public function isCached(): ?bool
{
return $this->is_cached;
}
public function isPublic(): ?bool
{
return $this->is_public;
}
public function isLive(): ?bool
{
return $this->is_live;
}
public function isAdult(): ?bool
{
return $this->is_adult;
}
}