src/Domain/Entity/CamperVan.php line 26

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use ApiPlatform\Metadata\Get;
  5. use ApiPlatform\Metadata\GetCollection;
  6. use App\Domain\Entity\Behavior\Identifiable;
  7. use App\Domain\Entity\Enumeration\CamperVanBrand;
  8. use App\Domain\Entity\Enumeration\CamperVanOwnershipType;
  9. use App\Domain\Entity\Enumeration\CamperVanType;
  10. /**
  11.  * Class CamperVan
  12.  *
  13.  * @package App\Domain\Entity
  14.  */
  15. #[ApiResource(
  16.     operations            : [
  17.         new Get(),
  18.         new GetCollection(),
  19.     ],
  20.     normalizationContext  : ['groups' => ['camper_van_read']],
  21.     denormalizationContext: ['groups' => ['camper_van_write']]
  22. )]
  23. class CamperVan
  24. {
  25.     use Identifiable;
  26.     /**
  27.      * CamperVan constructor.
  28.      *
  29.      * @param Media|null                  $picture
  30.      * @param string|null                 $year
  31.      * @param CamperVanBrand|null         $brand
  32.      * @param CamperVanType|null          $type
  33.      * @param CamperVanOwnershipType|null $ownership
  34.      * @param string|null                 $model
  35.      */
  36.     public function __construct(
  37.         public ?Media $picture null,
  38.         public ?string $year null,
  39.         public ?CamperVanBrand $brand null,
  40.         public ?CamperVanType $type null,
  41.         public ?CamperVanOwnershipType $ownership null,
  42.         public ?string $model null,
  43.     ) {}
  44. }