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="string", length=3000, nullable=true)
  44.      */
  45.     private $criterionForCoupled;
  46.     /**
  47.      * @ORM\Column(type="json", nullable=true)
  48.      */
  49.     private $exportedXmlTranslatedFilesUrls = [];
  50.     /**
  51.      * @ORM\Column(type="string", length=4000, nullable=true)
  52.      */
  53.     private $pvalues;
  54.     /**
  55.      * @ORM\Column(type="json", nullable=true)
  56.      */
  57.     private $extraParams = [];
  58.     /**
  59.      * @var \DateTime|null
  60.      *
  61.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  62.      */
  63.     private $updatedAt;
  64.     /**
  65.      * @ORM\Column(type="datetime", nullable=true)
  66.      */
  67.     private $createdAt;
  68.     /**
  69.      * @ORM\Column(type="integer", options={"default" : 20})
  70.      */
  71.     private $updateLimit;
  72.     /**
  73.      * @ORM\Column(type="integer", options={"default" : 50})
  74.      */
  75.     private $totalLimit;
  76.     /**
  77.      * @ORM\Column(type="integer", options={"default" : 10})
  78.      */
  79.     private $ordre;
  80.     public function getId(): ?int
  81.     {
  82.         return $this->id;
  83.     }
  84.     public function getName(): ?string
  85.     {
  86.         return $this->name;
  87.     }
  88.     public function setName(?string $name): self
  89.     {
  90.         $this->name $name;
  91.         return $this;
  92.     }
  93.     public function getUrl(): ?string
  94.     {
  95.         return $this->url;
  96.     }
  97.     public function setUrl(?string $url): self
  98.     {
  99.         $this->url $url;
  100.         return $this;
  101.     }
  102.     public function getUserId(): ?string
  103.     {
  104.         return $this->userId;
  105.     }
  106.     public function setUserId(?string $userId): self
  107.     {
  108.         $this->userId $userId;
  109.         return $this;
  110.     }
  111.     public function getPwkey(): ?string
  112.     {
  113.         return $this->pwkey;
  114.     }
  115.     public function setPwkey(?string $pwkey): self
  116.     {
  117.         $this->pwkey $pwkey;
  118.         return $this;
  119.     }
  120.     public function getPnames(): ?string
  121.     {
  122.         return $this->pnames;
  123.     }
  124.     public function setPnames(?string $pnames): self
  125.     {
  126.         $this->pnames $pnames;
  127.         return $this;
  128.     }
  129.     public function getCriterionForCoupled(): ?string
  130.     {
  131.         return $this->criterionForCoupled;
  132.     }
  133.     public function setCriterionForCoupled(?string $criterionForCoupled): self
  134.     {
  135.         $this->criterionForCoupled $criterionForCoupled;
  136.         return $this;
  137.     }
  138.     public function getExportedXmlFileUrl(): ?string
  139.     {
  140.         return $this->exportedXmlFileUrl;
  141.     }
  142.     public function setExportedXmlFileUrl(?string $exportedXmlFileUrl): self
  143.     {
  144.         $this->exportedXmlFileUrl $exportedXmlFileUrl;
  145.         return $this;
  146.     }
  147.     public function getExportedXmlTranslatedFilesUrls(): ?array
  148.     {
  149.         return $this->exportedXmlTranslatedFilesUrls;
  150.     }
  151.     public function setExportedXmlTranslatedFilesUrls(?array $exportedXmlTranslatedFilesUrls): self
  152.     {
  153.         $this->exportedXmlTranslatedFilesUrls $exportedXmlTranslatedFilesUrls;
  154.         return $this;
  155.     }
  156.     public function getPvalues(): ?string
  157.     {
  158.         return $this->pvalues;
  159.     }
  160.     public function setPvalues(?string $pvalues): self
  161.     {
  162.         $this->pvalues $pvalues;
  163.         return $this;
  164.     }
  165.     public function getExtraParams(): ?array
  166.     {
  167.         return $this->extraParams;
  168.     }
  169.     public function setExtraParams(?array $extraParams): self
  170.     {
  171.         $this->extraParams $extraParams;
  172.         return $this;
  173.     }
  174.     public function getTotalUrl(): ?string
  175.     {
  176.         $userId $this->getUserId();
  177.         $pwkey $this->getPwkey();
  178.         $pnames $this->getPnames();
  179.         $pvalues $this->getPvalues();
  180.         $extraParams $this->getExtraParams();
  181.         $url $this->getUrl() . "/xml/exploitation/listeproduits.asp" .
  182.             "?lxml=sit_listereduite&latable=SIT_LISTEREDUITE&leschamps=Produit,MARQUAGE&tousprods=Y" .
  183.             "&user=$userId&pwkey=$pwkey&pnames=$pnames&pvalues=$pvalues";
  184.         foreach ($extraParams as $param)
  185.         {
  186.             $key $param['key'];
  187.             $value $param['value'];
  188.             $url .= "&$key=$value";
  189.         }
  190.         return $url;
  191.     }
  192.     public function getLieuxUrl(): ?string
  193.     {
  194.         $userId $this->getUserId();
  195.         $pwkey $this->getPwkey();
  196.         $url $this->getUrl() . "/xml/exploitation/listelieux.asp" .
  197.             "?user=$userId&pwkey=$pwkey";
  198.         return $url;
  199.     }
  200.     public function getUpdateUrl($partialForLang false): ?string
  201.     {
  202.         $userId $this->getUserId();
  203.         $pwkey $this->getPwkey();
  204.         $pnames $this->getPnames();
  205.         $pvalues $this->getPvalues();
  206.         $extraParams $this->getExtraParams();
  207.         // Update 04/03/2026 : on ajoute les paramètres pour extraire les disponibilités à venir -
  208.         // Update 11/03/2026 :ATTENTION ! QUE EN FR sinon on a plus rien en langues
  209.         $pnames .= ',dispodu,dispoau';
  210.         $pvalues .= ',@,@+365';
  211.         $defaultParams = [
  212.             'lxml' => 'sit_listecomplete',
  213.             'latable' => 'SIT_LISTECOMPLETE',
  214.             'tscrit' => 'Y',
  215.             'tshor' => 'Y',
  216.             'leshoraires' => '01/01/2000|@+36000',
  217.             'lescouplages' => 'Y',
  218.             'tousprods' => 'Y',
  219.             'marquages' => '0,3',
  220.             'tsdispo' => 'Y'
  221.         ];
  222.         if($partialForLang) {
  223.             $defaultParams = [
  224.                 'lxml' => 'sit_listecomplete',
  225.                 'latable' => 'SIT_LISTECOMPLETE',
  226.                 'tscrit' => 'Y',
  227.                 'tousprods' => 'Y',
  228.                 'marquages' => '0,3'
  229.             ];
  230.             // Update 11/03/2026 :ATTENTION ! QUE EN FR sinon on a plus rien en langues
  231.             $pnames $this->getPnames();
  232.             $pvalues $this->getPvalues();
  233.         }
  234.         $url $this->getUrl() . "/xml/exploitation/listeproduits.asp?user=$userId&pwkey=$pwkey&pnames=$pnames&pvalues=$pvalues";
  235.         /*
  236.             "?lxml=sit_listecomplete&latable=SIT_LISTECOMPLETE&tscrit=Y&tshor=Y" .
  237.             "&leshoraires=01/01/2000|@+36000&lescouplages=Y&tousprods=Y&marquages=0,3" .
  238.         */
  239.         foreach ($extraParams as $param)
  240.         {
  241.             // Pour ne pas mettre le paramèrte en double dans l'URL
  242.             if(isset($defaultParams[$param['key']])) {
  243.                 unset($defaultParams[$param['key']]);
  244.             }
  245.             $key $param['key'];
  246.             $value $param['value'];
  247.             $url .= "&$key=$value";
  248.         }
  249.         foreach($defaultParams as $key => $value) {
  250.             $url .= "&$key=$value";
  251.         }
  252.         return $url;
  253.     }
  254.     public function getCriterionUrl($lang 'fr'): ?string
  255.     {
  256.         $userId $this->getUserId();
  257.         $pwkey $this->getPwkey();
  258.         $url $this->getUrl() . "/xml/exploitation/listecrit.asp" .
  259.             "?tousprods=Y&marquages=0,3" .
  260.             "&user=$userId&pwkey=$pwkey";
  261.         if ($lang != 'fr') {
  262.             $url .= "&schema=WEBACCESS_" strtoupper($lang);
  263.         }
  264.         return $url;
  265.     }
  266.     public function getNomenclatureUrl($lang 'fr'): ?string
  267.     {
  268.         $userId $this->getUserId();
  269.         $pwkey $this->getPwkey();
  270.         $url $this->getUrl() . "/xml/exploitation/listenomenc.asp" .
  271.             "?tousprods=Y&marquages=0,3" .
  272.             "&user=$userId&pwkey=$pwkey";
  273.         if ($lang != 'fr') {
  274.             $url .= "&schema=WEBACCESS_" strtoupper($lang);
  275.         }
  276.         return $url;
  277.     }
  278.     public function getUpdatedAt(): ?\DateTimeInterface
  279.     {
  280.         return $this->updatedAt;
  281.     }
  282.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  283.     {
  284.         $this->updatedAt $updatedAt;
  285.         return $this;
  286.     }
  287.     public function getCreatedAt(): ?\DateTimeInterface
  288.     {
  289.         return $this->createdAt;
  290.     }
  291.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  292.     {
  293.         $this->createdAt $createdAt;
  294.         return $this;
  295.     }
  296.     public function getUpdateLimit(): ?int
  297.     {
  298.         return $this->updateLimit;
  299.     }
  300.     public function setUpdateLimit(int $updateLimit): self
  301.     {
  302.         $this->updateLimit $updateLimit;
  303.         return $this;
  304.     }
  305.     public function getTotalLimit(): ?int
  306.     {
  307.         return $this->totalLimit;
  308.     }
  309.     public function setTotalLimit(int $totalLimit): self
  310.     {
  311.         $this->totalLimit $totalLimit;
  312.         return $this;
  313.     }
  314.     public function getOrdre(): ?int
  315.     {
  316.         return $this->ordre;
  317.     }
  318.     public function setOrdre(int $ordre): self
  319.     {
  320.         $this->ordre $ordre;
  321.         return $this;
  322.     }
  323. }