Created
August 25, 2018 18:56
-
-
Save andrconstruction/17b7194871e53e292f7fe48b94f657a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Project\Entity; | |
use Application\Entity\AshAbstractEntity; | |
use Application\Entity\Filter\RemovedFilterInterface; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\Common\Collections\Collection; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Table(name="project_comments") | |
* @ORM\Entity(repositoryClass="Project\Entity\ProjectCommentRepository") | |
*/ | |
class ProjectComment extends AshAbstractEntity implements RemovedFilterInterface | |
{ | |
/** | |
* @var string | |
* @ORM\Column(type="text", length=12000) | |
*/ | |
private $content; | |
/** | |
* One Category has Many Categories. | |
* @ORM\OneToMany(targetEntity="Project\Entity\ProjectComment", mappedBy="parent") | |
*/ | |
private $children; | |
/** | |
* Many Project have One Project. | |
* @ORM\ManyToOne(targetEntity="Project\Entity\ProjectComment", inversedBy="children") | |
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id") | |
*/ | |
private $parent; | |
/** | |
* @ORM\ManyToOne(targetEntity="Project\Entity\Task", inversedBy="comments") | |
*/ | |
private $task; | |
/** | |
* @ORM\ManyToOne(targetEntity="Project\Entity\Project", inversedBy="comments") | |
*/ | |
private $project; | |
/** | |
* @var \Project\Entity\ProjectCommentFile[] | |
* @ORM\OneToMany(targetEntity="Project\Entity\ProjectCommentFile", mappedBy="comment", cascade={"all"}) | |
*/ | |
private $files; | |
function __construct() { | |
parent::__construct(); | |
$this->files = new ArrayCollection(); | |
} | |
/** | |
* @return ProjectCommentFile[] | |
*/ | |
public function getFiles() { | |
return $this->files; | |
} | |
public function addFile( ProjectCommentFile $file ) { | |
if ( !$this->files->contains( $file ) ) { | |
$file->setComment( $this ); | |
$this->files->add( $file ); | |
} | |
} | |
public function addFiles( Collection $files ) { | |
foreach ( $files as $file ) { | |
$this->addFile( $file ); | |
} | |
} | |
public function removeFiles( Collection $files ) { | |
} | |
/** | |
* @return string | |
*/ | |
public function getContent() { | |
return $this->content; | |
} | |
/** | |
* @param string $content | |
*/ | |
public function setContent( $content ) { | |
$this->content = $content; | |
} | |
/** | |
* @return mixed | |
*/ | |
public function getChildren() { | |
return $this->children; | |
} | |
/** | |
* @param mixed $children | |
*/ | |
public function setChildren( $children ) { | |
$this->children = $children; | |
} | |
/** | |
* @return mixed | |
*/ | |
public function getParent() { | |
return $this->parent; | |
} | |
/** | |
* @param mixed $parent | |
*/ | |
public function setParent( $parent ) { | |
$this->parent = $parent; | |
} | |
/** | |
* @return mixed | |
*/ | |
public function getTask() { | |
return $this->task; | |
} | |
/** | |
* @param mixed $task | |
*/ | |
public function setTask( $task ) { | |
$this->task = $task; | |
} | |
/** | |
* @return mixed | |
*/ | |
public function getProject() { | |
return $this->project; | |
} | |
/** | |
* @param mixed $project | |
*/ | |
public function setProject( $project ) { | |
$this->project = $project; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment