src/Entity/System.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use http\Env\Request;
  5. use Symfony\Component\Security\Core\User\UserInterface;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\SystemRepository")
  8.  */
  9. class System implements UserInterface
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="boolean")
  19.      */
  20.     private $statut;
  21.     /**
  22.      * @ORM\Column(type="datetime")
  23.      */
  24.     private $date;
  25.     /**
  26.      * @ORM\Column(type="string", length=50, nullable=true)
  27.      */
  28.     private $ftpUser;
  29.     /**
  30.      * @ORM\Column(type="string", length=250, nullable=true)
  31.      */
  32.     private $ftpPassword;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $ftpDirectory;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private $databaseFolder;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      */
  44.     private $awaitingFolder;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $organisationLogo;
  49.     /**
  50.      * @ORM\Column(type="string", length=20, nullable=true)
  51.      */
  52.     private $organisationSigle;
  53.     /**
  54.      * @ORM\Column(type="string", length=5, nullable=true)
  55.      */
  56.     private $ftpPort;
  57.     /**
  58.      * @ORM\Column(type="string", length=255, nullable=true)
  59.      */
  60.     private $baseFolder;
  61.     /**
  62.      * @ORM\Column(type="string", length=255, nullable=true)
  63.      */
  64.     private $bordereauFolder;
  65.     /**
  66.      * @ORM\Column(type="string", length=255, nullable=true)
  67.      */
  68.     private $versementFolder;
  69.     /**
  70.      * @ORM\Column(type="string", length=255, nullable=true)
  71.      */
  72.     private $classementFolder;
  73.     /**
  74.      * @ORM\Column(type="string", length=255, nullable=true)
  75.      */
  76.     private $savingFolder;
  77.     /**
  78.      * @ORM\Column(type="string", length=50, nullable=true)
  79.      */
  80.     private $country;
  81.     /**
  82.      * @ORM\Column(type="string", length=50, nullable=true)
  83.      */
  84.     private $bp;
  85.     /**
  86.      * @ORM\Column(type="string", length=20, nullable=true)
  87.      */
  88.     private $phone;
  89.     /**
  90.      * @ORM\Column(type="string", length=20, nullable=true)
  91.      */
  92.     private $fax;
  93.     /**
  94.      * @ORM\Column(type="string", length=100, nullable=true)
  95.      */
  96.     private $slogan;
  97.     /**
  98.      * @ORM\Column(type="string", length=140, nullable=true)
  99.      */
  100.     private $organisationName;
  101.     /**
  102.      * @ORM\Column(type="string", length=5, nullable=true)
  103.      */
  104.     private $ftpProtocole;
  105.     /**
  106.      * @ORM\Column(type="text", nullable=true)
  107.      */
  108.     private $ftpFolder;
  109.     /**
  110.      * System constructor.
  111.      */
  112.     public function __construct()
  113.     {
  114.         $this->date = new \DateTime();
  115.     }
  116.     public function getId(): ?int
  117.     {
  118.         return $this->id;
  119.     }
  120.     public function getStatut(): ?bool
  121.     {
  122.         return $this->statut;
  123.     }
  124.     public function setStatut(bool $statut): self
  125.     {
  126.         $this->statut = $statut;
  127.         return $this;
  128.     }
  129.     public function getDate(): ?\DateTimeInterface
  130.     {
  131.         return $this->date;
  132.     }
  133.     public function setDate(\DateTimeInterface $date): self
  134.     {
  135.         $this->date = $date;
  136.         return $this;
  137.     }
  138.     public function getFtpUser(): ?string
  139.     {
  140.         return $this->ftpUser;
  141.     }
  142.     public function setFtpUser(?string $ftpUser): self
  143.     {
  144.         $this->ftpUser = $ftpUser;
  145.         return $this;
  146.     }
  147.     public function getFtpPassword(): ?string
  148.     {
  149.         return $this->ftpPassword;
  150.     }
  151.     public function setFtpPassword(?string $ftpPassword): self
  152.     {
  153.         $this->ftpPassword = $ftpPassword;
  154.         return $this;
  155.     }
  156.     public function getFtpDirectory(): ?string
  157.     {
  158.         return $this->ftpDirectory;
  159.     }
  160.     public function setFtpDirectory(?string $ftpDirectory): self
  161.     {
  162.         $this->ftpDirectory = $ftpDirectory;
  163.         return $this;
  164.     }
  165.     public function getDatabaseFolder(): ?string
  166.     {
  167.         return $this->databaseFolder;
  168.     }
  169.     public function setDatabaseFolder(?string $databaseFolder): self
  170.     {
  171.         $this->databaseFolder = $databaseFolder;
  172.         return $this;
  173.     }
  174.     public function getAwaitingFolder(): ?string
  175.     {
  176.         return $this->awaitingFolder;
  177.     }
  178.     public function setAwaitingFolder(?string $awaitingFolder): self
  179.     {
  180.         $this->awaitingFolder = $awaitingFolder;
  181.         return $this;
  182.     }
  183.     public function getOrganisationLogo(): ?string
  184.     {
  185.         return $this->organisationLogo;
  186.     }
  187.     public function setOrganisationLogo(?string $organisationLogo): self
  188.     {
  189.         $this->organisationLogo = $organisationLogo;
  190.         return $this;
  191.     }
  192.     public function getOrganisationSigle(): ?string
  193.     {
  194.         return $this->organisationSigle;
  195.     }
  196.     public function setOrganisationSigle(?string $organisationSigle): self
  197.     {
  198.         $this->organisationSigle = $organisationSigle;
  199.         return $this;
  200.     }
  201.     public function toArray()
  202.     {
  203.         return [
  204.             "ftp_user"=>$this->ftpUser,
  205.             "ftp_password"=>$this->ftpPassword,
  206.             "ftp_directory"=>$this->ftpDirectory,
  207.             "ftp_port"=>$this->ftpPort,
  208.             "database_folder"=>$this->databaseFolder,
  209.             "awaiting_folder"=>$this->awaitingFolder,
  210.             "organisation_name"=>$this->organisationName,
  211.             "organisation_logo"=>$this->organisationLogo,
  212.             "organisation_sigle"=>$this->organisationSigle,
  213.             "base_folder"=>$this->baseFolder,
  214.             "saving_folder"=>$this->savingFolder,
  215.             "bordereau_folder"=>$this->bordereauFolder,
  216.             "classement_folder"=>$this->classementFolder,
  217.             "slogan"=>$this->slogan,
  218.             "country"=>$this->country,
  219.             "phone"=>$this->phone,
  220.             "bp"=>$this->bp,
  221.             "fax"=>$this->fax
  222.         ];
  223.     }
  224.     public function getFtpPort(): ?string
  225.     {
  226.         return $this->ftpPort;
  227.     }
  228.     public function setFtpPort(?string $ftpPort): self
  229.     {
  230.         $this->ftpPort = $ftpPort;
  231.         return $this;
  232.     }
  233.     public function getBaseFolder(): ?string
  234.     {
  235.         return $this->baseFolder;
  236.     }
  237.     public function setBaseFolder(?string $baseFolder): self
  238.     {
  239.         $this->baseFolder = $baseFolder;
  240.         return $this;
  241.     }
  242.     public function getBordereauFolder(): ?string
  243.     {
  244.         return $this->bordereauFolder;
  245.     }
  246.     public function setBordereauFolder(?string $bordereauFolder): self
  247.     {
  248.         $this->bordereauFolder = $bordereauFolder;
  249.         return $this;
  250.     }
  251.     public function getVersementFolder(): ?string
  252.     {
  253.         return $this->versementFolder;
  254.     }
  255.     public function setVersementFolder(?string $versementFolder): self
  256.     {
  257.         $this->versementFolder = $versementFolder;
  258.         return $this;
  259.     }
  260.     public function getClassementFolder(): ?string
  261.     {
  262.         return $this->classementFolder;
  263.     }
  264.     public function setClassementFolder(?string $classementFolder): self
  265.     {
  266.         $this->classementFolder = $classementFolder;
  267.         return $this;
  268.     }
  269.     public function getSavingFolder(): ?string
  270.     {
  271.         return $this->savingFolder;
  272.     }
  273.     public function setSavingFolder(?string $savingFolder): self
  274.     {
  275.         $this->savingFolder = $savingFolder;
  276.         return $this;
  277.     }
  278.     public function getCountry(): ?string
  279.     {
  280.         return $this->country;
  281.     }
  282.     public function setCountry(?string $country): self
  283.     {
  284.         $this->country = $country;
  285.         return $this;
  286.     }
  287.     public function getBp(): ?string
  288.     {
  289.         return $this->bp;
  290.     }
  291.     public function setBp(?string $bp): self
  292.     {
  293.         $this->bp = $bp;
  294.         return $this;
  295.     }
  296.     public function getPhone(): ?string
  297.     {
  298.         return $this->phone;
  299.     }
  300.     public function setPhone(?string $phone): self
  301.     {
  302.         $this->phone = $phone;
  303.         return $this;
  304.     }
  305.     public function getFax(): ?string
  306.     {
  307.         return $this->fax;
  308.     }
  309.     public function setFax(?string $fax): self
  310.     {
  311.         $this->fax = $fax;
  312.         return $this;
  313.     }
  314.     public function getSlogan(): ?string
  315.     {
  316.         return $this->slogan;
  317.     }
  318.     public function setSlogan(?string $slogan): self
  319.     {
  320.         $this->slogan = $slogan;
  321.         return $this;
  322.     }
  323.     public function getOrganisationName(): ?string
  324.     {
  325.         return $this->organisationName;
  326.     }
  327.     public function setOrganisationName(?string $organisationName): self
  328.     {
  329.         $this->organisationName = $organisationName;
  330.         return $this;
  331.     }
  332.     public function getFtpProtocole(): ?string
  333.     {
  334.         return $this->ftpProtocole;
  335.     }
  336.     public function setFtpProtocole(?string $ftpProtocole): self
  337.     {
  338.         $this->ftpProtocole = $ftpProtocole;
  339.         return $this;
  340.     }
  341.     public function getFtpFolder(): ?string
  342.     {
  343.         return $this->ftpFolder;
  344.     }
  345.     public function setFtpFolder(?string $ftpFolder): self
  346.     {
  347.         $this->ftpFolder = $ftpFolder;
  348.         return $this;
  349.     }
  350.     public function getRoles(): array
  351.     {
  352.         return ['ROLE_SYSTEM'];
  353.     }
  354.     public function getPassword(): string
  355.     {
  356.         return $this->getFtpPassword();
  357.     }
  358.     public function getSalt() {}
  359.     public function eraseCredentials() {}
  360.     public function getUserIdentifier(): string
  361.     {
  362.         return "system.identifier"; // Or another unique field
  363.     }
  364.     public function getUsername()
  365.     {
  366.         return "system.identifier";
  367.     }
  368. }