src/Entity/Ged/Fichier.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Ged;
  3. use App\Entity\Articles\Article;
  4. use App\Entity\Clients\Client;
  5. use App\Entity\FO\Societe;
  6. use App\Entity\Fournisseurs\Fournisseur;
  7. use App\Entity\GestionComerciale\Commande;
  8. use App\Entity\GestionComerciale\FabricationMultiple;
  9. use App\Entity\Kanban\Fiche;
  10. use App\Entity\Utilisateur\Utilisateur;
  11. use DateTime;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Gedmo\Mapping\Annotation as Gedmo;
  14. use Symfony\Component\Validator\Constraints as Assert;
  15. use App\Annotations\SecuredEntity;
  16. /**
  17.  * Fichier
  18.  *
  19.  * @ORM\Table("ged__fichier")
  20.  * @ORM\Entity(repositoryClass="App\Repository\Ged\FichierRepository")
  21.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  22.  * @SecuredEntity(name="Fichier", group="OUTILS")
  23.  */
  24. class Fichier
  25. {
  26.     /**
  27.      * @ORM\Column(name="id", type="integer")
  28.      * @ORM\Id
  29.      * @ORM\GeneratedValue(strategy="AUTO")
  30.      */
  31.     private $id;
  32.     /**
  33.      * @ORM\Column(name="id_import", type="string",length=255, nullable=true)
  34.      */
  35.     private $idImport;
  36.     /**
  37.      * @ORM\Column(name="jeton", type="string", length=255, nullable=true)
  38.      */
  39.     private $jeton;
  40.     /**
  41.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Article")
  42.      * @ORM\JoinColumn(nullable=true)
  43.      */
  44.     private $article;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Commande")
  47.      * @ORM\JoinColumn(nullable=true)
  48.      */
  49.     private $commande;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\FabricationMultiple")
  52.      * @ORM\JoinColumn(nullable=true)
  53.      */
  54.     private $fabricationMultiple;
  55.     /**
  56.      * @ORM\ManyToOne(targetEntity="App\Entity\Clients\Client")
  57.      * @ORM\JoinColumn(nullable=true)
  58.      */
  59.     private $client;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity="App\Entity\Fournisseurs\Fournisseur")
  62.      * @ORM\JoinColumn(nullable=true)
  63.      */
  64.     private $fournisseur;
  65.     /**
  66.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur")
  67.      * @ORM\JoinColumn(nullable=true)
  68.      */
  69.     private $utilisateur;
  70.     /**
  71.      * @ORM\Column(name="date", type="datetime", nullable=true)
  72.      */
  73.     private $date;
  74.     /**
  75.      * @ORM\ManyToOne(targetEntity="App\Entity\Ged\Fichier")
  76.      * @ORM\JoinColumn(nullable=true)
  77.      */
  78.     private $parent;
  79.     /**
  80.      * @ORM\ManyToOne(targetEntity="App\Entity\Ged\Fichier")
  81.      * @ORM\JoinColumn(nullable=true)
  82.      */
  83.     private $fichierParent;
  84.     /**
  85.      * @ORM\ManyToOne(targetEntity="App\Entity\FO\Societe")
  86.      * @ORM\JoinColumn(nullable=true)
  87.      */
  88.     private $societe;
  89.     /**
  90.      * @ORM\Column(name="visible", type="boolean", nullable=true)
  91.      */
  92.     private $visible;
  93.     /**
  94.      * @ORM\Column(name="bat", type="boolean", nullable=true)
  95.      */
  96.     private $bat;
  97.     /**
  98.      * @ORM\Column(name="renomme", type="boolean", nullable=true)
  99.      */
  100.     private $renomme;
  101.     /**
  102.      * @ORM\Column(name="modifiable", type="boolean", nullable=true)
  103.      */
  104.     private $modifiable;
  105.     /**
  106.      * @ORM\Column(name="supprimable", type="boolean", nullable=true)
  107.      */
  108.     private $supprimable;
  109.     /**
  110.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  111.      */
  112.     private $libelle;
  113.     /**
  114.      * @ORM\Column(name="mime_type", type="string", length=255, nullable=true)
  115.      */
  116.     private $mimeType;
  117.     /**
  118.      * @ORM\Column(name="type", type="string", length=255, nullable=true)
  119.      */
  120.     private $type;
  121.     /**
  122.      * @ORM\Column(name="description", type="text", nullable=true)
  123.      */
  124.     private $description;
  125.     /**
  126.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  127.      * @Gedmo\Timestampable(on="update")
  128.      */
  129.     private $dateMaj;
  130.     /**
  131.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  132.      */
  133.     private $dateSuppression;
  134.     /**
  135.      * @ORM\Column(name="chemin", type="string", length=255, nullable=true)
  136.      */
  137.     private $chemin;
  138.     /**
  139.      * @ORM\Column(name="extension", type="string", length=255, nullable=true)
  140.      */
  141.     private $extension;
  142.     /**
  143.      * @ORM\Column(name="version", type="integer", nullable=true)
  144.      */
  145.     private $version;
  146.     /**
  147.      * @ORM\Column(name="telechargement", type="integer", nullable=true, options={"default" : 0})
  148.      */
  149.     private $telechargement;
  150.     /**
  151.      * @ORM\ManyToOne(targetEntity="App\Entity\Kanban\Fiche")
  152.      * @ORM\JoinColumn(nullable=true)
  153.      */
  154.     private $affaire;
  155.     /**
  156.      * @ORM\Column(type="string", length=255, nullable=true)
  157.      */
  158.     private $libelle2
  159.     public function __construct()
  160.                                            {
  161.                                                $this->date        = new Datetime();
  162.                                                $this->renomme     false;
  163.                                                $this->telechargement     0;
  164.                                                $this->modifiable   true;
  165.                                                $this->supprimable true;
  166.                                                $this->visible     true;
  167.                                                $this->jeton       $this->generateRandomString();
  168.                                            }
  169.     public function __toString()
  170.                                            {
  171.                                                return $this->libelle;
  172.                                            }
  173.     public function getId(): int
  174.     {
  175.         return $this->id;
  176.     }
  177.     public function setDate(?DateTime $date): Fichier
  178.     {
  179.         $this->date $date;
  180.         return $this;
  181.     }
  182.     public function getDate(): ?DateTime
  183.     {
  184.         return $this->date;
  185.     }
  186.     public function setLibelle(?string $libelle): Fichier
  187.     {
  188.         $this->libelle $libelle;
  189.         return $this;
  190.     }
  191.     public function getLibelle(): ?string
  192.     {
  193.         return $this->libelle;
  194.     }
  195.     public function setDescription(?string $description): Fichier
  196.     {
  197.         $this->description $description;
  198.         return $this;
  199.     }
  200.     public function getDescription(): ?string
  201.     {
  202.         return $this->description;
  203.     }
  204.     public function setDateMaj(?DateTime $dateMaj): Fichier
  205.     {
  206.         $this->dateMaj $dateMaj;
  207.         return $this;
  208.     }
  209.     public function getDateMaj(): ?DateTime
  210.     {
  211.         return $this->dateMaj;
  212.     }
  213.     public function setDateSuppression(?DateTime $dateSuppression): Fichier
  214.     {
  215.         $this->dateSuppression $dateSuppression;
  216.         return $this;
  217.     }
  218.     public function getDateSuppression(): ?DateTime
  219.     {
  220.         return $this->dateSuppression;
  221.     }
  222.     public function setChemin(?string $chemin): Fichier
  223.     {
  224.         $this->chemin $chemin;
  225.         return $this;
  226.     }
  227.     public function getChemin(): ?string
  228.     {
  229.         return $this->chemin;
  230.     }
  231.     public function setExtension(?string $extension): Fichier
  232.     {
  233.         $this->extension $extension;
  234.         return $this;
  235.     }
  236.     public function getExtension(): ?string
  237.     {
  238.         return $this->extension;
  239.     }
  240.     public function setVersion(?int $version): Fichier
  241.     {
  242.         $this->version $version;
  243.         return $this;
  244.     }
  245.     public function getVersion(): ?int
  246.     {
  247.         return $this->version;
  248.     }
  249.     public function setType(?string $type): Fichier
  250.     {
  251.         $this->type $type;
  252.         return $this;
  253.     }
  254.     public function getType(): ?string
  255.     {
  256.         return $this->type;
  257.     }
  258.     public function setParent(?Fichier $parent): Fichier
  259.     {
  260.         $this->parent $parent;
  261.         return $this;
  262.     }
  263.     public function getParent(): ?Fichier
  264.     {
  265.         return $this->parent;
  266.     }
  267.     public function setSociete(?Societe $societe): Fichier
  268.     {
  269.         $this->societe $societe;
  270.         return $this;
  271.     }
  272.     public function getSociete(): ?Societe
  273.     {
  274.         return $this->societe;
  275.     }
  276.     public function setUtilisateur(?Utilisateur $utilisateur): Fichier
  277.     {
  278.         $this->utilisateur $utilisateur;
  279.         return $this;
  280.     }
  281.     public function getUtilisateur(): ?Utilisateur
  282.     {
  283.         return $this->utilisateur;
  284.     }
  285.     public function setRenomme(?bool $renomme): Fichier
  286.     {
  287.         $this->renomme $renomme;
  288.         return $this;
  289.     }
  290.     public function getRenomme(): ?bool
  291.     {
  292.         return $this->renomme;
  293.     }
  294.     public function setFichierParent(?Fichier $fichierParent): Fichier
  295.     {
  296.         $this->fichierParent $fichierParent;
  297.         return $this;
  298.     }
  299.     public function getFichierParent(): ?Fichier
  300.     {
  301.         return $this->fichierParent;
  302.     }
  303.     public function setMimeType(?string $mimeType): Fichier
  304.     {
  305.         $this->mimeType $mimeType;
  306.         return $this;
  307.     }
  308.     public function getMimeType(): ?string
  309.     {
  310.         return $this->mimeType;
  311.     }
  312.     public function setModifiable(?bool $modifiable): Fichier
  313.     {
  314.         $this->modifiable $modifiable;
  315.         return $this;
  316.     }
  317.     public function getModifiable(): ?bool
  318.     {
  319.         return $this->modifiable;
  320.     }
  321.     public function setSupprimable(?bool $supprimable): Fichier
  322.     {
  323.         $this->supprimable $supprimable;
  324.         return $this;
  325.     }
  326.     public function getSupprimable(): ?bool
  327.     {
  328.         return $this->supprimable;
  329.     }
  330.     public function setIdImport(?string $idImport): Fichier
  331.     {
  332.         $this->idImport $idImport;
  333.         return $this;
  334.     }
  335.     public function getIdImport(): ?string
  336.     {
  337.         return $this->idImport;
  338.     }
  339.     public function setArticle(?Article $article): Fichier
  340.     {
  341.         $this->article $article;
  342.         return $this;
  343.     }
  344.     public function getArticle(): ?Article
  345.     {
  346.         return $this->article;
  347.     }
  348.     public function setClient(?Client $client): Fichier
  349.     {
  350.         $this->client $client;
  351.         return $this;
  352.     }
  353.     public function getClient(): ?Client
  354.     {
  355.         return $this->client;
  356.     }
  357.     public function setVisible(?bool $visible): Fichier
  358.     {
  359.         $this->visible $visible;
  360.         return $this;
  361.     }
  362.     public function getVisible(): ?bool
  363.     {
  364.         return $this->visible;
  365.     }
  366.     public function setCommande(?Commande $commande): Fichier
  367.     {
  368.         $this->commande $commande;
  369.         return $this;
  370.     }
  371.     public function getCommande(): ?Commande
  372.     {
  373.         return $this->commande;
  374.     }
  375.     public function setBat(?bool $bat): Fichier
  376.     {
  377.         $this->bat $bat;
  378.         return $this;
  379.     }
  380.     public function getBat(): ?bool
  381.     {
  382.         return $this->bat;
  383.     }
  384.     public function setJeton(?string $jeton): Fichier
  385.     {
  386.         $this->jeton $jeton;
  387.         return $this;
  388.     }
  389.     public function getJeton(): ?string
  390.     {
  391.         return $this->jeton;
  392.     }
  393.     public function generateRandomString($length 30): string
  394.     {
  395.         $characters '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  396.         $charactersLength strlen($characters);
  397.         $randomString '';
  398.         for ($i 0$i $length$i++) {
  399.             $randomString .= $characters[rand(0$charactersLength 1)];
  400.         }
  401.         return $randomString;
  402.     }
  403.     public function setFournisseur(?Fournisseur $fournisseur): Fichier
  404.     {
  405.         $this->fournisseur $fournisseur;
  406.         return $this;
  407.     }
  408.     public function getFournisseur(): ?Fournisseur
  409.     {
  410.         return $this->fournisseur;
  411.     }
  412.     public function setAffaire(?Fiche $affaire): Fichier
  413.     {
  414.         $this->affaire $affaire;
  415.         return $this;
  416.     }
  417.     public function getAffaire(): ?Fiche
  418.     {
  419.         return $this->affaire;
  420.     }
  421.     public function isVisible(): ?bool
  422.     {
  423.         return $this->visible;
  424.     }
  425.     public function isBat(): ?bool
  426.     {
  427.         return $this->bat;
  428.     }
  429.     public function isRenomme(): ?bool
  430.     {
  431.         return $this->renomme;
  432.     }
  433.     public function isModifiable(): ?bool
  434.     {
  435.         return $this->modifiable;
  436.     }
  437.     public function isSupprimable(): ?bool
  438.     {
  439.         return $this->supprimable;
  440.     }
  441.     public function getTelechargement(): ?int
  442.     {
  443.         return $this->telechargement;
  444.     }
  445.     public function setTelechargement(?int $telechargement): self
  446.     {
  447.         $this->telechargement $telechargement;
  448.         return $this;
  449.     }
  450.     public function getFabricationMultiple(): ?FabricationMultiple
  451.     {
  452.         return $this->fabricationMultiple;
  453.     }
  454.     public function setFabricationMultiple(?FabricationMultiple $fabricationMultiple): self
  455.     {
  456.         $this->fabricationMultiple $fabricationMultiple;
  457.         return $this;
  458.     }
  459.     public function getLibelle2(): ?string
  460.     {
  461.         return $this->libelle2;
  462.     }
  463.     public function setLibelle2(?string $libelle2): self
  464.     {
  465.         $this->libelle2 $libelle2;
  466.         return $this;
  467.     }
  468. }