|
|
|
@@ -10,9 +10,9 @@ namespace App\ApiResource; |
|
|
|
use ApiPlatform\Doctrine\Orm\State\Options; |
|
|
|
use ApiPlatform\Metadata\ApiProperty; |
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
use App\Entity\Contact; |
|
|
|
use App\Entity\MediaObject; |
|
|
|
use App\Entity\Partner; |
|
|
|
use App\Enum\PartnerType; |
|
|
|
use App\State\EntityClassDtoStateProcessor; |
|
|
|
use App\State\EntityToDtoStateProvider; |
|
|
|
use ApiPlatform\Metadata\Delete; |
|
|
|
@@ -43,7 +43,7 @@ use Symfony\Component\Validator\Constraints\NotBlank; |
|
|
|
security: 'is_granted("ROLE_USER")', |
|
|
|
provider: EntityToDtoStateProvider::class, |
|
|
|
processor: EntityClassDtoStateProcessor::class, |
|
|
|
stateOptions: new Options(entityClass: Partner::class), |
|
|
|
stateOptions: new Options(entityClass: Contact::class), |
|
|
|
)] |
|
|
|
class ContactApi |
|
|
|
{ |
|
|
|
@@ -56,11 +56,11 @@ class ContactApi |
|
|
|
#[NotBlank] |
|
|
|
public ?string $lastName = null; |
|
|
|
|
|
|
|
public ?Partner $partner = null; |
|
|
|
public ?PartnerApi $partner = null; |
|
|
|
|
|
|
|
public ?\DateTimeInterface $birthday = null; |
|
|
|
|
|
|
|
public ?MediaObject $image = null; |
|
|
|
public ?MediaObject $image = null; |
|
|
|
|
|
|
|
public ?string $position = null; |
|
|
|
|
|
|
|
|