Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
405 lines
7.9 KiB
PHP
405 lines
7.9 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* Child.
|
|
*
|
|
* @ORM\Table(name="child")
|
|
* @ORM\Entity(repositoryClass="App\Repository\ChildRepository")
|
|
* @ORM\HasLifecycleCallbacks
|
|
*/
|
|
class Child
|
|
{
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\Column(type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @ORM\Column(type="integer")
|
|
*/
|
|
private $roworder;
|
|
|
|
/**
|
|
* @ORM\Column(type="string")
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", nullable=true)
|
|
*/
|
|
private $subname;
|
|
|
|
/**
|
|
* @ORM\Column(type="text", nullable=true)
|
|
*/
|
|
private $description;
|
|
|
|
/**
|
|
* @ORM\Column(type="datetime", nullable=false)
|
|
*/
|
|
private $submitdate;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", nullable=true)
|
|
*/
|
|
private $filename;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", nullable=true)
|
|
*/
|
|
private $fileextention;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", nullable=true)
|
|
*/
|
|
private $fileminetype;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", nullable=true)
|
|
*/
|
|
private $url;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", nullable=true)
|
|
*/
|
|
private $externalcode;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", nullable=true)
|
|
*/
|
|
private $externalid;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", nullable=true)
|
|
*/
|
|
private $externalscript;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Blog", inversedBy="childs")
|
|
*/
|
|
private $blog;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Page", inversedBy="childs")
|
|
*/
|
|
private $page;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Childtype", inversedBy="childs")
|
|
*/
|
|
private $childtype;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Childheader", mappedBy="child", cascade={"persist"}, orphanRemoval=true)
|
|
* @ORM\OrderBy({"roworder" = "ASC"})
|
|
*/
|
|
private $childheaders;
|
|
|
|
/**
|
|
* @ORM\ManyToMany(targetEntity="Tag", inversedBy="childs", cascade={"persist"})
|
|
* @ORM\JoinTable(name="childtag",
|
|
* joinColumns={@ORM\JoinColumn(name="child", referencedColumnName="id")},
|
|
* inverseJoinColumns={@ORM\JoinColumn(name="tag", referencedColumnName="id")}
|
|
* )
|
|
*/
|
|
private $tags;
|
|
|
|
/**
|
|
* @ORM\ManyToMany(targetEntity="Pin", inversedBy="pins", cascade={"persist"})
|
|
* @ORM\JoinTable(name="childpin",
|
|
* joinColumns={@ORM\JoinColumn(name="child", referencedColumnName="id")},
|
|
* inverseJoinColumns={@ORM\JoinColumn(name="pin", referencedColumnName="id")}
|
|
* )
|
|
* @ORM\OrderBy({"name" = "ASC"})
|
|
*/
|
|
private $pins;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->childheaders = new ArrayCollection();
|
|
$this->tags = new ArrayCollection();
|
|
$this->pins = new ArrayCollection();
|
|
}
|
|
|
|
/**
|
|
* @ORM\PrePersist
|
|
*/
|
|
public function onPrePersist()
|
|
{
|
|
$this->submitdate = new \DateTime('now');
|
|
}
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getName(): ?string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
public function setName(string $name): self
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getSubname(): ?string
|
|
{
|
|
return $this->subname;
|
|
}
|
|
|
|
public function setSubname(?string $subname): self
|
|
{
|
|
$this->subname = $subname;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDescription(): ?string
|
|
{
|
|
return $this->description;
|
|
}
|
|
|
|
public function setDescription(?string $description): self
|
|
{
|
|
$this->description = $description;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getSubmitdate(): ?\DateTimeInterface
|
|
{
|
|
return $this->submitdate;
|
|
}
|
|
|
|
public function setSubmitdate(\DateTimeInterface $submitdate): self
|
|
{
|
|
$this->submitdate = $submitdate;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getFilename(): ?string
|
|
{
|
|
return $this->filename;
|
|
}
|
|
|
|
public function setFilename(?string $filename): self
|
|
{
|
|
$this->filename = $filename;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getFileextention(): ?string
|
|
{
|
|
return $this->fileextention;
|
|
}
|
|
|
|
public function setFileextention(?string $fileextention): self
|
|
{
|
|
$this->fileextention = $fileextention;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getFileminetype(): ?string
|
|
{
|
|
return $this->fileminetype;
|
|
}
|
|
|
|
public function setFileminetype(?string $fileminetype): self
|
|
{
|
|
$this->fileminetype = $fileminetype;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getUrl(): ?string
|
|
{
|
|
return $this->url;
|
|
}
|
|
|
|
public function setUrl(?string $url): self
|
|
{
|
|
$this->url = $url;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getExternalcode(): ?string
|
|
{
|
|
return $this->externalcode;
|
|
}
|
|
|
|
public function setExternalcode(?string $externalcode): self
|
|
{
|
|
$this->externalcode = $externalcode;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getExternalid(): ?string
|
|
{
|
|
return $this->externalid;
|
|
}
|
|
|
|
public function setExternalid(?string $externalid): self
|
|
{
|
|
$this->externalid = $externalid;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getExternalscript(): ?string
|
|
{
|
|
return $this->externalscript;
|
|
}
|
|
|
|
public function setExternalscript(?string $externalscript): self
|
|
{
|
|
$this->externalscript = $externalscript;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getBlog(): ?Blog
|
|
{
|
|
return $this->blog;
|
|
}
|
|
|
|
public function setBlog(?Blog $blog): self
|
|
{
|
|
$this->blog = $blog;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getPage(): ?Page
|
|
{
|
|
return $this->page;
|
|
}
|
|
|
|
public function setPage(?Page $page): self
|
|
{
|
|
$this->page = $page;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getChildtype(): ?Childtype
|
|
{
|
|
return $this->childtype;
|
|
}
|
|
|
|
public function setChildtype(?Childtype $childtype): self
|
|
{
|
|
$this->childtype = $childtype;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection<int, Childheader>
|
|
*/
|
|
public function getChildheaders(): Collection
|
|
{
|
|
return $this->childheaders;
|
|
}
|
|
|
|
public function addChildheader(Childheader $childheader): self
|
|
{
|
|
if (!$this->childheaders->contains($childheader)) {
|
|
$this->childheaders->add($childheader);
|
|
$childheader->setChild($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeChildheader(Childheader $childheader): self
|
|
{
|
|
if ($this->childheaders->removeElement($childheader)) {
|
|
// set the owning side to null (unless already changed)
|
|
if ($childheader->getChild() === $this) {
|
|
$childheader->setChild(null);
|
|
}
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection<int, Tag>
|
|
*/
|
|
public function getTags(): Collection
|
|
{
|
|
return $this->tags;
|
|
}
|
|
|
|
public function addTag(Tag $tag): self
|
|
{
|
|
if (!$this->tags->contains($tag)) {
|
|
$this->tags->add($tag);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeTag(Tag $tag): self
|
|
{
|
|
$this->tags->removeElement($tag);
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection<int, Pin>
|
|
*/
|
|
public function getPins(): Collection
|
|
{
|
|
return $this->pins;
|
|
}
|
|
|
|
public function addPin(Pin $pin): self
|
|
{
|
|
if (!$this->pins->contains($pin)) {
|
|
$this->pins->add($pin);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removePin(Pin $pin): self
|
|
{
|
|
$this->pins->removeElement($pin);
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getRoworder(): ?int
|
|
{
|
|
return $this->roworder;
|
|
}
|
|
|
|
public function setRoworder(int $roworder): self
|
|
{
|
|
$this->roworder = $roworder;
|
|
|
|
return $this;
|
|
}
|
|
|
|
}
|