["security" => "is_granted('ROLE_ORGANIZATION_VIEW')"], "post" ], itemOperations: [ "get" => ["security" => "is_granted('ROLE_ORGANIZATION_VIEW') and object.getOrganization().getId() == user.getOrganization().getId()"], "put" => ["security" => "object.getOrganization().getId() == user.getOrganization().getId()"], "delete" => ["security" => "object.getOrganization().getId() == user.getOrganization().getId()"], ], attributes: ["security" => "is_granted('ROLE_ORGANIZATION')"], denormalizationContext: [ 'groups' => ['address'], ], normalizationContext: [ 'groups' => ['address'], ], )] #[ORM\Entity(repositoryClass: OrganizationAddressPostalRepository::class)] #[OrganizationDefaultValue(fieldName: "organization")] class OrganizationAddressPostal { #[ORM\Id] #[ORM\Column] #[ORM\GeneratedValue] #[Groups("address")] private ?int $id = null; #[ORM\ManyToOne(inversedBy: 'organizationAddressPostals')] #[ORM\JoinColumn(nullable: false)] private Organization $organization; #[ORM\OneToOne(inversedBy: 'organizationAddressPostal', cascade: ['persist', 'remove'])] #[ORM\JoinColumn(nullable: false)] #[Groups("address")] private AddressPostal $addressPostal; #[ORM\Column(length: 255)] #[Assert\Choice(callback: ['\App\Enum\Organization\AddressPostalOrganizationTypeEnum', 'toArray'], message: 'invalid-address-postal-type')] #[Groups("address")] private string $type; public function getId(): ?int { return $this->id; } public function getOrganization(): ?Organization { return $this->organization; } public function setOrganization(Organization $organization): self { $this->organization = $organization; return $this; } public function getAddressPostal(): ?AddressPostal { return $this->addressPostal; } public function setAddressPostal(AddressPostal $addressPostal): self { $this->addressPostal = $addressPostal; return $this; } public function getType(): string { return $this->type; } public function setType(string $type): self { $this->type = $type; return $this; } }