src/Entity/Company.php line 22

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: sbrun
  5.  * Date: 2018-03-16
  6.  * Time: 15:05
  7.  */
  8. namespace App\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\HttpFoundation\File\File;
  11. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  12. use Doctrine\Common\Collections\ArrayCollection;
  13. use Symfony\Component\Serializer\Annotation\MaxDepth;
  14. /**
  15.  * @ORM\Entity
  16.  * @ORM\Table(name="laralivre_company")
  17.  * @ORM\Entity(repositoryClass="App\Repository\CompanyRepository")
  18.  * @Vich\Uploadable
  19.  */
  20. class Company
  21. {
  22.     const ID_REPENTIGNY     1;
  23.     const ID_VERSAILLES     3;
  24.     const ID_ST_HUBERT      4;
  25.     const ID_ENTREPOT       5;
  26.     const ID_COLLECTIVITE   6;
  27.     /**
  28.      * @ORM\Column(type="integer")
  29.      * @ORM\Id
  30.      * @ORM\GeneratedValue(strategy="AUTO")
  31.      */
  32.     protected $id;
  33.     /**
  34.      * @ORM\Column(name="company_name", type="string", length=150)
  35.      */
  36.     protected $name;
  37.     /**
  38.      * @ORM\Column(name="company_address", type="string", length=150)
  39.      */
  40.     protected $address;
  41.     /**
  42.      * @ORM\Column(name="company_country", type="string", length=100)
  43.      */
  44.     protected $country;
  45.     /**
  46.      * @ORM\Column(name="company_telephone", type="string", length=25)
  47.      */
  48.     protected $telephone;
  49.     /**
  50.      * @ORM\Column(name="company_active", type="boolean")
  51.      */
  52.     protected $active;
  53.     /**
  54.      * @ORM\Column(name="company_city", type="string", length=75)
  55.      */
  56.     protected $city;
  57.     /**
  58.      * @ORM\Column(name="company_zipcode", type="string", length=10)
  59.      */
  60.     protected $zipcode;
  61.     /**
  62.      * @ORM\Column(name="company_province", type="string", length=25)
  63.      */
  64.     protected $province;
  65.     /**
  66.      * @ORM\Column(name="company_timezone", type="string", length=25, nullable=true)
  67.      */
  68.     protected $timezone;
  69.     /**
  70.      * @ORM\Column(name="company", type="integer")
  71.      */
  72.     protected $company;
  73.     /**
  74.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  75.      *
  76.      * Pour les contraintes:
  77.      * https://symfony.com/doc/3.4/reference/constraints/Image.html
  78.      *
  79.      * @Vich\UploadableField(mapping="company_logo", fileNameProperty="logo1")
  80.      *
  81.      * @var File
  82.      */
  83.     private $logo1File;
  84.     /**
  85.      * @ORM\Column(name="company_logo1", type="string", length=75, nullable=true)
  86.      */
  87.     protected $logo1;
  88.     /**
  89.      * @ORM\Column(name="company_logo2", type="string", length=75, nullable=true)
  90.      */
  91.     protected $logo2;
  92.     /**
  93.      * @ORM\Column(name="company_maxuser", type="integer")
  94.      */
  95.     protected $maxuser;
  96.     /**
  97.      * @ORM\Column(name="company_session_timeout", type="integer")
  98.      */
  99.     protected $sessionTimeout;
  100.     /**
  101.      * @ORM\Column(name="company_inventaire", type="boolean")
  102.      */
  103.     protected $inventaire;
  104.     /**
  105.      * @ORM\Column(type="datetime")
  106.      *
  107.      * @var \DateTime
  108.      */
  109.     private $updatedAt;
  110.     /**
  111.      * @ORM\OneToMany(targetEntity="SysUsers", mappedBy="company", indexBy="company")
  112.      * @MaxDepth(1)
  113.      */
  114.     protected $sysUsers;
  115.     /**
  116.      * @ORM\Column(name="company_mail", type="string", length=255, nullable=true)
  117.      * @MaxDepth(1)
  118.      */
  119.     protected $mail;
  120.     /**
  121.      * has many Collections
  122.      *
  123.      * @ORM\OneToMany(targetEntity="App\Entity\Collections", mappedBy="company")
  124.      * @MaxDepth(1)
  125.      */
  126.     protected $collections;
  127.     /**
  128.      * has many Collections
  129.      *
  130.      * @ORM\OneToMany(targetEntity="App\Entity\Departements", mappedBy="company")
  131.      */
  132.     protected $departements;
  133.     /**
  134.      * @ORM\OneToMany(targetEntity="App\Entity\Factures", mappedBy="succursale")
  135.      * @MaxDepth(1)
  136.      */
  137.     protected $factures;
  138.     /**
  139.      * One product has many features. This is the inverse side.
  140.      * @ORM\OneToMany(targetEntity="TitreCompany", mappedBy="company")
  141.      */
  142.     private $titresCompany;
  143.     public function __construct()
  144.     {
  145.         $this->collections = new ArrayCollection();
  146.     }
  147.     /**
  148.      * @return mixed
  149.      */
  150.     public function getCollections()
  151.     {
  152.         return $this->collections;
  153.     }
  154.     /**
  155.      * @param ArrayCollection $collections
  156.      */
  157.     public function setCollections(ArrayCollection $collections)
  158.     {
  159.         $this->collections $collections;
  160.     }
  161.     /**
  162.      * @param Collections $collection
  163.      */
  164.     public function addCollection(Collections $collection)
  165.     {
  166.         $this->collections->add($collection);
  167.     }
  168.     /**
  169.      * @return mixed
  170.      */
  171.     public function getId()
  172.     {
  173.         return $this->id;
  174.     }
  175.     /**
  176.      * @param mixed $name
  177.      */
  178.     public function setId($id)
  179.     {
  180.         $this->id $id;
  181.     }
  182.     /**
  183.      * @return mixed
  184.      */
  185.     public function getName()
  186.     {
  187.         return $this->name;
  188.     }
  189.     /**
  190.      * @param mixed $name
  191.      */
  192.     public function setName($name)
  193.     {
  194.         $this->name $name;
  195.     }
  196.     /**
  197.      * @return mixed
  198.      */
  199.     public function getAddress()
  200.     {
  201.         return $this->address;
  202.     }
  203.     /**
  204.      * @param mixed $address
  205.      */
  206.     public function setAddress($address)
  207.     {
  208.         $this->address $address;
  209.     }
  210.     /**
  211.      * @return mixed
  212.      */
  213.     public function getCountry()
  214.     {
  215.         return $this->country;
  216.     }
  217.     /**
  218.      * @param mixed $country
  219.      */
  220.     public function setCountry($country)
  221.     {
  222.         $this->country $country;
  223.     }
  224.     /**
  225.      * @return mixed
  226.      */
  227.     public function getTelephone()
  228.     {
  229.         return $this->telephone;
  230.     }
  231.     /**
  232.      * @param mixed $telephone
  233.      */
  234.     public function setTelephone($telephone)
  235.     {
  236.         $this->telephone $telephone;
  237.     }
  238.     /**
  239.      * @return mixed
  240.      */
  241.     public function getActive()
  242.     {
  243.         return $this->active;
  244.     }
  245.     /**
  246.      * @param mixed $active
  247.      */
  248.     public function setActive($active)
  249.     {
  250.         $this->active $active;
  251.     }
  252.     /**
  253.      * @return mixed
  254.      */
  255.     public function getCity()
  256.     {
  257.         return $this->city;
  258.     }
  259.     /**
  260.      * @param mixed $city
  261.      */
  262.     public function setCity($city)
  263.     {
  264.         $this->city $city;
  265.     }
  266.     /**
  267.      * @return mixed
  268.      */
  269.     public function getZipcode()
  270.     {
  271.         return $this->zipcode;
  272.     }
  273.     /**
  274.      * @param mixed $zipcode
  275.      */
  276.     public function setZipcode($zipcode)
  277.     {
  278.         $this->zipcode $zipcode;
  279.     }
  280.     /**
  281.      * @return mixed
  282.      */
  283.     public function getProvince()
  284.     {
  285.         return $this->province;
  286.     }
  287.     /**
  288.      * @param mixed $province
  289.      */
  290.     public function setProvince($province)
  291.     {
  292.         $this->province $province;
  293.     }
  294.     /**
  295.      * @return mixed
  296.      */
  297.     public function getTimezone()
  298.     {
  299.         return $this->timezone;
  300.     }
  301.     /**
  302.      * @param mixed $timezone
  303.      */
  304.     public function setTimezone($timezone)
  305.     {
  306.         $this->timezone $timezone;
  307.     }
  308.     /**
  309.      * @return mixed
  310.      */
  311.     public function getCompany()
  312.     {
  313.         return $this->company;
  314.     }
  315.     /**
  316.      * @param mixed $company
  317.      */
  318.     public function setCompany($company)
  319.     {
  320.         $this->company $company;
  321.     }
  322.     /**
  323.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  324.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  325.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  326.      * must be able to accept an instance of 'File' as the bundle will inject one here
  327.      * during Doctrine hydration.
  328.      *
  329.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
  330.      * @throws \Exception
  331.      */
  332.     public function setLogo1File(File $image null)
  333.     {
  334.         $this->logo1File $image;
  335.         if (null !== $image) {
  336.             // It is required that at least one field changes if you are using doctrine
  337.             // otherwise the event listeners won't be called and the file is lost
  338.             $this->updatedAt = new \DateTimeImmutable();
  339.         }
  340.     }
  341.     public function getLogo1File()
  342.     {
  343.         return $this->logo1File;
  344.     }
  345.     /**
  346.      * @return mixed
  347.      */
  348.     public function getLogo1()
  349.     {
  350.         return $this->logo1;
  351.     }
  352.     /**
  353.      * @param mixed $logo1
  354.      * @return Company
  355.      */
  356.     public function setLogo1($logo1)
  357.     {
  358.         $this->logo1 $logo1;
  359.         return $this;
  360.     }
  361.     /**
  362.      * @return mixed
  363.      */
  364.     public function getLogo2()
  365.     {
  366.         return $this->logo2;
  367.     }
  368.     /**
  369.      * @param mixed $logo2
  370.      */
  371.     public function setLogo2($logo2)
  372.     {
  373.         $this->logo2 $logo2;
  374.     }
  375.     /**
  376.      * @return mixed
  377.      */
  378.     public function getMaxuser()
  379.     {
  380.         return $this->maxuser;
  381.     }
  382.     /**
  383.      * @param mixed $maxuser
  384.      */
  385.     public function setMaxuser($maxuser)
  386.     {
  387.         $this->maxuser $maxuser;
  388.     }
  389.     /**
  390.      * @return mixed
  391.      */
  392.     public function getSessionTimeout()
  393.     {
  394.         return $this->sessionTimeout;
  395.     }
  396.     /**
  397.      * @param mixed $sessionTimeout
  398.      */
  399.     public function setSessionTimeout($sessionTimeout)
  400.     {
  401.         $this->sessionTimeout $sessionTimeout;
  402.     }
  403.     /**
  404.      * @return \DateTime
  405.      */
  406.     public function getUpdatedAt()
  407.     {
  408.         return $this->updatedAt;
  409.     }
  410.     /**
  411.      * @param \DateTime $updatedAt
  412.      */
  413.     public function setUpdatedAt($updatedAt)
  414.     {
  415.         $this->updatedAt $updatedAt;
  416.     }
  417.     /**
  418.      * @return array
  419.      */
  420.     public function getFactures()
  421.     {
  422.         return $this->factures;
  423.     }
  424.     /**
  425.      * @param array $factures
  426.      */
  427.     public function setFactures($factures)
  428.     {
  429.         $this->factures $factures;
  430.     }
  431.     public function __toString()
  432.     {
  433.         return (string)$this->getId();
  434.     }
  435.     /**
  436.      * @return mixed
  437.      */
  438.     public function getInventaire()
  439.     {
  440.         return $this->inventaire;
  441.     }
  442.     /**
  443.      * @param mixed $inventaire
  444.      */
  445.     public function setInventaire($inventaire)
  446.     {
  447.         $this->inventaire $inventaire;
  448.     }
  449.     /**
  450.      * @return mixed
  451.      */
  452.     public function getMail()
  453.     {
  454.         return $this->mail;
  455.     }
  456.     /**
  457.      * @param mixed $mail
  458.      */
  459.     public function setMail($mail)
  460.     {
  461.         $this->mail $mail;
  462.     }
  463.     /**
  464.      * @return mixed
  465.      */
  466.     public function getTitresCompany()
  467.     {
  468.         return $this->titresCompany;
  469.     }
  470.     /**
  471.      * @param mixed $titresCompany
  472.      */
  473.     public function setTitresCompany($titresCompany): void
  474.     {
  475.         $this->titresCompany $titresCompany;
  476.     }
  477. }