Advertisement
Guest User

File Entity

a guest
Jul 26th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.69 KB | None | 0 0
  1. <?php
  2.  
  3. namespace AppBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7.  
  8. /**
  9.  * User
  10.  *
  11.  * @ORM\Table(name="sm_file")
  12.  * @ORM\Entity(repositoryClass="AppBundle\Entity\FileRepository")
  13.  */
  14. class File
  15. {
  16.     /**
  17.      * @ORM\Column(type="integer")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      *
  21.      */
  22.     protected $id;
  23.  
  24.     /**
  25.      * @var string
  26.      * @ORM\Column(name="name", type="string")
  27.      *
  28.      */
  29.     protected $name;
  30.  
  31.     /**
  32.      * @var \DateTime
  33.      *
  34.      * @ORM\Column(name="date_created", type="datetime")
  35.      */
  36.     protected $dateCreated;
  37.  
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="FileUser", mappedBy="file", cascade={"persist","remove"})
  40.      **/
  41.     private $users;
  42.  
  43.     /**
  44.      * @ORM\OneToMany(targetEntity="FileAgencyStatus", mappedBy="file", cascade={"persist","remove"})
  45.      **/
  46.     private $statuses;
  47.  
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity="Folder")
  50.      * @ORM\JoinColumn(name="folder_id", referencedColumnName="id",  onDelete="CASCADE")
  51.      **/
  52.     private $folder;
  53.  
  54.     /**
  55.      * @var string
  56.      * @ORM\Column(name="path", type="string", nullable=true)
  57.      *
  58.      */
  59.     protected $path;
  60.  
  61.     /**
  62.      * @var string
  63.      * @ORM\Column(name="aws_key", type="string", nullable=true)
  64.      *
  65.      */
  66.     protected $awsKey;
  67.  
  68.     /**
  69.      * @ORM\ManyToOne(targetEntity="User")
  70.      * @ORM\JoinColumn(name="owner_id", referencedColumnName="id",  onDelete="CASCADE")
  71.      **/
  72.     private $owner;
  73.  
  74.     /**
  75.      * @ORM\ManyToOne(targetEntity="Company")
  76.      * @ORM\JoinColumn(name="company_id", referencedColumnName="id", nullable=true, unique=false)
  77.      */
  78.     private $company;
  79.  
  80.     /**
  81.      * @var \DateTime
  82.      *
  83.      * @ORM\Column(name="internal_date_created", type="datetime", nullable=true)
  84.      */
  85.     protected $internalDateCreated;
  86.  
  87.     /**
  88.      * @ORM\ManyToOne(targetEntity="Metadata", cascade={"persist"})
  89.      * @ORM\JoinColumn(name="meta_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
  90.      **/
  91.     private $metadata;
  92.  
  93.     /**
  94.      * Used for updating file metadata with cron
  95.      * @var boolean
  96.      * @ORM\Column(name="meta_updated", type="boolean", nullable=true)
  97.      */
  98.     protected $metadataUpdated;
  99.     /**
  100.      * @var boolean
  101.      * @ORM\Column(name="video", type="boolean", nullable=true)
  102.      */
  103.     protected $video;
  104.     /**
  105.      * @ORM\Column(name="order_number", type="integer", nullable=true)
  106.      *
  107.      */
  108.     protected $orderNumber;
  109.  
  110.  
  111.     private $source;
  112.  
  113.     /**
  114.      * TMP FileMetaUpdate entity
  115.      */
  116.     private $metaUpdate;
  117.  
  118.     /**
  119.      * @ORM\ManyToMany(targetEntity="Keywords", mappedBy="file", indexBy="id", cascade={"persist"})
  120.      * @ORM\OrderBy({"name" = "ASC"})*
  121.      **/
  122.     private $keywords;
  123.  
  124.  
  125.     public function __construct()
  126.     {
  127.         $this->users = new ArrayCollection();
  128.         $this->statuses = new ArrayCollection();
  129.     }
  130.  
  131.     /**
  132.      * @return mixed
  133.      */
  134.     public function getId()
  135.     {
  136.         return $this->id;
  137.     }
  138.  
  139.     /**
  140.      * @param mixed $id
  141.      */
  142.     public function setId($id)
  143.     {
  144.         $this->id = $id;
  145.     }
  146.  
  147.     /**
  148.      * @return string
  149.      */
  150.     public function getName()
  151.     {
  152.         return $this->name;
  153.     }
  154.  
  155.     /**
  156.      * @param string $name
  157.      */
  158.     public function setName($name)
  159.     {
  160.         $this->name = $name;
  161.     }
  162.  
  163.     /**
  164.      * @return \DateTime
  165.      */
  166.     public function getDateCreated()
  167.     {
  168.         return $this->dateCreated;
  169.     }
  170.  
  171.     /**
  172.      * @param \DateTime $dateCreated
  173.      */
  174.     public function setDateCreated($dateCreated)
  175.     {
  176.         $this->dateCreated = $dateCreated;
  177.     }
  178.  
  179.     /**
  180.      * @return mixed
  181.      */
  182.     public function getUsers()
  183.     {
  184.         return $this->users;
  185.     }
  186.  
  187.     /**
  188.      * @param mixed $users
  189.      */
  190.     public function setUsers($users)
  191.     {
  192.         $this->users = $users;
  193.     }
  194.  
  195.     /**
  196.      * @return mixed
  197.      */
  198.     public function getFolder()
  199.     {
  200.         return $this->folder;
  201.     }
  202.  
  203.     /**
  204.      * @param mixed $folder
  205.      */
  206.     public function setFolder($folder)
  207.     {
  208.         $this->folder = $folder;
  209.     }
  210.  
  211.     /**
  212.      * @return string
  213.      */
  214.     public function getPath()
  215.     {
  216.         return $this->path;
  217.     }
  218.  
  219.     /**
  220.      * @param string $path
  221.      */
  222.     public function setPath($path)
  223.     {
  224.         $this->path = $path;
  225.     }
  226.  
  227.     /**
  228.      * @return string
  229.      */
  230.     public function getAwsKey()
  231.     {
  232.         return $this->awsKey;
  233.     }
  234.  
  235.     /**
  236.      * @param string $awsKey
  237.      */
  238.     public function setAwsKey($awsKey)
  239.     {
  240.         $this->awsKey = $awsKey;
  241.     }
  242.  
  243.     /**
  244.      * Add user
  245.      */
  246.     public function addUser($user)
  247.     {
  248.         $this->users[] = $user;
  249.  
  250.         return $this;
  251.     }
  252.  
  253.     /**
  254.      * Remove users
  255.      */
  256.     public function removeUser($user)
  257.     {
  258.         $this->users->removeElement($user);
  259.     }
  260.  
  261.     /**
  262.      * @return mixed
  263.      */
  264.     public function getOwner()
  265.     {
  266.         return $this->owner;
  267.     }
  268.  
  269.     /**
  270.      * @param mixed $owner
  271.      */
  272.     public function setOwner($owner)
  273.     {
  274.         $this->owner = $owner;
  275.     }
  276.  
  277.     /**
  278.      * @return \DateTime
  279.      */
  280.     public function getInternalDateCreated()
  281.     {
  282.         return $this->internalDateCreated;
  283.     }
  284.  
  285.     /**
  286.      * @param \DateTime $internalDateCreated
  287.      */
  288.     public function setInternalDateCreated($internalDateCreated)
  289.     {
  290.         $this->internalDateCreated = $internalDateCreated;
  291.     }
  292.  
  293.     /**
  294.      * @return mixed
  295.      */
  296.     public function getCompany()
  297.     {
  298.         return $this->company;
  299.     }
  300.  
  301.     /**
  302.      * @param mixed $company
  303.      */
  304.     public function setCompany($company)
  305.     {
  306.         $this->company = $company;
  307.     }
  308.  
  309.     /**
  310.      * @return mixed
  311.      */
  312.     public function getStatuses()
  313.     {
  314.         return $this->statuses;
  315.     }
  316.  
  317.     /**
  318.      * @param mixed $statuses
  319.      */
  320.     public function setStatuses($statuses)
  321.     {
  322.         $this->statuses = $statuses;
  323.     }
  324.  
  325.     /**
  326.      * Add status
  327.      */
  328.     public function addStatus($status)
  329.     {
  330.         $this->statuses[] = $status;
  331.  
  332.         return $this;
  333.     }
  334.  
  335.     /**
  336.      * Remove status
  337.      */
  338.     public function removeStatus($status)
  339.     {
  340.         $this->statuses->removeElement($status);
  341.     }
  342.  
  343.     /**
  344.      * @return mixed
  345.      */
  346.     public function getMetadata()
  347.     {
  348.         return $this->metadata;
  349.     }
  350.  
  351.     /**
  352.      * @param mixed $metadata
  353.      */
  354.     public function setMetadata($metadata)
  355.     {
  356.         $this->metadata = $metadata;
  357.     }
  358.  
  359.     /**
  360.      * @return boolean
  361.      */
  362.     public function isMetadataUpdated()
  363.     {
  364.         return $this->metadataUpdated;
  365.     }
  366.  
  367.     /**
  368.      * @param boolean $metadataUpdated
  369.      */
  370.     public function setMetadataUpdated($metadataUpdated)
  371.     {
  372.         $this->metadataUpdated = $metadataUpdated;
  373.     }
  374.  
  375.     /**
  376.      * @return mixed
  377.      */
  378.     public function getSource()
  379.     {
  380.         return $this->source;
  381.     }
  382.  
  383.     /**
  384.      * @param mixed $source
  385.      */
  386.     public function setSource($source)
  387.     {
  388.         $this->source = $source;
  389.     }
  390.  
  391.     /**
  392.      * @param mixed $orderNumber
  393.      */
  394.     public function setOrderNumber($orderNumber)
  395.     {
  396.         $this->orderNumber = $orderNumber;
  397.     }
  398.  
  399.     /**
  400.      * @return mixed
  401.      */
  402.     public function getOrderNumber()
  403.     {
  404.         return $this->orderNumber;
  405.     }
  406.  
  407.     /**
  408.      * @return mixed
  409.      */
  410.     public function getMetaUpdate()
  411.     {
  412.         return $this->metaUpdate;
  413.     }
  414.  
  415.     /**
  416.      * @param mixed $metaUpdate
  417.      */
  418.     public function setMetaUpdate($metaUpdate)
  419.     {
  420.         $this->metaUpdate = $metaUpdate;
  421.     }
  422.  
  423.     /**
  424.      * @return bool
  425.      */
  426.     public function isVideo()
  427.     {
  428.         return $this->video;
  429.     }
  430.  
  431.     /**
  432.      * @param bool $video
  433.      */
  434.     public function setVideo($video)
  435.     {
  436.         $this->video = $video;
  437.     }
  438.  
  439.     /**
  440.      * @return mixed
  441.      */
  442.     public function getKeywords()
  443.     {
  444.         return $this->keywords;
  445.     }
  446.  
  447.     /**
  448.      * @param mixed $keywords
  449.      */
  450.     public function setKeywords($keywords)
  451.     {
  452.         $this->keywords = $keywords;
  453.     }
  454.  
  455.     public function addKeyword(Keywords $keyword){
  456.         if (!$this->keywords->contains($keyword)) {
  457.             $this->keywords[] = $keyword;
  458.         }
  459.     }
  460.     /**
  461.      * Remove keyword
  462.      */
  463.     public function removeKeyword($keyword)
  464.     {
  465.         if ($this->keywords->contains($keyword)) {
  466.             $this->keywords->removeElement($keyword);
  467.         }
  468.  
  469.     }
  470.  
  471.  
  472.  
  473. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement