src/Entity/WorldFeed.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
  7. /**
  8.  * WorldFeed
  9.  *
  10.  * @ORM\Table(name="worldfeed")
  11.  * @ORM\Entity(repositoryClass="App\Repository\WorldfeedRepository")
  12.  */
  13. class WorldFeed implements EntityInterface
  14. {
  15.     use \Gedmo\Timestampable\Traits\TimestampableEntity;
  16.     use BlameableEntity;
  17.     use SoftDeleteableEntity;
  18.     /**
  19.      * @var int
  20.      *
  21.      * @ORM\Column(name="id", type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     public $id;
  26.     /**
  27.      * From NEOS not editable
  28.      *
  29.      * @var string
  30.      * @ORM\Column(name="title",type="text", nullable=false)
  31.      */
  32.     public $title;
  33.     /**
  34.      *  From NEOS not editable
  35.      *
  36.      * @var string
  37.      * @ORM\Column(name="transmission_id", type="string", length=255)
  38.      */
  39.     public $transmissionId;
  40.     /**
  41.      *  From NEOS not editable
  42.      *
  43.      * @var string
  44.      * @ORM\Column(name="transmission_no", type="string", length=255)
  45.      */
  46.     public $transmissionNo;
  47.     /**
  48.      *  From NEOS not editable
  49.      *
  50.      * @var string
  51.      * @ORM\Column(name="origin_organization_code_ops", type="string", length=255, nullable=true)
  52.      */
  53.     public $originOrganizationCodeOps;
  54.     /**
  55.      * From NEOS not editable
  56.      *
  57.      * @var string
  58.      * @ORM\Column(name="origin_organization_name", type="string", length=255, nullable=true)
  59.      */
  60.     public $originOrganizationName;
  61.     /**
  62.      * From NEOS not editable
  63.      *
  64.      * @var string
  65.      * @ORM\Column(name="origin_city_code", type="string", length=255, nullable=true)
  66.      */
  67.     public $originCityCode;
  68.     /**
  69.      * From NEOS not editable
  70.      *
  71.      * @var string
  72.      * @ORM\Column(name="origin_city_name", type="string", length=255, nullable=true)
  73.      */
  74.     public $originCityName;
  75.     /**
  76.      * From NEOS not editable
  77.      *
  78.      * @var string
  79.      * @ORM\Column(name="origin_country_code", type="string", length=255, nullable=true)
  80.      */
  81.     public $originCountryCode;
  82.     /**
  83.      * From NEOS not editable
  84.      *
  85.      * @var string
  86.      * @ORM\Column(name="origin_country_name", type="string", length=255, nullable=true)
  87.      */
  88.     public $originCountryName;
  89.     /**
  90.      * From NEOS not editable
  91.      *
  92.      * @var string
  93.      * @ORM\Column(name="feedpoint_code", type="string", length=255, nullable=true)
  94.      */
  95.     public $feedpointCode;
  96.     /**
  97.      * FROM NEOS
  98.      * @ORM\Column(name="start_date", type="datetime")
  99.      */
  100.     public $startDate;
  101.     /**
  102.      * FROM NEOS
  103.      * @ORM\Column(name="end_date", type="datetime")
  104.      */
  105.     public $endDate;
  106.     /**
  107.      * Generated from the title
  108.      * @Gedmo\Slug(fields={"title"})
  109.      * @ORM\Column(length=128, unique=true)
  110.      */
  111.     public $slug;
  112.     /**
  113.      * Reflect the status in NEOS
  114.      * If a worldfeed is not found in NEOS ( deleted), the status will be EntityInterface::STATUS_DISABLED_IN_NEOS
  115.      * To avoid deleting by error some data...
  116.      *
  117.      * @var string
  118.      * @ORM\Column(name="status", type="string", length=20, nullable=true)
  119.      */
  120.     public $status;
  121.     /**
  122.      * Edited in ENET
  123.      *
  124.      * @var string
  125.      * @ORM\Column(name="source", type="string", length=255, nullable=true)
  126.      */
  127.     public $source;
  128.     /**
  129.      * Edited in ENET
  130.      * @ORM\Column(name="date_shot", type="date", nullable=true)
  131.      */
  132.     public $dateShot;
  133.     /**
  134.      * Edited in ENET: the code of the city
  135.      *
  136.      * @var string
  137.      * @ORM\Column(name="location", type="text", nullable=true)
  138.      */
  139.     public $location;
  140.     /**
  141.      * @var string
  142.      * @ORM\Column(name="short_description", type="text", nullable=true)
  143.      */
  144.     public $shortDescription;
  145.     /**
  146.      * @var string
  147.      * @ORM\Column(name="restrictions", type="text", nullable=true)
  148.      */
  149.     public $restrictions;
  150.     /**
  151.      * @var string
  152.      * @ORM\Column(name="technical_availability", type="text", nullable=true)
  153.      */
  154.     public $technicalAvailability;
  155.     /**
  156.      * @var string
  157.      * @ORM\Column(name="dopesheet", type="text", nullable=true)
  158.      */
  159.     public $dopesheet;
  160.     /**
  161.      * @var string
  162.      * @ORM\Column(name="shotlist", type="text", nullable=true)
  163.      */
  164.     public $shotlist;
  165.     /**
  166.      * @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
  167.      */
  168.     public $image;
  169.     /**
  170.      * @var Event
  171.      * @ORM\ManyToOne(targetEntity="App\Entity\Event", inversedBy="worldFeeds", cascade={"persist"})
  172.      * @ORM\JoinColumn(name="event_id", referencedColumnName="id")
  173.      */
  174.     public $event;
  175.     /**
  176.      * EDITABLE IN ENET
  177.      *
  178.      * @var ArrayCollection
  179.      * @ORM\OneToMany(targetEntity="App\Entity\QuickLink", mappedBy="worldFeed", cascade={"persist"})
  180.      */
  181.     public $links;
  182.     /**
  183.      * @ORM\OneToMany(targetEntity="App\Entity\WorldFeedStats", mappedBy="worldfeed", cascade={"persist", "remove"})
  184.      */
  185.     private $worldfeedStats;
  186.     /**
  187.      * Node constructor.
  188.      */
  189.     public function __construct()
  190.     {
  191.         $this->links = new ArrayCollection();
  192.         $this->worldfeedStats = new ArrayCollection();
  193.     }
  194.     public function toString(): string
  195.     {
  196.         return (string)$this->title;
  197.     }
  198.     public function __toString()
  199.     {
  200.         return (string)$this->title;
  201.     }
  202.     /**
  203.      * @return int
  204.      */
  205.     public function getId()
  206.     {
  207.         return $this->id;
  208.     }
  209.     public function addLink(QuickLink $quickLink)
  210.     {
  211.         $quickLink->setWorldFeed($this);
  212.         $this->links[] = $quickLink;
  213.     }
  214.     /**
  215.      * Remove quickLink
  216.      *
  217.      * @param QuickLink $quickLink
  218.      */
  219.     public function removeLink(QuickLink $quickLink)
  220.     {
  221.         $this->links->removeElement($quickLink);
  222.     }
  223.     public function getWorldfeedStats()
  224.     {
  225.         return $this->worldfeedStats;
  226.     }
  227.     public function addWorldfeedStat(WorldFeedStats $worldfeedStat)
  228.     {
  229.         if (!$this->worldfeedStats->contains($worldfeedStat)) {
  230.             $this->worldfeedStats[] = $worldfeedStat;
  231.             $worldfeedStat->setWorldfeed($this);
  232.         }
  233.         return $this;
  234.     }
  235.     public function removeWorldfeedStat(WorldFeedStats $worldfeedStat)
  236.     {
  237.         if ($this->worldfeedStats->removeElement($worldfeedStat)) {
  238.             if ($worldfeedStat->getWorldfeed() === $this) {
  239.                 $worldfeedStat->setWorldfeed(null);
  240.             }
  241.         }
  242.         return $this;
  243.     }
  244. }