src/Services/Filter.php line 394

Open in your IDE?
  1. <?php
  2. namespace App\Services;
  3. use DateTime;
  4. use App\Entity\User;
  5. use App\Entity\Ticket;
  6. use App\Entity\Chambre;
  7. use App\Entity\Annonce;
  8. use App\Entity\Caution;
  9. use App\Entity\Command;
  10. use App\Entity\Company;
  11. use App\Entity\Product;
  12. use App\Entity\Transporteur;
  13. use App\Repository\AvisRepository;
  14. use App\Repository\UserRepository;
  15. use App\Repository\PhotosRepository;
  16. use App\Repository\TicketRepository;
  17. use App\Repository\CautionRepository;
  18. use App\Repository\CommandRepository;
  19. use App\Repository\CompanyRepository;
  20. use App\Repository\ProductRepository;
  21. use App\Repository\LocationRepository;
  22. use App\Repository\WishListRepository;
  23. use App\Repository\MessagingRepository;
  24. use App\Repository\AbonnementRepository;
  25. use App\Repository\DepartmentRepository;
  26. use Doctrine\ORM\EntityManagerInterface;
  27. use App\Repository\SubCategoryRepository;
  28. use App\Repository\TransporteurRepository;
  29. use App\Repository\ProductOptionRepository;
  30. use App\Repository\AnnonceCompanyRepository;
  31. use App\Repository\CommandProductRepository;
  32. use App\Repository\ContactProductRepository;
  33. use App\Repository\TransporteurWeightPriceRepository;
  34. use Psr\Log\LoggerInterface;
  35. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  36. class Filter
  37. {
  38.    /**
  39.     * @var DepartmentRepository
  40.     */
  41.    private $departmentRepository;
  42.    /**
  43.     * @var SubCategoryRepository
  44.     */
  45.    private $subCategoryRepository;
  46.    /**
  47.     * @var CommandRepository
  48.     */
  49.    private $commandRepository;
  50.    /**
  51.     * @var ProductRepository
  52.     */
  53.    private $productRepository;
  54.    /**
  55.     * @var AvisRepository
  56.     */
  57.    private $avisRepository;
  58.    /**
  59.     * @var CommandProductRepository
  60.     */
  61.    private $commandProductRepository;
  62.    /**
  63.     * @var WishListRepository
  64.     */
  65.    private $wishListRepository;
  66.    /**
  67.     * @var MessagingRepository
  68.     */
  69.    private $messagingRepository;
  70.    /**
  71.     * @var TicketRepository
  72.     */
  73.    private $ticketRepository;
  74.    /**
  75.     * @var ContactProductRepository
  76.     */
  77.    private $contactProductRepository;
  78.    /**
  79.     * @var ProductOptionRepository
  80.     */
  81.    private $productOptionRepository;
  82.    /**
  83.     * @var TransporteurWeightPriceRepository
  84.     */
  85.    private $transporteurWeightPriceRepository;
  86.    /**
  87.     * @var TransporteurRepository
  88.     */
  89.    private $transporteurRepository;
  90.    /**
  91.     * @var PhotosRepository
  92.     */
  93.    private $photosRepository;
  94.    /**
  95.     * @var AbonnementRepository
  96.     */
  97.    private $abonnementRepository;
  98.    /**
  99.     * @var CompanyRepository
  100.     */
  101.    private $companyRepository;
  102.    /**
  103.     * @var UserRepository
  104.     */
  105.    private $userRepository;
  106.    /**
  107.     * @var MangoPayService
  108.     */
  109.    private $mangoPayService;
  110.    /**
  111.     * @var LocationRepository
  112.     */
  113.    private $locationRepository;
  114.    /**
  115.     * @var CautionRepository
  116.     */
  117.    private $caution;
  118.    /**
  119.     * @var StripeConnectService
  120.     */
  121.    private $stripeConnectService;
  122.    private $em;
  123.    private LoggerInterface $logger;
  124.    public function __construct(
  125.       TicketRepository $ticketRepository,
  126.       WishListRepository $wishListRepository,
  127.       CommandProductRepository $commandProductRepository,
  128.       AvisRepository $avisRepository,
  129.       ProductRepository $productRepository,
  130.       DepartmentRepository $departmentRepository,
  131.       SubCategoryRepository $subCategoryRepository,
  132.       CommandRepository $commandRepository,
  133.       MessagingRepository $messagingRepository,
  134.       ContactProductRepository $contactProductRepository,
  135.       ProductOptionRepository $productOptionRepository,
  136.       TransporteurRepository $transporteurRepository,
  137.       TransporteurWeightPriceRepository $transporteurWeightPriceRepository,
  138.       PhotosRepository $photosRepository,
  139.       AbonnementRepository $abonnementRepository,
  140.       CompanyRepository $companyRepository,
  141.       UserRepository $userRepository,
  142.       MangoPayService $mangoPayService,
  143.       LocationRepository $locationRepository,
  144.       CautionRepository $caution,
  145.       EntityManagerInterface $em,
  146.       StripeConnectService $stripeConnectService,
  147.       LoggerInterface $logger
  148.    ) {
  149.       $this->departmentRepository $departmentRepository;
  150.       $this->subCategoryRepository $subCategoryRepository;
  151.       $this->commandRepository $commandRepository;
  152.       $this->productRepository $productRepository;
  153.       $this->avisRepository $avisRepository;
  154.       $this->commandProductRepository $commandProductRepository;
  155.       $this->wishListRepository $wishListRepository;
  156.       $this->messagingRepository $messagingRepository;
  157.       $this->ticketRepository $ticketRepository;
  158.       $this->contactProductRepository $contactProductRepository;
  159.       $this->productOptionRepository $productOptionRepository;
  160.       $this->transporteurWeightPriceRepository $transporteurWeightPriceRepository;
  161.       $this->transporteurRepository $transporteurRepository;
  162.       $this->photosRepository $photosRepository;
  163.       $this->abonnementRepository $abonnementRepository;
  164.       $this->companyRepository $companyRepository;
  165.       $this->userRepository $userRepository;
  166.       $this->mangoPayService $mangoPayService;
  167.       $this->locationRepository $locationRepository;
  168.       $this->caution $caution;
  169.       $this->stripeConnectService $stripeConnectService;
  170.       $this->em $em;
  171.       $this->logger $logger;
  172.    }
  173.    public function getDepartments()
  174.    {
  175.       return $this->departmentRepository->getDepartmentsIfProduct();
  176.    }
  177.    public function getSubcategories()
  178.    {
  179.       return $this->subCategoryRepository->findBy([], ['id' => 'DESC']);
  180.    }
  181.    public function filterActiveProducts($products)
  182.    {
  183.       return $products->filter(function ($product) {
  184.          // Check if the product and its related entities meet all the conditions
  185.          $company $product->getCompany();
  186.          $subCategories $product->getSubCategories();
  187.          // Apply the same conditions as in the findAllServices method
  188.          return
  189.             $product->getIsActivated() &&
  190.             !$product->getIsDesactivatedByAdmin() &&
  191.             $company && $company->getIsConfirmed() &&
  192.             $company->getIsValidDocument() &&
  193.             $subCategories->exists(function ($key$subCategory) {
  194.                return $subCategory->getIsService() || !$subCategory->getIsService();
  195.             });
  196.       })->count();
  197.    }
  198.    public function getCommandsByCompany(Company $company)
  199.    {
  200.       return $this->commandRepository->getCommandsByCompany($company);
  201.    }
  202.    public function getOtherProducts(Product $product)
  203.    {
  204.       return $this->productRepository->getOtherProductsCompany($product);
  205.    }
  206.    public function getOtherProductsCompany(Company $company)
  207.    {
  208.       return $this->productRepository->getOtherProductsByCompany($company);
  209.    }
  210.    public function getAvisUserExist(User $userProduct $product)
  211.    {
  212.       $isExist $this->avisRepository->findOneBy(['client' => $user'product' => $product]);
  213.       if (!$isExist) {
  214.          return false;
  215.       }
  216.       return true;
  217.    }
  218.    public function getIfCommandNotFinish(Command $commandCompany $company)
  219.    {
  220.       $commandProducts $this->commandProductRepository->getCommandCompanyNotFinish($command$company);
  221.       return count($commandProducts);
  222.    }
  223.    public function getIfIsWish(User $userProduct $product)
  224.    {
  225.       $isWish =  $this->wishListRepository->findOneBy(['user' => $user'product' => $product]);
  226.       if ($isWish) {
  227.          return true;
  228.       }
  229.       return false;
  230.    }
  231.    public function getMessagingByTicket(Ticket $ticket)
  232.    {
  233.       return $this->messagingRepository->findBy(['ticket' => $ticket]);
  234.    }
  235.    public function getTicketIsNew(Company $company)
  236.    {
  237.       $tickets $this->ticketRepository->getTicketsByProductsIsNew($company);
  238.       if (empty($tickets)) {
  239.          return false;
  240.       }
  241.       return true;
  242.    }
  243.    public function getTicketIsNewForClient(User $user)
  244.    {
  245.       $tickets $this->ticketRepository->getTicketsByProductsIsNewForClient($user);
  246.       if (empty($tickets)) {
  247.          return false;
  248.       }
  249.       return true;
  250.    }
  251.    public function getTicketIsNewByTicket(Ticket $ticket)
  252.    {
  253.       $tickets $this->ticketRepository->getTicketsIsNewByTicket($ticket);
  254.       if (!$tickets) {
  255.          return false;
  256.       }
  257.       return true;
  258.    }
  259.    public function getTicketIsNewByTicketForClient(Ticket $ticket)
  260.    {
  261.       $tickets $this->ticketRepository->getTicketsIsNewByTicketForClient($ticket);
  262.       if (!$tickets) {
  263.          return false;
  264.       }
  265.       return true;
  266.    }
  267.    public function getNotifsContactProduct(Company $company)
  268.    {
  269.       $contactsProduct $this->contactProductRepository->getNotifContactsProduct($company);
  270.       if (!$contactsProduct) {
  271.          return false;
  272.       }
  273.       return true;
  274.    }
  275.    public function getProductOption(int $id)
  276.    {
  277.       return $this->productOptionRepository->find($id);
  278.    }
  279.    public function getProductOptionByProduit(Product $product)
  280.    {
  281.       return $this->productOptionRepository->findProduitOptionByProduit($product);
  282.    }
  283.    public function getTransporteurWeightByWeight(?string $weight)
  284.    {
  285.       if ($weight === null) {
  286.          return null;
  287.       }
  288.       return $this->transporteurWeightPriceRepository->getTransporteursPriceByWeight($weight);
  289.    }
  290.    public function getTransporteurWeightById(int $id)
  291.    {
  292.       return $this->transporteurWeightPriceRepository->getTransporteurWeightById($id);
  293.    }
  294.    public function getByTransporteurAndWeight(Transporteur $transporteurstring $weightint $quantity)
  295.    {
  296.       $weightInInt str_replace('g'''$weight);
  297.       $weightInInt = (int) str_replace('kg'''$weightInInt);
  298.       $totalWeight $weightInInt $quantity;
  299.       $totalWeightString $this->calculWeightQuantity($totalWeight$quantity);
  300.       $transporteurObject $this->transporteurWeightPriceRepository->getByTransporteurAndWeight($transporteur$totalWeightString);
  301.       if (!$transporteurObject) {
  302.          $transporteurObject null;
  303.          for ($i $totalWeight$i <= 30$i++) {
  304.             $totalWeightString $this->calculWeightQuantity($i$quantity);
  305.             $transporteurObject $this->transporteurWeightPriceRepository->getByTransporteurAndWeight($transporteur$totalWeightString);
  306.             if ($transporteurObject) {
  307.                break;
  308.             }
  309.          }
  310.       }
  311.       return $transporteurObject;
  312.    }
  313.    public function calculWeightQuantity(string $totalWeightint $quantity)
  314.    {
  315.       if ($totalWeight == 250 || $totalWeight == 500) {
  316.          $totalWeight $totalWeight 'g';
  317.       } elseif ($totalWeight >= 1000) {
  318.          $totalWeight = ($totalWeight 1000) . 'kg';
  319.       } else {
  320.          $totalWeight $totalWeight 'kg';
  321.       }
  322.       return $totalWeight;
  323.    }
  324.    public function limite_motsafficher(string $texteint $longeur_max)
  325.    {
  326.       if (strlen($texte) > $longeur_max) {
  327.          $texte substr($texte0$longeur_max);
  328.          $dernier_espace strrpos($texte" ");
  329.          $texte substr($texte0$dernier_espace) . "...";
  330.       }
  331.       return $texte;
  332.    }
  333.    public function getphotoProduit(Product $product)
  334.    {
  335.       $image $this->photosRepository->findOneBy(['product' => $product]);
  336.       return $image->getUrl();
  337.    }
  338.    public function getCompanyAbonnee(Company $company)
  339.    {
  340.       $companyAbonne $this->abonnementRepository->findBy(['company' => $company]);
  341.       return $companyAbonne;
  342.    }
  343.    public function getCompany()
  344.    {
  345.       $company $this->companyRepository->findBy(['isConfirmed' => true'isValidDocument' => true]);
  346.       return $company;
  347.    }
  348.    public function getPhotounProductsCompany(Company $company)
  349.    {
  350.       return $this->productRepository->getPhotoProductsByCompany($company);
  351.    }
  352.    public function getCompanyAvoirProduit(Product $product)
  353.    {
  354.       return $this->companyRepository->CompanyAvoirProduit($product);
  355.    }
  356.    public function getProducttous(Company $company)
  357.    {
  358.       $produits $this->productRepository->getAllProductsByCompany($company);
  359.       return $produits;
  360.    }
  361.    public function getproductById($id)
  362.    {
  363.       return $this->productRepository->findOneBy(['id' => $id]);
  364.    }
  365.    public function recuperUrlMercure()
  366.    {
  367.       return ['mercureHubUrl' => $_ENV['MERCURE_PUBLISH_URL'], 'mercureClientUrl' => $_ENV['MERCURE_DISC_PUBLISH_URL_TWO']];
  368.    }
  369.    public function conterNewMessage($tickets$nbrmessage)
  370.    {
  371.       foreach ($tickets as $ticket) {
  372.          $nb 0;
  373.          foreach ($nbrmessage as $nbrsms) {
  374.             $nb $ticket->getId() == $nbrsms['id'] ? $nbrsms['nbmessage'] : $nb;
  375.             $ticket->setNbMessage($nb);
  376.          }
  377.       }
  378.       return $tickets;
  379.    }
  380.    public function diferenceetredate($network)
  381.    {
  382.       $datej = new DateTime('now');
  383.       $difd $network->diff($datej);
  384.       return $res $difd->true false;
  385.    }
  386.    public function voirDestinataire(Ticket $ticket$utilisateur)
  387.    {
  388.       $destinataire "";
  389.       if ($ticket->getProduct()) {
  390.          if ($ticket->getCreatedBy()->getId() == $utilisateur->getId()) {
  391.             $destinataire $ticket->getProduct()->getCompany();
  392.          } else {
  393.             $destinataire $ticket->getCreatedBy();
  394.          }
  395.       } else {
  396.          $resultats $this->ticketRepository->getDestinataire($ticket)[0];
  397.          if ($resultats['DestinataireId'] == $utilisateur->getId()) {
  398.             if ($ticket->getTypeExpeditaire() == 'client') {
  399.                $destinataire $this->userRepository->findOneById($resultats['expeditaireId']);
  400.             } else {
  401.                $destinataire $this->companyRepository->findOneById($resultats['expeditaireId']);
  402.             }
  403.          } else {
  404.             if ($ticket->getTypeDestinataire() == 'client') {
  405.                $destinataire $this->userRepository->findOneById($resultats['DestinataireId']);
  406.             } else {
  407.                $destinataire $this->companyRepository->findOneById($resultats['DestinataireId']);
  408.             }
  409.          }
  410.       }
  411.       return $destinataire;
  412.    }
  413.    public function getLocationUse(User $userProduct $produit)
  414.    {
  415.       $location $this->locationRepository->getLocationByClientProduit($user$produit) ?? null;
  416.       return $location[0] ?? null;
  417.    }
  418.    public function retour_caution()
  419.    {
  420.       $dateDuJour = new DateTime();
  421.       $cautions $this->caution->findBy(['isTrancefert' => null'isReturn' => null]);
  422.       
  423.       foreach ($cautions as $key => $caution) {
  424.          $datedif date_diff($dateDuJour$caution->getLocation()->getEndAt())->format('%a') + 1;
  425.          
  426.          if ($datedif >= 15) {
  427.             $checkout_session $this->stripeConnectService->retrieveCheckoutSession($caution->getLocation()->getPayinId());
  428.             $payment_intent $this->stripeConnectService->retrievePaymentIntent($checkout_session->payment_intent);
  429.             $charge $this->stripeConnectService->retrieveLatestCharge($payment_intent->latest_charge);
  430.             $montant $caution->getMontant();
  431.             try {
  432.                $this->stripeConnectService->createChargeReversal($charge->id$montant 100);
  433.                $caution->setIsReturn(true);
  434.             } catch (\Throwable $th) {
  435.                $this->logger->error('Erreur lors du remboursement de la caution ID ' $caution->getId() . ' : ' $th->getMessage());
  436.                continue; // Passer à la caution suivante en cas d'erreur
  437.             }
  438.             $this->em->persist($caution);
  439.             $this->em->flush();
  440.          }
  441.       }
  442.    }
  443.    function getParticipantByRoom(Chambre $chambre)
  444.    {
  445.       $participant $chambre->getParticipant()->toArray();
  446.       // $participantByRoom = [];
  447.       // foreach ($participant as $key => $value) {
  448.       //     if ($value->getUserClient() == $user) {
  449.       //         $participantByRoom[] = $value;
  450.       //     }
  451.       // }
  452.       // return $participantByRoom;
  453.       return $participant;
  454.    }
  455.    public function geolocation($department)
  456.    {
  457.       $lat null;
  458.       $lng null;
  459.       if ($department) {
  460.          $address $department;
  461.          $prepAddr str_replace(' ''+'$address);
  462.          $url 'https://maps.googleapis.com/maps/api/geocode/json?address=' $prepAddr '&key=AIzaSyDEvz8MLiFhskwnuRnoZ-OR_ZOUS9ol3Bg';
  463.          $source file_get_contents($url);
  464.          $obj json_decode($source);
  465.          if ($obj->status == 'OK') {
  466.             $status $obj->status;
  467.             $lat $obj->results[0]->geometry->location->lat;
  468.             $lng $obj->results[0]->geometry->location->lng;
  469.          } else {
  470.             $lat 48.856614;
  471.             $lng 2.3522219;
  472.             $status $obj->status;
  473.          }
  474.       } else {
  475.          $address 'France';
  476.          $prepAddr str_replace(' ''+'$address);
  477.          $url 'https://maps.googleapis.com/maps/api/geocode/json?address=' $prepAddr '&key=AIzaSyDEvz8MLiFhskwnuRnoZ-OR_ZOUS9ol3Bg';
  478.          $source file_get_contents($url);
  479.          $obj json_decode($source);
  480.          if ($obj->status == 'OK') {
  481.             $status $obj->status;
  482.             $lat $obj->results[0]->geometry->location->lat;
  483.             $lng $obj->results[0]->geometry->location->lng;
  484.          } else {
  485.             $lat 48.856614;
  486.             $lng 2.3522219;
  487.             $status $obj->status;
  488.          }
  489.       }
  490.       $coordinates = [$lat$lng$status];
  491.       return $coordinates;
  492.    }
  493.    public function listecouleurs()
  494.    {
  495.       return $listes =
  496.          [
  497.             [
  498.                "name" => "Abricot"
  499.             ],
  500.             [
  501.                "name" => "Acajou"
  502.             ],
  503.             [
  504.                "name" => "Aigue-marine"
  505.             ],
  506.             [
  507.                "name" => "Alezan (chevaux)"
  508.             ],
  509.             [
  510.                "name" => "Amande"
  511.             ],
  512.             [
  513.                "name" => "Amarante"
  514.             ],
  515.             [
  516.                "name" => "Ambre"
  517.             ],
  518.             [
  519.                "name" => "Améthyste"
  520.             ],
  521.             [
  522.                "name" => "Anthracite"
  523.             ],
  524.             [
  525.                "name" => "Aquilain (chevaux)"
  526.             ],
  527.             [
  528.                "name" => "Ardoise"
  529.             ],
  530.             [
  531.                "name" => "Argent (héraldique)"
  532.             ],
  533.             [
  534.                "name" => "Aubergine"
  535.             ],
  536.             [
  537.                "name" => "Auburn (cheveux)"
  538.             ],
  539.             [
  540.                "name" => "Aurore"
  541.             ],
  542.             [
  543.                "name" => "Avocat"
  544.             ],
  545.             [
  546.                "name" => "Azur"
  547.             ],
  548.             [
  549.                "name" => "Azur (héraldique)"
  550.             ],
  551.             [
  552.                "name" => "Baillet (chevaux, vieilli)"
  553.             ],
  554.             [
  555.                "name" => "Basané (teint)"
  556.             ],
  557.             [
  558.                "name" => "Beige ou Bureau"
  559.             ],
  560.             [
  561.                "name" => "Beurre"
  562.             ],
  563.             [
  564.                "name" => "Bis"
  565.             ],
  566.             [
  567.                "name" => "Bisque"
  568.             ],
  569.             [
  570.                "name" => "Bistre"
  571.             ],
  572.             [
  573.                "name" => "Bitume (pigment)"
  574.             ],
  575.             [
  576.                "name" => "Blanc"
  577.             ],
  578.             [
  579.                "name" => "Blanc cassé"
  580.             ],
  581.             [
  582.                "name" => "Blanc lunaire"
  583.             ],
  584.             [
  585.                "name" => "Blé"
  586.             ],
  587.             [
  588.                "name" => "Bleu"
  589.             ],
  590.             [
  591.                "name" => "Bleu acier"
  592.             ],
  593.             [
  594.                "name" => "Bleu barbeau ou bleuet"
  595.             ],
  596.             [
  597.                "name" => "Bleu canard"
  598.             ],
  599.             [
  600.                "name" => "Bleu céleste"
  601.             ],
  602.             [
  603.                "name" => "Bleu charrette"
  604.             ],
  605.             [
  606.                "name" => "Bleu ciel"
  607.             ],
  608.             [
  609.                "name" => "Bleu de cobalt (pigment)"
  610.             ],
  611.             [
  612.                "name" => "Bleu de Prusse (pigment), de Berlin ou bleu hussard"
  613.             ],
  614.             [
  615.                "name" => "Bleu électrique"
  616.             ],
  617.             [
  618.                "name" => "Bleu givré"
  619.             ],
  620.             [
  621.                "name" => "Bleu Klein"
  622.             ],
  623.             [
  624.                "name" => "Bleu Majorelle"
  625.             ],
  626.             [
  627.                "name" => "Bleu marine"
  628.             ],
  629.             [
  630.                "name" => "Bleu nuit"
  631.             ],
  632.             [
  633.                "name" => "Bleu outremer"
  634.             ],
  635.             [
  636.                "name" => "Bleu paon"
  637.             ],
  638.             [
  639.                "name" => "Bleu Persan"
  640.             ],
  641.             [
  642.                "name" => "Bleu pétrole"
  643.             ],
  644.             [
  645.                "name" => "Bleu roi ou de France"
  646.             ],
  647.             [
  648.                "name" => "Bleu turquin"
  649.             ],
  650.             [
  651.                "name" => "Blond (cheveux)"
  652.             ],
  653.             [
  654.                "name" => "Blond vénitien (cheveux)"
  655.             ],
  656.             [
  657.                "name" => "Bordeaux"
  658.             ],
  659.             [
  660.                "name" => "Bouton d'or"
  661.             ],
  662.             [
  663.                "name" => "Brique"
  664.             ],
  665.             [
  666.                "name" => "Bronze"
  667.             ],
  668.             [
  669.                "name" => "Brou de noix"
  670.             ],
  671.             [
  672.                "name" => "Brun"
  673.             ],
  674.             [
  675.                "name" => "Caca d'oie"
  676.             ],
  677.             [
  678.                "name" => "Cacao"
  679.             ],
  680.             [
  681.                "name" => "Cachou (pigments)"
  682.             ],
  683.             [
  684.                "name" => "Cæruleum"
  685.             ],
  686.             [
  687.                "name" => "Café"
  688.             ],
  689.             [
  690.                "name" => "Café au lait"
  691.             ],
  692.             [
  693.                "name" => "Cannelle"
  694.             ],
  695.             [
  696.                "name" => "Capucine"
  697.             ],
  698.             [
  699.                "name" => "Caramel (pigments)"
  700.             ],
  701.             [
  702.                "name" => "Carmin (pigment)"
  703.             ],
  704.             [
  705.                "name" => "Carmin d'alizarine (pigment PR83)"
  706.             ],
  707.             [
  708.                "name" => "Carotte"
  709.             ],
  710.             [
  711.                "name" => "Chamois"
  712.             ],
  713.             [
  714.                "name" => "Chartreuse"
  715.             ],
  716.             [
  717.                "name" => "Châtain (cheveux)"
  718.             ],
  719.             [
  720.                "name" => "Chaudron"
  721.             ],
  722.             [
  723.                "name" => "Chocolat"
  724.             ],
  725.             [
  726.                "name" => "Cinabre (pigment)"
  727.             ],
  728.             [
  729.                "name" => "Citrouille"
  730.             ],
  731.             [
  732.                "name" => "Coquille d'œuf"
  733.             ],
  734.             [
  735.                "name" => "Corail"
  736.             ],
  737.             [
  738.                "name" => "Cramoisi"
  739.             ],
  740.             [
  741.                "name" => "Crème"
  742.             ],
  743.             [
  744.                "name" => "Cuisse de nymphe"
  745.             ],
  746.             [
  747.                "name" => "Cuivre"
  748.             ],
  749.             [
  750.                "name" => "Cyan"
  751.             ],
  752.             [
  753.                "name" => "Écarlate"
  754.             ],
  755.             [
  756.                "name" => "Écru"
  757.             ],
  758.             [
  759.                "name" => "Émeraude"
  760.             ],
  761.             [
  762.                "name" => "Fauve"
  763.             ],
  764.             [
  765.                "name" => "Flave"
  766.             ],
  767.             [
  768.                "name" => "Fraise"
  769.             ],
  770.             [
  771.                "name" => "Fraise écrasée"
  772.             ],
  773.             [
  774.                "name" => "Framboise"
  775.             ],
  776.             [
  777.                "name" => "Fuchsia"
  778.             ],
  779.             [
  780.                "name" => "Fumée"
  781.             ],
  782.             [
  783.                "name" => "Garance (pigment)"
  784.             ],
  785.             [
  786.                "name" => "Glauque"
  787.             ],
  788.             [
  789.                "name" => "Glycine"
  790.             ],
  791.             [
  792.                "name" => "Grège"
  793.             ],
  794.             [
  795.                "name" => "Grenadine"
  796.             ],
  797.             [
  798.                "name" => "Grenat"
  799.             ],
  800.             [
  801.                "name" => "Gris"
  802.             ],
  803.             [
  804.                "name" => "Gris acier"
  805.             ],
  806.             [
  807.                "name" => "Gris de Payne (mélange de pigments)"
  808.             ],
  809.             [
  810.                "name" => "Gris fer"
  811.             ],
  812.             [
  813.                "name" => "Gris perle"
  814.             ],
  815.             [
  816.                "name" => "Groseille"
  817.             ],
  818.             [
  819.                "name" => "Guède ou Pastel des teinturiers (pigment)"
  820.             ],
  821.             [
  822.                "name" => "Gueules (héraldique)"
  823.             ],
  824.             [
  825.                "name" => "Héliotrope"
  826.             ],
  827.             [
  828.                "name" => "Incarnat"
  829.             ],
  830.             [
  831.                "name" => "Indigo"
  832.             ],
  833.             [
  834.                "name" => "Indigo (teinture)"
  835.             ],
  836.             [
  837.                "name" => "Isabelle"
  838.             ],
  839.             [
  840.                "name" => "Ivoire"
  841.             ],
  842.             [
  843.                "name" => "Jaune"
  844.             ],
  845.             [
  846.                "name" => "Jaune canari"
  847.             ],
  848.             [
  849.                "name" => "Jaune citron"
  850.             ],
  851.             [
  852.                "name" => "Jaune d'or"
  853.             ],
  854.             [
  855.                "name" => "Jaune de cobalt ou auréolin (pigment)"
  856.             ],
  857.             [
  858.                "name" => "Jaune de Mars (pigment)"
  859.             ],
  860.             [
  861.                "name" => "Jaune de Naples (pigment)"
  862.             ],
  863.             [
  864.                "name" => "Jaune impérial"
  865.             ],
  866.             [
  867.                "name" => "Jaune mimosa"
  868.             ],
  869.             [
  870.                "name" => "Kaki"
  871.             ],
  872.             [
  873.                "name" => "Lapis-lazuli"
  874.             ],
  875.             [
  876.                "name" => "Lavallière (reliure)"
  877.             ],
  878.             [
  879.                "name" => "Lavande"
  880.             ],
  881.             [
  882.                "name" => "Lie de vin"
  883.             ],
  884.             [
  885.                "name" => "Lilas"
  886.             ],
  887.             [
  888.                "name" => "Lime ou vert citron"
  889.             ],
  890.             [
  891.                "name" => "Lin"
  892.             ],
  893.             [
  894.                "name" => "Magenta"
  895.             ],
  896.             [
  897.                "name" => "Maïs"
  898.             ],
  899.             [
  900.                "name" => "Malachite"
  901.             ],
  902.             [
  903.                "name" => "Mandarine"
  904.             ],
  905.             [
  906.                "name" => "Marron"
  907.             ],
  908.             [
  909.                "name" => "Mastic"
  910.             ],
  911.             [
  912.                "name" => "Mauve (couleur)"
  913.             ],
  914.             [
  915.                "name" => "Menthe"
  916.             ],
  917.             [
  918.                "name" => "Moutarde"
  919.             ],
  920.             [
  921.                "name" => "Nacarat"
  922.             ],
  923.             [
  924.                "name" => "Nankin"
  925.             ],
  926.             [
  927.                "name" => "Noir"
  928.             ],
  929.             [
  930.                "name" => "Noir animal (pigment)"
  931.             ],
  932.             [
  933.                "name" => "Noir d'aniline (pigment)"
  934.             ],
  935.             [
  936.                "name" => "Noir d'ivoire (pigment)"
  937.             ],
  938.             [
  939.                "name" => "Noir de carbone (pigment)"
  940.             ],
  941.             [
  942.                "name" => "Noir de fumée (pigment)"
  943.             ],
  944.             [
  945.                "name" => "Noisette"
  946.             ],
  947.             [
  948.                "name" => "Ocre (pigment)"
  949.             ],
  950.             [
  951.                "name" => "Ocre rouge (pigment)"
  952.             ],
  953.             [
  954.                "name" => "Olive"
  955.             ],
  956.             [
  957.                "name" => "Or"
  958.             ],
  959.             [
  960.                "name" => "Orange"
  961.             ],
  962.             [
  963.                "name" => "Orange brûlé"
  964.             ],
  965.             [
  966.                "name" => "Orchidée"
  967.             ],
  968.             [
  969.                "name" => "Orpiment (pigment)"
  970.             ],
  971.             [
  972.                "name" => "Paille"
  973.             ],
  974.             [
  975.                "name" => "Parme"
  976.             ],
  977.             [
  978.                "name" => "Pelure d'oignon (œnologie)"
  979.             ],
  980.             [
  981.                "name" => "Pervenche"
  982.             ],
  983.             [
  984.                "name" => "Pistache"
  985.             ],
  986.             [
  987.                "name" => "Poil de chameau"
  988.             ],
  989.             [
  990.                "name" => "Ponceau ou Coquelicot"
  991.             ],
  992.             [
  993.                "name" => "Pourpre (héraldique)"
  994.             ],
  995.             [
  996.                "name" => "Prasin"
  997.             ],
  998.             [
  999.                "name" => "Prune"
  1000.             ],
  1001.             [
  1002.                "name" => "Puce"
  1003.             ],
  1004.             [
  1005.                "name" => "Rose"
  1006.             ],
  1007.             [
  1008.                "name" => "Rose Mountbatten"
  1009.             ],
  1010.             [
  1011.                "name" => "Rouge"
  1012.             ],
  1013.             [
  1014.                "name" => "Rouge anglais"
  1015.             ],
  1016.             [
  1017.                "name" => "Rouge cardinal"
  1018.             ],
  1019.             [
  1020.                "name" => "Rouge cerise"
  1021.             ],
  1022.             [
  1023.                "name" => "Rouge d'Andrinople"
  1024.             ],
  1025.             [
  1026.                "name" => "Rouge de Falun (pigment)"
  1027.             ],
  1028.             [
  1029.                "name" => "Rouge feu"
  1030.             ],
  1031.             [
  1032.                "name" => "Rouge feu"
  1033.             ],
  1034.             [
  1035.                "name" => "Rouge sang"
  1036.             ],
  1037.             [
  1038.                "name" => "Rouge tomette"
  1039.             ],
  1040.             [
  1041.                "name" => "Rouille"
  1042.             ],
  1043.             [
  1044.                "name" => "Roux"
  1045.             ],
  1046.             [
  1047.                "name" => "Rubis"
  1048.             ],
  1049.             [
  1050.                "name" => "Sable"
  1051.             ],
  1052.             [
  1053.                "name" => "Sable (héraldique)"
  1054.             ],
  1055.             [
  1056.                "name" => "Safre"
  1057.             ],
  1058.             [
  1059.                "name" => "Sang de bœuf"
  1060.             ],
  1061.             [
  1062.                "name" => "Sanguine"
  1063.             ],
  1064.             [
  1065.                "name" => "Saphir"
  1066.             ],
  1067.             [
  1068.                "name" => "Sarcelle"
  1069.             ],
  1070.             [
  1071.                "name" => "Saumon"
  1072.             ],
  1073.             [
  1074.                "name" => "Sépia (pigment)"
  1075.             ],
  1076.             [
  1077.                "name" => "Sinople (héraldique)"
  1078.             ],
  1079.             [
  1080.                "name" => "Smalt (pigment)"
  1081.             ],
  1082.             [
  1083.                "name" => "Smaragdin (pigment)"
  1084.             ],
  1085.             [
  1086.                "name" => "Soufre"
  1087.             ],
  1088.             [
  1089.                "name" => "Souris"
  1090.             ],
  1091.             [
  1092.                "name" => "Tabac"
  1093.             ],
  1094.             [
  1095.                "name" => "Taupe"
  1096.             ],
  1097.             [
  1098.                "name" => "Terre d'ombre"
  1099.             ],
  1100.             [
  1101.                "name" => "Terre de Sienne (pigment)"
  1102.             ],
  1103.             [
  1104.                "name" => "Terre de Sienne brûlée (pigment)"
  1105.             ],
  1106.             [
  1107.                "name" => "Tomate"
  1108.             ],
  1109.             [
  1110.                "name" => "Topaze"
  1111.             ],
  1112.             [
  1113.                "name" => "Tourterelle ou Colombin"
  1114.             ],
  1115.             [
  1116.                "name" => "Turquoise"
  1117.             ],
  1118.             [
  1119.                "name" => "Vanille"
  1120.             ],
  1121.             [
  1122.                "name" => "Vermeil"
  1123.             ],
  1124.             [
  1125.                "name" => "Vermillon"
  1126.             ],
  1127.             [
  1128.                "name" => "Vert"
  1129.             ],
  1130.             [
  1131.                "name" => "Vert bouteille"
  1132.             ],
  1133.             [
  1134.                "name" => "Vert céladon"
  1135.             ],
  1136.             [
  1137.                "name" => "Vert d'eau"
  1138.             ],
  1139.             [
  1140.                "name" => "Vert de chrome"
  1141.             ],
  1142.             [
  1143.                "name" => "Vert de Hooker"
  1144.             ],
  1145.             [
  1146.                "name" => "Vert de vessie"
  1147.             ],
  1148.             [
  1149.                "name" => "Vert épinard"
  1150.             ],
  1151.             [
  1152.                "name" => "Vert impérial"
  1153.             ],
  1154.             [
  1155.                "name" => "Vert lichen"
  1156.             ],
  1157.             [
  1158.                "name" => "Vert perroquet"
  1159.             ],
  1160.             [
  1161.                "name" => "Vert poireau"
  1162.             ],
  1163.             [
  1164.                "name" => "Vert pomme"
  1165.             ],
  1166.             [
  1167.                "name" => "Vert prairie"
  1168.             ],
  1169.             [
  1170.                "name" => "Vert printemps"
  1171.             ],
  1172.             [
  1173.                "name" => "Vert sapin"
  1174.             ],
  1175.             [
  1176.                "name" => "Vert sauge"
  1177.             ],
  1178.             [
  1179.                "name" => "Vert tilleul"
  1180.             ],
  1181.             [
  1182.                "name" => "Vert Véronèse (pigment)"
  1183.             ],
  1184.             [
  1185.                "name" => "Vert-de-gris (pigment)"
  1186.             ],
  1187.             [
  1188.                "name" => "Vert-jaune"
  1189.             ],
  1190.             [
  1191.                "name" => "Violet"
  1192.             ],
  1193.             [
  1194.                "name" => "Violet d'évêque"
  1195.             ],
  1196.             [
  1197.                "name" => "Violine (pigment)"
  1198.             ],
  1199.             [
  1200.                "name" => "Viride (pigment)"
  1201.             ],
  1202.             [
  1203.                "name" => "Zinzolin"
  1204.             ]
  1205.          ];
  1206.    }
  1207. }