src/Entity/Resources.php line 10
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\ResourcesRepository")
*/
class Resources extends OSEntity
{
public function __construct(){
parent::__construct();
$this->isImportant = false;
}
/**
* @ORM\OneToOne(targetEntity="App\Entity\File", cascade={"persist","remove"}, orphanRemoval=true, fetch="EAGER")
* @ORM\JoinColumn(nullable=true)
*/
private $document;
/**
* @ORM\ManyToOne(targetEntity=ResourcesCategories::class, inversedBy="resources", fetch="EAGER")
* @ORM\JoinColumn(nullable=true)
*/
private $category;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isImportant;
public function getDocument(): ?File
{
return $this->document;
}
public function setDocument(?File $document): self
{
if($document->getTarget()){
$this->document = $document;
$this->document->setDir('upload/files/resources');
}
return $this;
}
public function getCover(): ?Picture
{
return $this->getBanner();
}
public function setCover(?Picture $cover): self
{
return $this->setBanner($cover);
}
public function getCategory(): ?ResourcesCategories
{
return $this->category;
}
public function setCategory(?ResourcesCategories $category): self
{
$this->category = $category;
return $this;
}
public function getIsImportant(): ?bool
{
return $this->isImportant;
}
public function setIsImportant(?bool $isImportant): self
{
$this->isImportant = $isImportant;
return $this;
}
}