src/Entity/Vehicle.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VehicleRepository;
  4. use App\Validator\VehicleUniqueRegistrationNumber;
  5. use App\Validator\VehicleUniqueSerialNumber;
  6. use DateTime;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  11. use Symfony\Component\HttpFoundation\File\File;
  12. use Symfony\Component\HttpFoundation\File\UploadedFile;
  13. use Symfony\Component\Validator\Constraints as Assert;
  14. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  15. /**
  16.  * @Vich\Uploadable
  17.  */
  18. #[ORM\Entity(repositoryClassVehicleRepository::class)]
  19. #[ORM\Table(name'vehicle')]
  20. #[UniqueEntity(fields: ['serial'], message'Ce numéro de série est déjà utilisé')]
  21. class Vehicle implements UserObjectInterface
  22. {
  23.     public const OTHER 'AUTRE';
  24.     public $expressStep;
  25.     public $expressOwner;
  26.     #[ORM\OneToMany(targetEntity"App\Entity\ComplaintX"mappedBy"vehicle")]
  27.     private Collection|array $complaintXs;
  28.     #[ORM\OneToMany(targetEntity"App\Entity\DisasterDeclaration"mappedBy"vehicle"cascade: ["remove"])]
  29.     #[ORM\JoinColumn(nullabletrue)]
  30.     private Collection|array $vehicle;
  31.     #[ORM\Column(name"createdAt"type"datetime")]
  32.     private DateTime $createdAt;
  33.     #[ORM\Column(type"boolean")]
  34.     private bool $isDeleted false;
  35.     #[ORM\Column(name"id"type"integer")]
  36.     #[ORM\Id]
  37.     #[ORM\GeneratedValue(strategy"AUTO")]
  38.     private ?int $id null;
  39.     #[ORM\OneToMany(targetEntity"App\Entity\Insurance"mappedBy"vehicle"cascade: ["persist""remove"])]
  40.     private Collection|array $insurances;
  41.     #[ORM\OneToMany(targetEntity"App\Entity\ArchiveComplaint"mappedBy"vehicle"cascade: ["persist""remove"])]
  42.     private Collection|array $archiveComplaints;
  43.     #[ORM\OneToMany(targetEntity"App\Entity\VehicleTheft"mappedBy"vehicle"cascade: ["persist""remove"])]
  44.     private Collection|array $theft;
  45.     #[ORM\OneToMany(targetEntity"App\Entity\VehiclePhoto"mappedBy"vehicle"cascade: ["persist""remove"])]
  46.     private Collection|array $vehiclePhotos;
  47.     #[ORM\ManyToOne(targetEntity"App\Entity\User"inversedBy"vehicles")]
  48.     #[ORM\JoinColumn(nullablefalse)]
  49.     private User $user;
  50.     #[Assert\Choice(callback"getStatuts"multiplefalse)]
  51.     #[ORM\Column(name"statut"type"string"length255nullabletrue)]
  52.     private string $statut "Ok";
  53.     #[ORM\Column(type"string"length255nullabletrue)]
  54.     private ?string $photosCoverId null;
  55.     #[ORM\Column(type"boolean")]
  56.     private bool $hasPhotosCover false;
  57.     #[Assert\NotBlank(message'Ce champ est obligatoire')]
  58.     #[Assert\Choice(callback"getTypes"multiplefalse)]
  59.     #[ORM\Column(type"string"length255nullabletrue)]
  60.     private ?string $type null;
  61.     #[ORM\Column(name"otherTypeName"type"string"length255nullabletrue)]
  62.     private ?string $otherTypeName null;
  63.     #[ORM\Column(name"serial"type"string"length255uniquetruenullabletrue)]
  64.     #[VehicleUniqueSerialNumber(
  65.         groups: ['vehicle:space']
  66.     )]
  67.     private ?string $serial null;
  68.     #[Assert\NotBlank(message'Ce champ est obligatoire')]
  69.     #[ORM\Column(name"registrationNumber"type"string"length255uniquetrue)]
  70.     #[VehicleUniqueRegistrationNumber(
  71.         groups: ['vehicle:space']
  72.     )]
  73.     private ?string $registrationNumber null;
  74.     #[Assert\NotBlank(message'Ce champ est obligatoire')]
  75.     #[ORM\Column(name"brand"type"string"length255)]
  76.     private string $brand '';
  77.     #[ORM\Column(name"businessModel"type"string"length255nullabletrue)]
  78.     private ?string $businessModel null;
  79.     #[Assert\Choice(callback"getCivilitys"multiplefalsegroups: ['vehicle:space'])]
  80.     #[ORM\Column(type"string"length255nullabletrue)]
  81.     private ?string $civility null;
  82.     #[ORM\Column(name"serialNumber"type"string"length255nullabletrue)]
  83.     private string $serialNumber;
  84.     /**
  85.      * @Vich\UploadableField(mapping="vehiclePhoto", fileNameProperty="vehiclePhotoFileName", size="vehiclePhotoFileSize")
  86.      */
  87.     private ?File $vehiclePhotoFile null;
  88.     #[ORM\Column(type"string"length255nullabletrue)]
  89.     private ?string $vehiclePhotoFileName null;
  90.     #[ORM\Column(type"integer"nullabletrue)]
  91.     private ?int $vehiclePhotoFileSize;
  92.     #[ORM\Column(type"datetime"nullabletrue)]
  93.     private ?DateTime $vehiclePhotoFileUpdatedAt;
  94.     /**
  95.      * @Vich\UploadableField(mapping="vehicleDocumentation", fileNameProperty="vehicleDocumentationFileName", size="vehicleDocumentationFileSize")
  96.      */
  97.     private ?File $vehicleDocumentationFile null;
  98.     #[ORM\Column(type"string"length255nullabletrue)]
  99.     private ?string $vehicleDocumentationFileName null;
  100.     #[ORM\Column(type"integer"nullabletrue)]
  101.     private ?int $vehicleDocumentationFileSize;
  102.     #[ORM\Column(type"datetime"nullabletrue)]
  103.     private ?DateTime $vehicleDocumentationFileUpdatedAt;
  104.     #[ORM\Column(nullabletrue)]
  105.     private ?bool $isRestored null;
  106.     #[ORM\Column(nullabletrue)]
  107.     private ?bool $isCompensated null;
  108.     /**
  109.      * Constructor
  110.      */
  111.     public function __construct()
  112.     {
  113.         $this->insurances = new ArrayCollection();
  114.         $this->vehiclePhotos = new ArrayCollection();
  115.         $this->createdAt = new DateTime();
  116.     }
  117.     public static function getStatuts()
  118.     {
  119.         $arr = [
  120.             "Ok",
  121.             "Perdu",
  122.             "Volé",
  123.             "Détruit",
  124.             "Vendu",
  125.             "Donné",
  126.         ];
  127.         return array_combine($arr$arr);
  128.     }
  129.     public static function getTypes()
  130.     {
  131.         $arr = [
  132.             "VOITURE" => "voiture",
  133.             "MOTO" => "moto",
  134.             "CAMION" => "camion",
  135.             "UTILITAIRE" => "utilitaire",
  136.             "CAMPING CAR" => "campingcar",
  137.             "CARAVANE" => "caravane",
  138.             "REMORQUE" => "remorque",
  139.             "QUAD" => "quad",
  140.             "CYCLOMOTEUR" => "cyclomoteur",
  141.             "SCOOTER" => "scooter",
  142.         ];
  143.         return $arr;
  144.     }
  145.     public static function getBrands($type null$withOther null): array
  146.     {
  147.         $arr = [];
  148.         if ($type == "null") {
  149.             $arr['Veuillez choisir un type'] = "0";
  150.         } else {
  151.             switch ($type) {
  152.                 case 'voiture':
  153.                     $arr = [
  154.                         'ABARTH',
  155.                         'AC',
  156.                         'ACURA',
  157.                         'AIXAM',
  158.                         'ALFA ROMEO',
  159.                         'ALKE',
  160.                         'ALLARD',
  161.                         'ALPINA',
  162.                         'ALPINE',
  163.                         'ALVIS',
  164.                         'AMC',
  165.                         'AMILCAR',
  166.                         'ARIEL',
  167.                         'ARO',
  168.                         'ASHOK LEYLAND',
  169.                         'ASTON MARTIN',
  170.                         'AUBURN',
  171.                         'AUDI',
  172.                         'AUSTIN',
  173.                         'AUSTIN HEALEY',
  174.                         'AUTO UNION',
  175.                         'AUTOBIANCHI',
  176.                         'AVTOGAZ',
  177.                         'AVTOVAZ',
  178.                         'BELLIER',
  179.                         'BENTLEY',
  180.                         'BMW',
  181.                         'BOLLORE',
  182.                         'BUGATTI',
  183.                         'BUICK',
  184.                         'CADILLAC',
  185.                         'CASALINI',
  186.                         'CATERHAM',
  187.                         'CHATENET',
  188.                         'CHAUSSON',
  189.                         'CHENARD ET WALCKER',
  190.                         'CHEVROLET',
  191.                         'CHRYSLER',
  192.                         'CITROËN',
  193.                         'DACIA',
  194.                         'DAEWOO',
  195.                         'DAIHATSU',
  196.                         'DATSUN',
  197.                         'DE DION-BOUTON',
  198.                         'DE TOMASO',
  199.                         'DELAGE',
  200.                         'DELAHAYE',
  201.                         'DELOREAN',
  202.                         'DODGE',
  203.                         'DONKERVOORT',
  204.                         'DS',
  205.                         'DUE',
  206.                         'EXAGON',
  207.                         'EXCALIBUR',
  208.                         'FACEL VEGA',
  209.                         'FERRARI',
  210.                         'FIAT',
  211.                         'FISKER',
  212.                         'FORD',
  213.                         'FORD MUSTANG',
  214.                         'FUSO',
  215.                         'GAZ',
  216.                         'GINETTA',
  217.                         'GMC',
  218.                         'GRECAV',
  219.                         'GUMPERT',
  220.                         'HOMMELL',
  221.                         'HONDA',
  222.                         'HORCH',
  223.                         'HUMMER',
  224.                         'HYUNDAI',
  225.                         'INFINITI',
  226.                         'INNOCENTI',
  227.                         'ISUZU',
  228.                         'IVECO',
  229.                         'JAGUAR',
  230.                         'JDM SIMPA',
  231.                         'JEEP',
  232.                         'KIA',
  233.                         'KOENIGSEGG',
  234.                         'KTM',
  235.                         'LADA',
  236.                         'LAMBORGHINI',
  237.                         'LANCIA',
  238.                         'LAND ROVER',
  239.                         'LEXUS',
  240.                         'LIGIER',
  241.                         'LINCOLN',
  242.                         'LOTUS',
  243.                         'MASERATI',
  244.                         'MATRA',
  245.                         'MAYBACH',
  246.                         'MAZDA',
  247.                         'MCLAREN',
  248.                         'MEGA',
  249.                         'MERCEDES-BENZ',
  250.                         'MG',
  251.                         'MIA ELECTRIC',
  252.                         'MINI',
  253.                         'MITSUBISHI',
  254.                         'MITSUOKA',
  255.                         'MORGAN',
  256.                         'MORRIS',
  257.                         'NASH',
  258.                         'NECKAR',
  259.                         'NISSAN',
  260.                         'NOBLE',
  261.                         'NSU',
  262.                         'OLDSMOBILE',
  263.                         'OPEL',
  264.                         'PACKARD',
  265.                         'PAGANI',
  266.                         'PANHARD',
  267.                         'PANOZ',
  268.                         'PANTHER',
  269.                         'PEUGEOT',
  270.                         'PGO',
  271.                         'PLYMOUTH',
  272.                         'PONTIAC',
  273.                         'PORSCHE',
  274.                         'RADICAL',
  275.                         'RENAULT',
  276.                         'RILEY',
  277.                         'ROLLS-ROYCE',
  278.                         'ROVER',
  279.                         'SAAB',
  280.                         'SALEEN',
  281.                         'SANTANA',
  282.                         'SEAT',
  283.                         'SECMA',
  284.                         'SHELBY',
  285.                         'SIMCA',
  286.                         'SKODA',
  287.                         'SMART',
  288.                         'SSANGYONG',
  289.                         'STUDEBAKER',
  290.                         'SUBARU',
  291.                         'SUZUKI',
  292.                         'TALBOT',
  293.                         'TAZZARI',
  294.                         'TESLA MOTORS',
  295.                         'TOYOTA',
  296.                         'TVR',
  297.                         'ULTIMA',
  298.                         'VAZ',
  299.                         'VECTOR',
  300.                         'VENTURI',
  301.                         'VOLKSWAGEN',
  302.                         'VOLVO',
  303.                         'WIESMANN',
  304.                         'ZENVO'
  305.                     ];
  306.                     break;
  307.                 case 'moto':
  308.                     $arr = [
  309.                         'AGUSTA',
  310.                         'APRILIA',
  311.                         'BEELINE',
  312.                         'BENELLI',
  313.                         'BETA',
  314.                         'BIMOTA',
  315.                         'BLATA',
  316.                         'BMW',
  317.                         'BUELL',
  318.                         'CAGIVA',
  319.                         'CLIPIC',
  320.                         'DAELIM',
  321.                         'DERBI',
  322.                         'DUCATI',
  323.                         'FANTIC MOTOR',
  324.                         'GAS-GAS',
  325.                         'GENERIC',
  326.                         'GIANTCO',
  327.                         'GILERA',
  328.                         'GOWINN',
  329.                         'HARLEY-DAVIDSON',
  330.                         'HONDA',
  331.                         'HUSABERG',
  332.                         'HUSQVARNA',
  333.                         'HYOSUNG',
  334.                         'ITALJET',
  335.                         'KAWASAKI',
  336.                         'KEEWAY',
  337.                         'KREIDLER',
  338.                         'KTM',
  339.                         'KYMCO',
  340.                         'LAMBRETTA',
  341.                         'LAVERD',
  342.                         'LEONART',
  343.                         'LML',
  344.                         'MALAGUTI',
  345.                         'MBK',
  346.                         'MEGELLI',
  347.                         'MORINI',
  348.                         'MOTO GUZZI',
  349.                         'MZ',
  350.                         'NORTON',
  351.                         'OSSA',
  352.                         'PEUGEOT',
  353.                         'PGO',
  354.                         'PIAGGIO',
  355.                         'POLINI',
  356.                         'QWIC',
  357.                         'RIEJU',
  358.                         'ROYAL ENFIELD',
  359.                         'SCORPA',
  360.                         'SHERCO',
  361.                         'SKYTEAM',
  362.                         'SOLEX',
  363.                         'SUZUKI',
  364.                         'SYM',
  365.                         'TGB',
  366.                         'TOMOS',
  367.                         'TRIUMPH',
  368.                         'VECTRIX',
  369.                         'VESPA',
  370.                         'VICTORY',
  371.                         'YAMAHA',
  372.                         'ZERO MOTORCYCLE'
  373.                     ];
  374.                     break;
  375.                 case 'camion':
  376.                     $arr = [
  377.                         'DAF',
  378.                         'IVECO',
  379.                         'KENWORTH TRUCKS',
  380.                         'MAN',
  381.                         'MAZ',
  382.                         'MERCEDES',
  383.                         'RENAULT',
  384.                         'SCANIA',
  385.                         'VOLVO'
  386.                     ];
  387.                     break;
  388.                 case 'utilitaire':
  389.                     $arr = [
  390.                         'CITROËN',
  391.                         'FIAT',
  392.                         'FORD',
  393.                         'IVECO',
  394.                         'MERCEDES',
  395.                         'MITSUBISHI',
  396.                         'NISSAN',
  397.                         'OPEL',
  398.                         'PEUGEOT',
  399.                         'TOYOTA',
  400.                         'VOLKSWAGEN',
  401.                         'DACIA',
  402.                         'DAF',
  403.                         'DODGE',
  404.                         'FRUEHAUF',
  405.                         'FUSO',
  406.                         'GENERAL TRAILER',
  407.                         'GMC',
  408.                         'HYUNDAI',
  409.                         'ISUZU',
  410.                         'KIA',
  411.                         'MAN',
  412.                         'MITSUBISHI',
  413.                         'OPEL',
  414.                         'PIAGGIO',
  415.                         'RENAULT ',
  416.                         'SCANIA',
  417.                         'SEAT',
  418.                         'STEYR PUCH',
  419.                         'VOLVO'
  420.                     ];
  421.                     break;
  422.                 case 'campingcar':
  423.                     $arr = [
  424.                         '3C CARTIER / BRISEBRAS',
  425.                         'ADRIA',
  426.                         'ALCAR',
  427.                         'ALPES CAMPING CAR',
  428.                         'ARMORIQUE VAN',
  429.                         'ATC 64',
  430.                         'AUTOSTAR',
  431.                         'BAJETTO',
  432.                         'BAVARIA',
  433.                         'BBS LOISIRS',
  434.                         'BENIMAR',
  435.                         'BLUCAMP',
  436.                         'BRAVIA',
  437.                         'BURSTNER',
  438.                         'BÜRSTNER',
  439.                         'CAMPEREVE',
  440.                         'CAMPERVANS MONT-BLANC',
  441.                         'CAMPING-CARS LIGERIENS',
  442.                         'CAMPSTER',
  443.                         'CARADO',
  444.                         'CARTHAGO',
  445.                         'CHALLENGER',
  446.                         'CHAUSSON',
  447.                         'CI',
  448.                         'CONCEPT VAN LOISIR',
  449.                         'CONCORDE',
  450.                         'CREA VAN 85',
  451.                         'CS REISEMOBILE',
  452.                         'CUSTO VAN',
  453.                         'DETHLEFFS',
  454.                         'DREAMER',
  455.                         'ELIOS',
  456.                         'ETRUSCO',
  457.                         'EURA MOBIL',
  458.                         'EVASION 24',
  459.                         'FLEURETTE',
  460.                         'FLORIUM',
  461.                         'FONT VENDOME',
  462.                         'FONT VENDOME',
  463.                         'FRANKIA',
  464.                         'GIOTTILINE',
  465.                         'GLENAN CONCEPT CARS',
  466.                         'GLOBE CAMPER',
  467.                         'GLOBECAR',
  468.                         'HANROAD',
  469.                         'HOBBY',
  470.                         'HYMER',
  471.                         'HYMERCAR',
  472.                         'IROISE FOURGONS AMENAGES',
  473.                         'ISERE EVASION',
  474.                         'ITINEO',
  475.                         'JCG CREATIONS',
  476.                         'KARMANN-MOBIL',
  477.                         'KNAUS',
  478.                         'LA STRADA',
  479.                         'LAIKA',
  480.                         'LANDO',
  481.                         'LE VOYAGEUR',
  482.                         'LMC',
  483.                         'LOISIRS 12',
  484.                         'LUNAR',
  485.                         'MAKE MY VAN',
  486.                         'MALIBU',
  487.                         'MC LOUIS',
  488.                         'MCC',
  489.                         'MERCEDES',
  490.                         'MGP VEHICULES RECREATIFS',
  491.                         'MOBILVETTA DESIGN',
  492.                         'MORELO',
  493.                         'NIESMANN + BISCHOFF',
  494.                         'NOMAD ADDICT',
  495.                         'NOTIN',
  496.                         'OUEST CARAVANING',
  497.                         'PHOENIX',
  498.                         'PILOTE',
  499.                         'PLA',
  500.                         'PÖSSL',
  501.                         'R’CAM',
  502.                         'RANDGER',
  503.                         'RAPIDO',
  504.                         'REIMO / ECO CAMPERS',
  505.                         'RIMOR',
  506.                         'ROADCAR',
  507.                         'ROLLER TEAM',
  508.                         'SAVIGNAT-ROCHE',
  509.                         'STX',
  510.                         'STYLEVAN',
  511.                         'SUNLIGHT',
  512.                         'TECHNIC CAR 49',
  513.                         'VAN LOISIRS',
  514.                         'VOLKSWAGEN',
  515.                         'WEINSBERG',
  516.                         'WESTFALIA',
  517.                         'WINGAMM'
  518.                     ];
  519.                     break;
  520.                 case 'caravane':
  521.                     $arr = [
  522.                         'ACE',
  523.                         'AIRSTREAM',
  524.                         'ALINER',
  525.                         'AVENTO',
  526.                         'BAILEY',
  527.                         'BASOGLU',
  528.                         'BIGFOOT',
  529.                         'BIOD',
  530.                         'BÜRSTNER',
  531.                         'CARADO',
  532.                         'CARAVELAIR',
  533.                         'CARLIGHT',
  534.                         'COACHMEN RV',
  535.                         'ELDDIS',
  536.                         'ERIBA',
  537.                         'FENDT',
  538.                         'HOBBY',
  539.                         'HOMESTAR',
  540.                         'HYMER',
  541.                         'KABE',
  542.                         'KNAUS',
  543.                         'LMC ',
  544.                         'RACLET',
  545.                         'STERCKEMAN',
  546.                         'SUBLIM',
  547.                         'SUNLIGHT',
  548.                         'T.E.C. CARAVANS',
  549.                         'TABBERT',
  550.                         'WEINSBERG'
  551.                     ];
  552.                     break;
  553.                 case 'remorque':
  554.                     $arr = [
  555.                         'AL-KO',
  556.                         'BIG-FIC',
  557.                         'BPW',
  558.                         'CHEVAL LIBERTE',
  559.                         'DEBON',
  560.                         'DROTECH',
  561.                         'DUVAL',
  562.                         'ECIM',
  563.                         'EDUARD',
  564.                         'GKN',
  565.                         'GOLIATH',
  566.                         'HUMBAUR',
  567.                         'IFOR WILLIAMS',
  568.                         'JALON',
  569.                         'KNOTT',
  570.                         'LIDER',
  571.                         'MAITRE SIGNALISATION',
  572.                         'MECANOREM',
  573.                         'NOVAL',
  574.                         'PAILLARD',
  575.                         'PAM',
  576.                         'RADEX',
  577.                         'REMCENTER',
  578.                         'RTN',
  579.                         'SARIS',
  580.                         'SATELLITE',
  581.                         'SOREL',
  582.                         'SUN WAY',
  583.                         'TRIGANO'
  584.                     ];
  585.                     break;
  586.                 case 'quad':
  587.                     $arr = [
  588.                         'ADLY',
  589.                         'AEON',
  590.                         'ARCTIC CAT',
  591.                         'AXR',
  592.                         'AXROAD',
  593.                         'BAROSSA',
  594.                         'BEYOND',
  595.                         'BOMBARDIER',
  596.                         'CAN AM',
  597.                         'DINLI',
  598.                         'E-TON',
  599.                         'FOX',
  600.                         'GAS-GAS',
  601.                         'GOES',
  602.                         'HONDA',
  603.                         'HYTRACK',
  604.                         'JIANSHE',
  605.                         'KAWASAKI',
  606.                         'KL',
  607.                         'KYMCO',
  608.                         'LIGIER',
  609.                         'LINHAI',
  610.                         'LONCIN',
  611.                         'M FERGUSON',
  612.                         'MASAI',
  613.                         'MINIBIKE',
  614.                         'MINICO',
  615.                         'MOTORTEK',
  616.                         'PGO',
  617.                         'POLARIS',
  618.                         'ROXON',
  619.                         'SECMA',
  620.                         'SMC',
  621.                         'SUMO MOTOR',
  622.                         'SUZUKI',
  623.                         'SYM',
  624.                         'TGB',
  625.                         'TRITON',
  626.                         'VLS',
  627.                         'YAMAHA'
  628.                     ];
  629.                     break;
  630.                 case 'bateau':
  631.                     $arr = [
  632.                         'ACROPLAST',
  633.                         'AIRON',
  634.                         'AL DHAEN CRAFT',
  635.                         'ALLIAURA MARINE',
  636.                         'ALLURE YACHTING',
  637.                         'APREAMARE',
  638.                         'AQUAD',
  639.                         'AQUAMAR',
  640.                         'ARC-EYRE',
  641.                         'ARCOA',
  642.                         'ARVOR',
  643.                         'ASTONDOA',
  644.                         'ATLANTICO',
  645.                         'ATLANTIS',
  646.                         'AXIS',
  647.                         'AZIMUT',
  648.                         'B2 MARINE',
  649.                         'BAHAMA',
  650.                         'BAVARIA',
  651.                         'BAYLINER',
  652.                         'BEACHER',
  653.                         'BENETEAU',
  654.                         'BERTRAM',
  655.                         'BLACK PEPPER',
  656.                         'BORD A BORD',
  657.                         'CHANTIER NAVAL COUACH',
  658.                         'ESTOU',
  659.                         'FEELING',
  660.                         'GIB’SEA',
  661.                         'GUYMARINE',
  662.                         'JEANNEAU',
  663.                         'MULTIPLAST',
  664.                         'OCQUETEAU',
  665.                         'PLASTIMO MARINE',
  666.                         'SILLINGER',
  667.                         'ZEPPELIN',
  668.                         'ZODIAC'
  669.                     ];
  670.                     break;
  671.                 case 'cyclomoteur':
  672.                     $arr = [
  673.                         'APRILIA',
  674.                         'BETA',
  675.                         'DERBI',
  676.                         'DIP',
  677.                         'GILERA',
  678.                         'HONDA',
  679.                         'KEEWAY',
  680.                         'KYMCO',
  681.                         'MALAGUTI',
  682.                         'MBK',
  683.                         'PEUGEOT',
  684.                         'PGO',
  685.                         'PIAGGIO',
  686.                         'SUZUKI',
  687.                         'SYM',
  688.                         'YAMAHA'
  689.                     ];
  690.                     break;
  691.                 case 'scooter':
  692.                     $arr = [
  693.                         'APRILIA',
  694.                         'BENELLI',
  695.                         'CPI',
  696.                         'DERBI',
  697.                         'GILERA',
  698.                         'HONDA',
  699.                         'KYMCO',
  700.                         'MALAGUTI',
  701.                         'MBK',
  702.                         'PEUGEOT',
  703.                         'PIAGGIO',
  704.                         'SUZUKI',
  705.                         'SYM',
  706.                         'YAMAHA'
  707.                     ];
  708.                     break;
  709.             }
  710.         }
  711.         if ($withOther) {
  712.             $arr array_merge($arr, [
  713.                 $withOther,
  714.             ]);
  715.         }
  716.         $arr array_combine($arr$arr);
  717.         asort($arr);
  718.         return count($arr) > array_merge($arr, [
  719.             self::OTHER => self::OTHER,
  720.         ]) : $arr;
  721.     }
  722.     public static function getBrandsForSearch(): array
  723.     {
  724.         $arr = [
  725.             'ABARTH',
  726.             'ADRIA',
  727.             'AGUSTA',
  728.             'AIRSTREAM',
  729.             'AIXAM',
  730.             'ALFA ROMEO',
  731.             'ALPINA',
  732.             'ALPINE',
  733.             'APRILIA',
  734.             'ARCTIC CAT',
  735.             'ASTON MARTIN',
  736.             'AUDI',
  737.             'AUSTIN',
  738.             'AUSTIN HEALEY',
  739.             'AUTOBIANCHI',
  740.             'AUTOSTAR',
  741.             'BAVARIA',
  742.             'BENELLI',
  743.             'BENTLEY',
  744.             'BIMOTA',
  745.             'BMW',
  746.             'BOLLORE',
  747.             'BOMBARDIER',
  748.             'BUGATTI',
  749.             'BUICK',
  750.             'CADILLAC',
  751.             'CAGIVA',
  752.             'CARAVELAIR',
  753.             'CATERHAM',
  754.             'CHALLENGER',
  755.             'CHAUSSON',
  756.             'CHEVROLET',
  757.             'CHRYSLER',
  758.             'CITROËN',
  759.             'DACIA',
  760.             'DAEWOO',
  761.             'DAF',
  762.             'DAIHATSU',
  763.             'DATSUN',
  764.             'DERBI',
  765.             'DODGE',
  766.             'DS',
  767.             'DUCATI',
  768.             'FANTIC MOTOR',
  769.             'FERRARI',
  770.             'FIAT',
  771.             'FORD',
  772.             'FRUEHAUF',
  773.             'GILERA',
  774.             'GINETTA',
  775.             'GMC',
  776.             'HARLEY-DAVIDSON',
  777.             'HONDA',
  778.             'HUMMER',
  779.             'HUSQVARNA',
  780.             'HYMER',
  781.             'HYUNDAI',
  782.             'INFINITI',
  783.             'INNOCENTI',
  784.             'ISUZU',
  785.             'IVECO',
  786.             'JAGUAR',
  787.             'JEEP',
  788.             'KARMANN-MOBIL',
  789.             'KAWASAKI',
  790.             'KENWORTH TRUCKS',
  791.             'KIA',
  792.             'KTM',
  793.             'KYMCO',
  794.             'LADA',
  795.             'LAMBORGHINI',
  796.             'LAMBRETTA',
  797.             'LANCIA',
  798.             'LAND ROVER',
  799.             'LAVERDA',
  800.             'LEXUS',
  801.             'LIGIER',
  802.             'LOTUS',
  803.             'MALAGUTI',
  804.             'MAN',
  805.             'MASERATI',
  806.             'MATRA',
  807.             'MAYBACH',
  808.             'MAZDA',
  809.             'MBK',
  810.             'MCLAREN',
  811.             'MECANOREM',
  812.             'MERCEDES',
  813.             'MERCEDES-BENZ',
  814.             'MG',
  815.             'MINI',
  816.             'MITSUBISHI',
  817.             'MORGAN',
  818.             'MORINI',
  819.             'MORRIS',
  820.             'MOTO GUZZI',
  821.             'MZ',
  822.             'NISSAN',
  823.             'NORTON',
  824.             'NOVAL',
  825.             'OLDSMOBILE',
  826.             'OPEL',
  827.             'OSSA',
  828.             'PANHARD',
  829.             'PEUGEOT',
  830.             'PGO',
  831.             'PHOENIX',
  832.             'PIAGGIO',
  833.             'PILOTE',
  834.             'PLYMOUTH',
  835.             'POLARIS',
  836.             'PONTIAC',
  837.             'PORSCHE',
  838.             'RAPIDO',
  839.             'RENAULT',
  840.             'ROLLS-ROYCE',
  841.             'ROVER',
  842.             'ROYAL ENFIELD',
  843.             'SAAB',
  844.             'SANTANA',
  845.             'SATELLITE',
  846.             'SCANIA',
  847.             'SEAT',
  848.             'SIMCA',
  849.             'SKODA',
  850.             'SMART',
  851.             'SOLEX',
  852.             'STERCKEMAN',
  853.             'SUBARU',
  854.             'SUZUKI',
  855.             'TALBOT',
  856.             'TESLA MOTORS',
  857.             'TOYOTA',
  858.             'TRIGANO',
  859.             'TRIUMPH',
  860.             'TVR',
  861.             'VESPA',
  862.             'VOLKSWAGEN',
  863.             'VOLVO',
  864.             'WEINSBERG',
  865.             'WESTFALIA',
  866.             'YAMAHA'
  867.         ];
  868.         return array_combine($arr$arr);
  869.     }
  870.     public static function getCivilitys(?string $civility null)
  871.     {
  872.         $arr = [
  873.             "Moi uniquement" => "mine",
  874.             "Moi et mon époux(se)" => "both",
  875.             "Moi et une autre personne" => "other",
  876.             "Moi et plusieurs personnes" => "others",
  877.             "Moi et une société de financement" => "financialCompany",
  878.         ];
  879.         return $arr;
  880.     }
  881.     /**
  882.      * Get vehiclePhotosCover.
  883.      *
  884.      * @return string|null
  885.      */
  886.     public function getPhotosCoverId()
  887.     {
  888.         return $this->photosCoverId;
  889.     }
  890.     /**
  891.      * Set photosCoverId.
  892.      *
  893.      * @param string|null $photosCoverId
  894.      *
  895.      * @return Vehicle
  896.      */
  897.     public function setPhotosCoverId($photosCoverId null)
  898.     {
  899.         $this->photosCoverId $photosCoverId;
  900.         return $this;
  901.     }
  902.     /**
  903.      * Get hasPhotosCover
  904.      *
  905.      * @return boolean
  906.      */
  907.     public function getHasPhotosCover()
  908.     {
  909.         return $this->hasPhotosCover;
  910.     }
  911.     /**
  912.      * Set hasPhotosCover
  913.      *
  914.      * @param boolean $hasPhotosCover
  915.      *
  916.      * @return Vehicle
  917.      */
  918.     public function setHasPhotosCover($hasPhotosCover)
  919.     {
  920.         $this->hasPhotosCover $hasPhotosCover;
  921.         return $this;
  922.     }
  923.     public function __toString()
  924.     {
  925.         return "#" $this->id " - " $this->createdAt->format("d/m/Y H:i");
  926.     }
  927.     public function getVehicleDocumentationFile()
  928.     {
  929.         return $this->vehicleDocumentationFile;
  930.     }
  931.     /**
  932.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  933.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  934.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  935.      * must be able to accept an instance of 'File' as the bundle will inject one here
  936.      * during Doctrine hydration.
  937.      *
  938.      * @param File|UploadedFile $image
  939.      */
  940.     public function setVehicleDocumentationFile(File $image null)
  941.     {
  942.         $this->vehicleDocumentationFile $image;
  943.         if (null !== $image) {
  944.             // It is required that at least one field changes if you are using doctrine
  945.             // otherwise the event listeners won't be called and the file is lost
  946.             $this->vehicleDocumentationFileUpdatedAt = new DateTime();
  947.         }
  948.     }
  949.     /**
  950.      * Get id
  951.      *
  952.      * @return int
  953.      */
  954.     public function getId()
  955.     {
  956.         return $this->id;
  957.     }
  958.     /**
  959.      * Get type
  960.      *
  961.      * @return string
  962.      */
  963.     public function getType()
  964.     {
  965.         return $this->type;
  966.     }
  967.     /**
  968.      * Set type
  969.      *
  970.      * @param string $type
  971.      *
  972.      * @return Vehicle
  973.      */
  974.     public function setType($type)
  975.     {
  976.         $this->type $type;
  977.         return $this;
  978.     }
  979.     /**
  980.      * Get registrationNumber
  981.      *
  982.      * @return string
  983.      */
  984.     public function getRegistrationNumber()
  985.     {
  986.         return $this->registrationNumber;
  987.     }
  988.     /**
  989.      * Set registrationNumber
  990.      *
  991.      * @param string $registrationNumber
  992.      *
  993.      * @return Vehicle
  994.      */
  995.     public function setRegistrationNumber($registrationNumber)
  996.     {
  997.         $this->registrationNumber $registrationNumber;
  998.         return $this;
  999.     }
  1000.     /**
  1001.      * Get brand
  1002.      *
  1003.      * @return string
  1004.      */
  1005.     public function getBrand()
  1006.     {
  1007.         return $this->brand;
  1008.     }
  1009.     /**
  1010.      * Set brand
  1011.      *
  1012.      * @param string $brand
  1013.      *
  1014.      * @return Vehicle
  1015.      */
  1016.     public function setBrand($brand)
  1017.     {
  1018.         $this->brand $brand;
  1019.         return $this;
  1020.     }
  1021.     /**
  1022.      * Get businessModel
  1023.      *
  1024.      * @return string
  1025.      */
  1026.     public function getBusinessModel()
  1027.     {
  1028.         return $this->businessModel;
  1029.     }
  1030.     /**
  1031.      * Set businessModel
  1032.      *
  1033.      * @param string $businessModel
  1034.      *
  1035.      * @return Vehicle
  1036.      */
  1037.     public function setBusinessModel($businessModel)
  1038.     {
  1039.         $this->businessModel $businessModel;
  1040.         return $this;
  1041.     }
  1042.     /**
  1043.      * Get serialNumber
  1044.      *
  1045.      * @return string
  1046.      */
  1047.     public function getSerialNumber()
  1048.     {
  1049.         return $this->serialNumber;
  1050.     }
  1051.     /**
  1052.      * Set serialNumber
  1053.      *
  1054.      * @param string $serialNumber
  1055.      *
  1056.      * @return Vehicle
  1057.      */
  1058.     public function setSerialNumber($serialNumber)
  1059.     {
  1060.         $this->serialNumber $serialNumber;
  1061.         return $this;
  1062.     }
  1063.     /**
  1064.      * Add vehiclePhoto
  1065.      *
  1066.      * @param VehiclePhoto $vehiclePhoto
  1067.      *
  1068.      * @return Vehicle
  1069.      */
  1070.     public function addVehiclePhoto(VehiclePhoto $vehiclePhoto)
  1071.     {
  1072.         $this->vehiclePhotos[] = $vehiclePhoto;
  1073.         $vehiclePhoto->setVehicle($this);
  1074.         return $this;
  1075.     }
  1076.     /**
  1077.      * Remove vehiclePhoto
  1078.      *
  1079.      * @param VehiclePhoto $vehiclePhoto
  1080.      */
  1081.     public function removeVehiclePhoto(VehiclePhoto $vehiclePhoto)
  1082.     {
  1083.         $this->vehiclePhotos->removeElement($vehiclePhoto);
  1084.     }
  1085.     /**
  1086.      * Get vehiclePhotos
  1087.      *
  1088.      * @return Collection
  1089.      */
  1090.     public function getVehiclePhotos()
  1091.     {
  1092.         return $this->vehiclePhotos;
  1093.     }
  1094.     /**
  1095.      * Get user
  1096.      *
  1097.      * @return User|null
  1098.      */
  1099.     public function getUser(): ?User
  1100.     {
  1101.         return $this->user;
  1102.     }
  1103.     /**
  1104.      * Set user
  1105.      *
  1106.      * @param User $user
  1107.      *
  1108.      * @return Vehicle
  1109.      */
  1110.     public function setUser(User $user)
  1111.     {
  1112.         $this->user $user;
  1113.         return $this;
  1114.     }
  1115.     /**
  1116.      * Get vehicleDocumentationFileName
  1117.      *
  1118.      * @return string
  1119.      */
  1120.     public function getVehicleDocumentationFileName()
  1121.     {
  1122.         return $this->vehicleDocumentationFileName;
  1123.     }
  1124.     /**
  1125.      * Set vehicleDocumentationFileName
  1126.      *
  1127.      * @param string $vehicleDocumentationFileName
  1128.      *
  1129.      * @return Vehicle
  1130.      */
  1131.     public function setVehicleDocumentationFileName($vehicleDocumentationFileName)
  1132.     {
  1133.         $this->vehicleDocumentationFileName $vehicleDocumentationFileName;
  1134.         return $this;
  1135.     }
  1136.     /**
  1137.      * Get vehicleDocumentationFileSize
  1138.      *
  1139.      * @return integer
  1140.      */
  1141.     public function getVehicleDocumentationFileSize()
  1142.     {
  1143.         return $this->vehicleDocumentationFileSize;
  1144.     }
  1145.     /**
  1146.      * Set vehicleDocumentationFileSize
  1147.      *
  1148.      * @param integer $vehicleDocumentationFileSize
  1149.      *
  1150.      * @return Vehicle
  1151.      */
  1152.     public function setVehicleDocumentationFileSize($vehicleDocumentationFileSize)
  1153.     {
  1154.         $this->vehicleDocumentationFileSize $vehicleDocumentationFileSize;
  1155.         return $this;
  1156.     }
  1157.     /**
  1158.      * Get vehicleDocumentationFileUpdatedAt
  1159.      *
  1160.      * @return DateTime
  1161.      */
  1162.     public function getVehicleDocumentationFileUpdatedAt()
  1163.     {
  1164.         return $this->vehicleDocumentationFileUpdatedAt;
  1165.     }
  1166.     /**
  1167.      * Set vehicleDocumentationFileUpdatedAt
  1168.      *
  1169.      * @param DateTime $vehicleDocumentationFileUpdatedAt
  1170.      *
  1171.      * @return Vehicle
  1172.      */
  1173.     public function setVehicleDocumentationFileUpdatedAt($vehicleDocumentationFileUpdatedAt)
  1174.     {
  1175.         $this->vehicleDocumentationFileUpdatedAt $vehicleDocumentationFileUpdatedAt;
  1176.         return $this;
  1177.     }
  1178.     /**
  1179.      * Get createdAt
  1180.      *
  1181.      * @return DateTime
  1182.      */
  1183.     public function getCreatedAt()
  1184.     {
  1185.         return $this->createdAt;
  1186.     }
  1187.     /**
  1188.      * Set createdAt
  1189.      *
  1190.      * @param DateTime $createdAt
  1191.      *
  1192.      * @return Vehicle
  1193.      */
  1194.     public function setCreatedAt($createdAt)
  1195.     {
  1196.         $this->createdAt $createdAt;
  1197.         return $this;
  1198.     }
  1199.     /**
  1200.      * Get isDeleted
  1201.      *
  1202.      * @return boolean
  1203.      */
  1204.     public function getIsDeleted()
  1205.     {
  1206.         return $this->isDeleted;
  1207.     }
  1208.     /**
  1209.      * Set isDeleted
  1210.      *
  1211.      * @param boolean $isDeleted
  1212.      *
  1213.      * @return Vehicle
  1214.      */
  1215.     public function setIsDeleted($isDeleted)
  1216.     {
  1217.         $this->isDeleted $isDeleted;
  1218.         return $this;
  1219.     }
  1220.     /**
  1221.      * Add complaintX
  1222.      *
  1223.      * @param ComplaintX $complaintX
  1224.      *
  1225.      * @return Vehicle
  1226.      */
  1227.     public function addComplaintX(ComplaintX $complaintX)
  1228.     {
  1229.         $this->complaintXs[] = $complaintX;
  1230.         return $this;
  1231.     }
  1232.     /**
  1233.      * Remove complaintX
  1234.      *
  1235.      * @param ComplaintX $complaintX
  1236.      */
  1237.     public function removeComplaintX(ComplaintX $complaintX)
  1238.     {
  1239.         $this->complaintXs->removeElement($complaintX);
  1240.     }
  1241.     /**
  1242.      * Get complaintXs
  1243.      *
  1244.      * @return Collection
  1245.      */
  1246.     public function getComplaintXs()
  1247.     {
  1248.         return $this->complaintXs;
  1249.     }
  1250.     /**
  1251.      * Get civility
  1252.      *
  1253.      * @return string
  1254.      */
  1255.     public function getCivility()
  1256.     {
  1257.         return $this->civility;
  1258.     }
  1259.     /**
  1260.      * Set civility
  1261.      *
  1262.      * @param string $civility
  1263.      *
  1264.      * @return Vehicle
  1265.      */
  1266.     public function setCivility($civility)
  1267.     {
  1268.         // $civility = match ($civility) {
  1269.         //     'partner' => 'both',
  1270.         //     'loan' => 'other',
  1271.         //     'rent' => 'other',
  1272.         //     'work' => 'other',
  1273.         //     'service' => 'other',
  1274.         //     'loancomp' => 'other',
  1275.         //     default => $civility,
  1276.         // };
  1277.         $this->civility $civility;
  1278.         return $this;
  1279.     }
  1280.     /**
  1281.      * Add insurance
  1282.      *
  1283.      * @param Insurance $insurance
  1284.      *
  1285.      * @return Vehicle
  1286.      */
  1287.     public function addInsurance(Insurance $insurance)
  1288.     {
  1289.         $this->insurances[] = $insurance;
  1290.         return $this;
  1291.     }
  1292.     /**
  1293.      * Remove insurance
  1294.      *
  1295.      * @param Insurance $insurance
  1296.      */
  1297.     public function removeInsurance(Insurance $insurance)
  1298.     {
  1299.         $this->insurances->removeElement($insurance);
  1300.     }
  1301.     /**
  1302.      * Get insurances
  1303.      *
  1304.      * @return Collection
  1305.      */
  1306.     public function getInsurances()
  1307.     {
  1308.         return $this->insurances;
  1309.     }
  1310.     /**
  1311.      * Get otherTypeName.
  1312.      *
  1313.      * @return string
  1314.      */
  1315.     public function getOtherTypeName()
  1316.     {
  1317.         return $this->otherTypeName;
  1318.     }
  1319.     /**
  1320.      * Set otherTypeName.
  1321.      *
  1322.      * @param string $otherTypeName
  1323.      *
  1324.      * @return Vehicle
  1325.      */
  1326.     public function setOtherTypeName($otherTypeName)
  1327.     {
  1328.         $this->otherTypeName $otherTypeName;
  1329.         return $this;
  1330.     }
  1331.     /**
  1332.      * Get serial.
  1333.      *
  1334.      * @return string
  1335.      */
  1336.     public function getSerial()
  1337.     {
  1338.         return $this->serial;
  1339.     }
  1340.     /**
  1341.      * Set serial.
  1342.      *
  1343.      * @param string $serial
  1344.      *
  1345.      * @return Vehicle
  1346.      */
  1347.     public function setSerial($serial)
  1348.     {
  1349.         $this->serial $serial;
  1350.         return $this;
  1351.     }
  1352.     /**
  1353.      * Add vehicle.
  1354.      *
  1355.      * @param DisasterDeclaration $vehicle
  1356.      *
  1357.      * @return Vehicle
  1358.      */
  1359.     public function addVehicle(DisasterDeclaration $vehicle)
  1360.     {
  1361.         $this->vehicle[] = $vehicle;
  1362.         return $this;
  1363.     }
  1364.     /**
  1365.      * Remove vehicle.
  1366.      *
  1367.      * @param DisasterDeclaration $vehicle
  1368.      *
  1369.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1370.      */
  1371.     public function removeVehicle(DisasterDeclaration $vehicle)
  1372.     {
  1373.         return $this->vehicle->removeElement($vehicle);
  1374.     }
  1375.     /**
  1376.      * Get vehicle.
  1377.      *
  1378.      * @return Collection
  1379.      */
  1380.     public function getVehicle()
  1381.     {
  1382.         return $this->vehicle;
  1383.     }
  1384.     /**
  1385.      * Add theft.
  1386.      *
  1387.      * @param VehicleTheft $theft
  1388.      *
  1389.      * @return Vehicle
  1390.      */
  1391.     public function addTheft(VehicleTheft $theft)
  1392.     {
  1393.         $this->theft[] = $theft;
  1394.         return $this;
  1395.     }
  1396.     /**
  1397.      * Remove theft.
  1398.      *
  1399.      * @param VehicleTheft $theft
  1400.      *
  1401.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1402.      */
  1403.     public function removeTheft(VehicleTheft $theft)
  1404.     {
  1405.         return $this->theft->removeElement($theft);
  1406.     }
  1407.     /**
  1408.      * Get theft.
  1409.      *
  1410.      * @return Collection
  1411.      */
  1412.     public function getTheft()
  1413.     {
  1414.         return $this->theft;
  1415.     }
  1416.     /**
  1417.      * Add archiveComplaint.
  1418.      *
  1419.      * @param ArchiveComplaint $archiveComplaint
  1420.      *
  1421.      * @return Vehicle
  1422.      */
  1423.     public function addArchiveComplaint(ArchiveComplaint $archiveComplaint)
  1424.     {
  1425.         $this->archiveComplaints[] = $archiveComplaint;
  1426.         return $this;
  1427.     }
  1428.     /**
  1429.      * Remove archiveComplaint.
  1430.      *
  1431.      * @param ArchiveComplaint $archiveComplaint
  1432.      *
  1433.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  1434.      */
  1435.     public function removeArchiveComplaint(ArchiveComplaint $archiveComplaint)
  1436.     {
  1437.         return $this->archiveComplaints->removeElement($archiveComplaint);
  1438.     }
  1439.     /**
  1440.      * Get archiveComplaints.
  1441.      *
  1442.      * @return Collection
  1443.      */
  1444.     public function getArchiveComplaints()
  1445.     {
  1446.         return $this->archiveComplaints;
  1447.     }
  1448.     /**
  1449.      * Get statut.
  1450.      *
  1451.      * @return string|null
  1452.      */
  1453.     public function getStatut()
  1454.     {
  1455.         return $this->statut;
  1456.     }
  1457.     /**
  1458.      * Set statut.
  1459.      *
  1460.      * @param string|null $statut
  1461.      *
  1462.      * @return Vehicle
  1463.      */
  1464.     public function setStatut($statut null)
  1465.     {
  1466.         $this->statut $statut;
  1467.         return $this;
  1468.     }
  1469.     public function isIsRestored(): ?bool
  1470.     {
  1471.         return $this->isRestored;
  1472.     }
  1473.     public function setIsRestored(?bool $isRestored): static
  1474.     {
  1475.         $this->isRestored $isRestored;
  1476.         return $this;
  1477.     }
  1478.     public function isIsCompensated(): ?bool
  1479.     {
  1480.         return $this->isCompensated;
  1481.     }
  1482.     public function setIsCompensated(?bool $isCompensated): static
  1483.     {
  1484.         $this->isCompensated $isCompensated;
  1485.         return $this;
  1486.     }
  1487.     public function getActiveInsurance(): ?Insurance
  1488.     {
  1489.         $insurance $this->insurances->filter(fn(Insurance $insurance) => !$insurance->getIsDeleted())->first();
  1490.         return !$insurance null $insurance;
  1491.     }
  1492.     public function hasActiveInsurance(): bool
  1493.     {
  1494.         return $this->getActiveInsurance() !== null;
  1495.     }
  1496.     public function getVehiclePhotoFile()
  1497.     {
  1498.         return $this->vehiclePhotoFile;
  1499.     }
  1500.     /**
  1501.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  1502.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  1503.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  1504.      * must be able to accept an instance of 'File' as the bundle will inject one here
  1505.      * during Doctrine hydration.
  1506.      *
  1507.      * @param File|UploadedFile $image
  1508.      */
  1509.     public function setVehiclePhotoFile(File $image null)
  1510.     {
  1511.         $this->vehiclePhotoFile $image;
  1512.         if (null !== $image) {
  1513.             // It is required that at least one field changes if you are using doctrine
  1514.             // otherwise the event listeners won't be called and the file is lost
  1515.             $this->vehiclePhotoFileUpdatedAt = new DateTime();
  1516.         }
  1517.     }
  1518.     /**
  1519.      * Get vehiclePhotoFileName
  1520.      *
  1521.      * @return string
  1522.      */
  1523.     public function getVehiclePhotoFileName()
  1524.     {
  1525.         return $this->vehiclePhotoFileName;
  1526.     }
  1527.     /**
  1528.      * Set vehiclePhotoFileName
  1529.      *
  1530.      * @param string $vehiclePhotoFileName
  1531.      *
  1532.      * @return Vehicle
  1533.      */
  1534.     public function setVehiclePhotoFileName($vehiclePhotoFileName)
  1535.     {
  1536.         $this->vehiclePhotoFileName $vehiclePhotoFileName;
  1537.         return $this;
  1538.     }
  1539.     /**
  1540.      * Get vehiclePhotoFileSize
  1541.      *
  1542.      * @return integer
  1543.      */
  1544.     public function getVehiclePhotoFileSize()
  1545.     {
  1546.         return $this->vehiclePhotoFileSize;
  1547.     }
  1548.     /**
  1549.      * Set vehiclePhotoFileSize
  1550.      *
  1551.      * @param integer $vehiclePhotoFileSize
  1552.      *
  1553.      * @return Vehicle
  1554.      */
  1555.     public function setVehiclePhotoFileSize($vehiclePhotoFileSize)
  1556.     {
  1557.         $this->vehiclePhotoFileSize $vehiclePhotoFileSize;
  1558.         return $this;
  1559.     }
  1560.     /**
  1561.      * Get vehiclePhotoFileUpdatedAt
  1562.      *
  1563.      * @return DateTime
  1564.      */
  1565.     public function getVehiclePhotoFileUpdatedAt()
  1566.     {
  1567.         return $this->vehiclePhotoFileUpdatedAt;
  1568.     }
  1569.     /**
  1570.      * Set vehiclePhotoFileUpdatedAt
  1571.      *
  1572.      * @param DateTime $vehiclePhotoFileUpdatedAt
  1573.      *
  1574.      * @return Vehicle
  1575.      */
  1576.     public function setVehiclePhotoFileUpdatedAt($vehiclePhotoFileUpdatedAt)
  1577.     {
  1578.         $this->vehiclePhotoFileUpdatedAt $vehiclePhotoFileUpdatedAt;
  1579.         return $this;
  1580.     }
  1581. }