From 4b33881f152e64fc4ce8dc1bbe8be473c1921db0 Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Wed, 11 Sep 2024 13:55:55 +0200 Subject: [PATCH] Remove unnecessary readableLink settings --- src/Entity/Accounting.php | 6 ++---- src/Entity/GatewayCharge.php | 3 ++- src/Entity/GatewayCheckout.php | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Entity/Accounting.php b/src/Entity/Accounting.php index 85cd70e..8a7b2c4 100644 --- a/src/Entity/Accounting.php +++ b/src/Entity/Accounting.php @@ -14,7 +14,6 @@ use Symfony\Component\Validator\Constraints as Assert; * Accountings are the receivers and the issuers of Transactions. */ #[ORM\Entity(repositoryClass: AccountingRepository::class)] -#[API\ApiResource] #[API\Get()] #[API\Patch(security: 'is_granted("ACCOUNTING_EDIT", object)')] class Accounting @@ -48,11 +47,11 @@ class Accounting #[ORM\OneToOne(mappedBy: 'accounting', cascade: ['persist', 'remove'])] private ?Tipjar $tipjar = null; - #[API\ApiProperty(writable: false, readableLink: false)] + #[API\ApiProperty(writable: false)] #[ORM\OneToMany(mappedBy: 'origin', targetEntity: AccountingTransaction::class)] private Collection $transactionsIssued; - #[API\ApiProperty(writable: false, readableLink: false)] + #[API\ApiProperty(writable: false)] #[ORM\OneToMany(mappedBy: 'target', targetEntity: AccountingTransaction::class)] private Collection $transactionsReceived; @@ -172,7 +171,6 @@ class Accounting /** * @return Collection */ - #[API\ApiProperty(readableLink: false)] public function getTransactions(): Collection { $transactions = [ diff --git a/src/Entity/GatewayCharge.php b/src/Entity/GatewayCharge.php index 5a07536..97b8bbe 100644 --- a/src/Entity/GatewayCharge.php +++ b/src/Entity/GatewayCharge.php @@ -38,6 +38,7 @@ class GatewayCharge /** * The Accounting receiving the consequent Transaction for this GatewayCharge. */ + #[API\ApiProperty(readableLink: true)] #[Assert\NotBlank()] #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] @@ -46,7 +47,7 @@ class GatewayCharge /** * The AccountingTransaction generated for this charge after the checkout with the Gateway. */ - #[API\ApiProperty(writable: false, readableLink: false)] + #[API\ApiProperty(writable: false)] #[ORM\OneToOne(cascade: ['persist', 'remove'])] private ?AccountingTransaction $transaction = null; diff --git a/src/Entity/GatewayCheckout.php b/src/Entity/GatewayCheckout.php index 0eea5c3..c8946c9 100644 --- a/src/Entity/GatewayCheckout.php +++ b/src/Entity/GatewayCheckout.php @@ -50,7 +50,6 @@ class GatewayCheckout */ #[Assert\NotBlank()] #[Assert\Count(min: 1)] - #[API\ApiProperty(readableLink: true, writableLink: true)] #[ORM\ManyToMany(targetEntity: GatewayCharge::class, cascade: ['persist'])] private Collection $charges;