Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

1.5 KB
Raw Blame
<?php

namespace HiEvents\DomainObjects;

use HiEvents\Helper\Currency;

class OrderItemDomainObject extends Generated\OrderItemDomainObjectAbstract
{
    private ?ProductPriceDomainObject $productPrice = null;

    public ?ProductDomainObject $product = null;

    public ?OrderDomainObject $order = null;

    private ?EventOccurrenceDomainObject $eventOccurrence = null;

    public function getTotalBeforeDiscount(): float
    {
        return Currency::round($this->getPriceBeforeDiscount() * $this->getQuantity());
    }

    public function getProductPrice(): ?ProductPriceDomainObject
    {
        return $this->productPrice;
    }

    public function setProductPrice(?ProductPriceDomainObject $tier): self
    {
        $this->productPrice = $tier;

        return $this;
    }

    public function getProduct(): ?ProductDomainObject
    {
        return $this->product;
    }

    public function setProduct(?ProductDomainObject $product): self
    {
        $this->product = $product;

        return $this;
    }

    public function getOrder(): ?OrderDomainObject
    {
        return $this->order;
    }

    public function setOrder(?OrderDomainObject $order): self
    {
        $this->order = $order;

        return $this;
    }

    public function getEventOccurrence(): ?EventOccurrenceDomainObject
    {
        return $this->eventOccurrence;
    }

    public function setEventOccurrence(?EventOccurrenceDomainObject $eventOccurrence): self
    {
        $this->eventOccurrence = $eventOccurrence;

        return $this;
    }
}