<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
/**
* WorldFeed
*
* @ORM\Table(name="worldfeed")
* @ORM\Entity(repositoryClass="App\Repository\WorldfeedRepository")
*/
class WorldFeed implements EntityInterface
{
use \Gedmo\Timestampable\Traits\TimestampableEntity;
use BlameableEntity;
use SoftDeleteableEntity;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
public $id;
/**
* From NEOS not editable
*
* @var string
* @ORM\Column(name="title",type="text", nullable=false)
*/
public $title;
/**
* From NEOS not editable
*
* @var string
* @ORM\Column(name="transmission_id", type="string", length=255)
*/
public $transmissionId;
/**
* From NEOS not editable
*
* @var string
* @ORM\Column(name="transmission_no", type="string", length=255)
*/
public $transmissionNo;
/**
* From NEOS not editable
*
* @var string
* @ORM\Column(name="origin_organization_code_ops", type="string", length=255, nullable=true)
*/
public $originOrganizationCodeOps;
/**
* From NEOS not editable
*
* @var string
* @ORM\Column(name="origin_organization_name", type="string", length=255, nullable=true)
*/
public $originOrganizationName;
/**
* From NEOS not editable
*
* @var string
* @ORM\Column(name="origin_city_code", type="string", length=255, nullable=true)
*/
public $originCityCode;
/**
* From NEOS not editable
*
* @var string
* @ORM\Column(name="origin_city_name", type="string", length=255, nullable=true)
*/
public $originCityName;
/**
* From NEOS not editable
*
* @var string
* @ORM\Column(name="origin_country_code", type="string", length=255, nullable=true)
*/
public $originCountryCode;
/**
* From NEOS not editable
*
* @var string
* @ORM\Column(name="origin_country_name", type="string", length=255, nullable=true)
*/
public $originCountryName;
/**
* From NEOS not editable
*
* @var string
* @ORM\Column(name="feedpoint_code", type="string", length=255, nullable=true)
*/
public $feedpointCode;
/**
* FROM NEOS
* @ORM\Column(name="start_date", type="datetime")
*/
public $startDate;
/**
* FROM NEOS
* @ORM\Column(name="end_date", type="datetime")
*/
public $endDate;
/**
* Generated from the title
* @Gedmo\Slug(fields={"title"})
* @ORM\Column(length=128, unique=true)
*/
public $slug;
/**
* Reflect the status in NEOS
* If a worldfeed is not found in NEOS ( deleted), the status will be EntityInterface::STATUS_DISABLED_IN_NEOS
* To avoid deleting by error some data...
*
* @var string
* @ORM\Column(name="status", type="string", length=20, nullable=true)
*/
public $status;
/**
* Edited in ENET
*
* @var string
* @ORM\Column(name="source", type="string", length=255, nullable=true)
*/
public $source;
/**
* Edited in ENET
* @ORM\Column(name="date_shot", type="date", nullable=true)
*/
public $dateShot;
/**
* Edited in ENET: the code of the city
*
* @var string
* @ORM\Column(name="location", type="text", nullable=true)
*/
public $location;
/**
* @var string
* @ORM\Column(name="short_description", type="text", nullable=true)
*/
public $shortDescription;
/**
* @var string
* @ORM\Column(name="restrictions", type="text", nullable=true)
*/
public $restrictions;
/**
* @var string
* @ORM\Column(name="technical_availability", type="text", nullable=true)
*/
public $technicalAvailability;
/**
* @var string
* @ORM\Column(name="dopesheet", type="text", nullable=true)
*/
public $dopesheet;
/**
* @var string
* @ORM\Column(name="shotlist", type="text", nullable=true)
*/
public $shotlist;
/**
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
*/
public $image;
/**
* @var Event
* @ORM\ManyToOne(targetEntity="App\Entity\Event", inversedBy="worldFeeds", cascade={"persist"})
* @ORM\JoinColumn(name="event_id", referencedColumnName="id")
*/
public $event;
/**
* EDITABLE IN ENET
*
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="App\Entity\QuickLink", mappedBy="worldFeed", cascade={"persist"})
*/
public $links;
/**
* @ORM\OneToMany(targetEntity="App\Entity\WorldFeedStats", mappedBy="worldfeed", cascade={"persist", "remove"})
*/
private $worldfeedStats;
/**
* Node constructor.
*/
public function __construct()
{
$this->links = new ArrayCollection();
$this->worldfeedStats = new ArrayCollection();
}
public function toString(): string
{
return (string)$this->title;
}
public function __toString()
{
return (string)$this->title;
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
public function addLink(QuickLink $quickLink)
{
$quickLink->setWorldFeed($this);
$this->links[] = $quickLink;
}
/**
* Remove quickLink
*
* @param QuickLink $quickLink
*/
public function removeLink(QuickLink $quickLink)
{
$this->links->removeElement($quickLink);
}
public function getWorldfeedStats()
{
return $this->worldfeedStats;
}
public function addWorldfeedStat(WorldFeedStats $worldfeedStat)
{
if (!$this->worldfeedStats->contains($worldfeedStat)) {
$this->worldfeedStats[] = $worldfeedStat;
$worldfeedStat->setWorldfeed($this);
}
return $this;
}
public function removeWorldfeedStat(WorldFeedStats $worldfeedStat)
{
if ($this->worldfeedStats->removeElement($worldfeedStat)) {
if ($worldfeedStat->getWorldfeed() === $this) {
$worldfeedStat->setWorldfeed(null);
}
}
return $this;
}
}