src/Entity/CacheConfiguration.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * CacheConfiguration
  6.  *
  7.  * @ORM\Table(name="cacheconfiguration")
  8.  * @ORM\Entity(repositoryClass="App\Repository\CacheConfigurationRepository")
  9.  */
  10. class CacheConfiguration
  11. {
  12.     /**
  13.      * @ORM\Column(name="id", type="integer")
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue()
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, nullable=true)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $url;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $userId;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $pwkey;
  34.     /**
  35.      * @ORM\Column(type="string", length=500, nullable=true)
  36.      */
  37.     private $pnames;
  38.     /**
  39.      * @ORM\Column(type="string", length=3000, nullable=true)
  40.      */
  41.     private $exportedXmlFileUrl;
  42.     /**
  43.      * @ORM\Column(type="json", nullable=true)
  44.      */
  45.     private $exportedXmlTranslatedFilesUrls = [];
  46.     /**
  47.      * @ORM\Column(type="string", length=4000, nullable=true)
  48.      */
  49.     private $pvalues;
  50.     /**
  51.      * @ORM\Column(type="json", nullable=true)
  52.      */
  53.     private $extraParams = [];
  54.     /**
  55.      * @var \DateTime|null
  56.      *
  57.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  58.      */
  59.     private $updatedAt;
  60.     /**
  61.      * @ORM\Column(type="datetime", nullable=true)
  62.      */
  63.     private $createdAt;
  64.     /**
  65.      * @ORM\Column(type="integer", options={"default" : 20})
  66.      */
  67.     private $updateLimit;
  68.     /**
  69.      * @ORM\Column(type="integer", options={"default" : 50})
  70.      */
  71.     private $totalLimit;
  72.     /**
  73.      * @ORM\Column(type="integer", options={"default" : 10})
  74.      */
  75.     private $ordre;
  76.     public function getId(): ?int
  77.     {
  78.         return $this->id;
  79.     }
  80.     public function getName(): ?string
  81.     {
  82.         return $this->name;
  83.     }
  84.     public function setName(?string $name): self
  85.     {
  86.         $this->name $name;
  87.         return $this;
  88.     }
  89.     public function getUrl(): ?string
  90.     {
  91.         return $this->url;
  92.     }
  93.     public function setUrl(?string $url): self
  94.     {
  95.         $this->url $url;
  96.         return $this;
  97.     }
  98.     public function getUserId(): ?string
  99.     {
  100.         return $this->userId;
  101.     }
  102.     public function setUserId(?string $userId): self
  103.     {
  104.         $this->userId $userId;
  105.         return $this;
  106.     }
  107.     public function getPwkey(): ?string
  108.     {
  109.         return $this->pwkey;
  110.     }
  111.     public function setPwkey(?string $pwkey): self
  112.     {
  113.         $this->pwkey $pwkey;
  114.         return $this;
  115.     }
  116.     public function getPnames(): ?string
  117.     {
  118.         return $this->pnames;
  119.     }
  120.     public function setPnames(?string $pnames): self
  121.     {
  122.         $this->pnames $pnames;
  123.         return $this;
  124.     }
  125.     public function getExportedXmlFileUrl(): ?string
  126.     {
  127.         return $this->exportedXmlFileUrl;
  128.     }
  129.     public function setExportedXmlFileUrl(?string $exportedXmlFileUrl): self
  130.     {
  131.         $this->exportedXmlFileUrl $exportedXmlFileUrl;
  132.         return $this;
  133.     }
  134.     public function getExportedXmlTranslatedFilesUrls(): ?array
  135.     {
  136.         return $this->exportedXmlTranslatedFilesUrls;
  137.     }
  138.     public function setExportedXmlTranslatedFilesUrls(?array $exportedXmlTranslatedFilesUrls): self
  139.     {
  140.         $this->exportedXmlTranslatedFilesUrls $exportedXmlTranslatedFilesUrls;
  141.         return $this;
  142.     }
  143.     public function getPvalues(): ?string
  144.     {
  145.         return $this->pvalues;
  146.     }
  147.     public function setPvalues(?string $pvalues): self
  148.     {
  149.         $this->pvalues $pvalues;
  150.         return $this;
  151.     }
  152.     public function getExtraParams(): ?array
  153.     {
  154.         return $this->extraParams;
  155.     }
  156.     public function setExtraParams(?array $extraParams): self
  157.     {
  158.         $this->extraParams $extraParams;
  159.         return $this;
  160.     }
  161.     public function getTotalUrl(): ?string
  162.     {
  163.         $userId $this->getUserId();
  164.         $pwkey $this->getPwkey();
  165.         $pnames $this->getPnames();
  166.         $pvalues $this->getPvalues();
  167.         $extraParams $this->getExtraParams();
  168.         $url $this->getUrl() . "/xml/exploitation/listeproduits.asp" .
  169.             "?lxml=sit_listereduite&latable=SIT_LISTEREDUITE&leschamps=Produit,MARQUAGE&tousprods=Y" .
  170.             "&user=$userId&pwkey=$pwkey&pnames=$pnames&pvalues=$pvalues";
  171.         foreach ($extraParams as $param)
  172.         {
  173.             $key $param['key'];
  174.             $value $param['value'];
  175.             $url .= "&$key=$value";
  176.         }
  177.         return $url;
  178.     }
  179.     public function getLieuxUrl(): ?string
  180.     {
  181.         $userId $this->getUserId();
  182.         $pwkey $this->getPwkey();
  183.         $url $this->getUrl() . "/xml/exploitation/listelieux.asp" .
  184.             "?user=$userId&pwkey=$pwkey";
  185.         return $url;
  186.     }
  187.     public function getUpdateUrl($partialForLang false): ?string
  188.     {
  189.         $userId $this->getUserId();
  190.         $pwkey $this->getPwkey();
  191.         $pnames $this->getPnames();
  192.         $pvalues $this->getPvalues();
  193.         $extraParams $this->getExtraParams();
  194.         $defaultParams = [
  195.             'lxml' => 'sit_listecomplete',
  196.             'latable' => 'SIT_LISTECOMPLETE',
  197.             'tscrit' => 'Y',
  198.             'tshor' => 'Y',
  199.             'leshoraires' => '01/01/2000|@+36000',
  200.             'lescouplages' => 'Y',
  201.             'tousprods' => 'Y',
  202.             'marquages' => '0,3'
  203.         ];
  204.         if($partialForLang) {
  205.             $defaultParams = [
  206.                 'lxml' => 'sit_listecomplete',
  207.                 'latable' => 'SIT_LISTECOMPLETE',
  208.                 'tscrit' => 'Y',
  209.                 'tousprods' => 'Y',
  210.                 'marquages' => '0,3'
  211.             ];
  212.         }
  213.         $url $this->getUrl() . "/xml/exploitation/listeproduits.asp?user=$userId&pwkey=$pwkey&pnames=$pnames&pvalues=$pvalues";
  214.         /*
  215.             "?lxml=sit_listecomplete&latable=SIT_LISTECOMPLETE&tscrit=Y&tshor=Y" .
  216.             "&leshoraires=01/01/2000|@+36000&lescouplages=Y&tousprods=Y&marquages=0,3" .
  217.         */
  218.         foreach ($extraParams as $param)
  219.         {
  220.             // Pour ne pas mettre le paramèrte en double dans l'URL
  221.             if(isset($defaultParams[$param['key']])) {
  222.                 unset($defaultParams[$param['key']]);
  223.             }
  224.             $key $param['key'];
  225.             $value $param['value'];
  226.             $url .= "&$key=$value";
  227.         }
  228.         foreach($defaultParams as $key => $value) {
  229.             $url .= "&$key=$value";
  230.         }
  231.         return $url;
  232.     }
  233.     public function getCriterionUrl($lang 'fr'): ?string
  234.     {
  235.         $userId $this->getUserId();
  236.         $pwkey $this->getPwkey();
  237.         $url $this->getUrl() . "/xml/exploitation/listecrit.asp" .
  238.             "?tousprods=Y&marquages=0,3" .
  239.             "&user=$userId&pwkey=$pwkey";
  240.         if ($lang != 'fr') {
  241.             $url .= "&schema=WEBACCESS_" strtoupper($lang);
  242.         }
  243.         return $url;
  244.     }
  245.     public function getNomenclatureUrl($lang 'fr'): ?string
  246.     {
  247.         $userId $this->getUserId();
  248.         $pwkey $this->getPwkey();
  249.         $url $this->getUrl() . "/xml/exploitation/listenomenc.asp" .
  250.             "?tousprods=Y&marquages=0,3" .
  251.             "&user=$userId&pwkey=$pwkey";
  252.         if ($lang != 'fr') {
  253.             $url .= "&schema=WEBACCESS_" strtoupper($lang);
  254.         }
  255.         return $url;
  256.     }
  257.     public function getUpdatedAt(): ?\DateTimeInterface
  258.     {
  259.         return $this->updatedAt;
  260.     }
  261.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  262.     {
  263.         $this->updatedAt $updatedAt;
  264.         return $this;
  265.     }
  266.     public function getCreatedAt(): ?\DateTimeInterface
  267.     {
  268.         return $this->createdAt;
  269.     }
  270.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  271.     {
  272.         $this->createdAt $createdAt;
  273.         return $this;
  274.     }
  275.     public function getUpdateLimit(): ?int
  276.     {
  277.         return $this->updateLimit;
  278.     }
  279.     public function setUpdateLimit(int $updateLimit): self
  280.     {
  281.         $this->updateLimit $updateLimit;
  282.         return $this;
  283.     }
  284.     public function getTotalLimit(): ?int
  285.     {
  286.         return $this->totalLimit;
  287.     }
  288.     public function setTotalLimit(int $totalLimit): self
  289.     {
  290.         $this->totalLimit $totalLimit;
  291.         return $this;
  292.     }
  293.     public function getOrdre(): ?int
  294.     {
  295.         return $this->ordre;
  296.     }
  297.     public function setOrdre(int $ordre): self
  298.     {
  299.         $this->ordre $ordre;
  300.         return $this;
  301.     }
  302. }