Skip to content

Commit

Permalink
add support for attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
vasilvestre committed Jun 5, 2024
1 parent 149b15c commit 3f31faf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Model/OrderItemUnitTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
trait OrderItemUnitTrait
{
/** @ORM\OneToOne (targetEntity="Setono\SyliusGiftCardPlugin\Model\GiftCardInterface", mappedBy="orderItemUnit") */
#[ORM\OneToOne(targetEntity: \Setono\SyliusGiftCardPlugin\Model\GiftCardInterface::class, mappedBy: 'orderItemUnit')]
protected ?GiftCardInterface $giftCard = null;

public function getGiftCard(): ?GiftCardInterface
Expand Down
4 changes: 4 additions & 0 deletions src/Model/OrderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ trait OrderTrait
* inverseJoinColumns={@ORM\JoinColumn(name="gift_card_id", referencedColumnName="id", onDelete="CASCADE")}
* )
*/
#[ORM\JoinTable(name: 'setono_sylius_gift_card__order_gift_cards')]
#[ORM\JoinColumn(name: 'order_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\InverseJoinColumn(name: 'gift_card_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\ManyToMany(targetEntity: \Setono\SyliusGiftCardPlugin\Model\GiftCardInterface::class, inversedBy: 'appliedOrders')]
protected Collection $giftCards;

public function __construct()
Expand Down
2 changes: 2 additions & 0 deletions src/Model/ProductTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
trait ProductTrait
{
/** @ORM\Column(type="boolean", options={"default": false}) */
#[ORM\Column(type: 'boolean', options: ['default' => false])]
protected bool $giftCard = false;

/** @ORM\Column(type="boolean", options={"default": false}) */
#[ORM\Column(type: 'boolean', options: ['default' => false])]
protected bool $giftCardAmountConfigurable = false;

public function isGiftCard(): bool
Expand Down

0 comments on commit 3f31faf

Please sign in to comment.