Your IP : 216.73.216.52


Current Path : /proc/thread-self/root/var/www/surf/TYPO3/src/surf/Classes/Domain/Model/
Upload File :
Current File : //proc/thread-self/root/var/www/surf/TYPO3/src/surf/Classes/Domain/Model/Order.php

<?php

declare(strict_types=1);

namespace Torresani\Surf\Domain\Model;


/**
 * This file is part of the "Surf" Extension for TYPO3 CMS.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 *
 * (c) 2023 Roberto Torresani <roberto@torresani.eu>
 */

/**
 * Order
 */
class Order extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{

    /**
     * code
     *
     * @var string
     */
    protected $code = null;

    /**
     * name
     *
     * @var string
     */
    protected $name = null;

    /**
     * status
     *
     * @var int
     */
    protected $status = 0;

    /**
     * uid
     *
     * @var int
     */
    protected $uid = 0;

    /**
     * delivery
     *
     * @var \Torresani\Surf\Domain\Model\Delivery
     */
    protected $delivery = null;

    /**
     * orderitem
     *
     * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Torresani\Surf\Domain\Model\OrderItem>
     * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove")
     */
    protected $orderitem = null;

    /**
     * Returns the code
     *
     * @return string
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * Sets the code
     *
     * @param string $code
     * @return void
     */
    public function setCode(string $code)
    {
        $this->code = $code;
    }

    /**
     * Returns the name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Sets the name
     *
     * @param string $name
     * @return void
     */
    public function setName(string $name)
    {
        $this->name = $name;
    }

    /**
     * Returns the delivery
     *
     * @return \Torresani\Surf\Domain\Model\Delivery
     */
    public function getDelivery()
    {
        return $this->delivery;
    }

    /**
     * Sets the delivery
     *
     * @param \Torresani\Surf\Domain\Model\Delivery $delivery
     * @return void
     */
    public function setDelivery(\Torresani\Surf\Domain\Model\Delivery $delivery)
    {
        $this->delivery = $delivery;
    }

    /**
     * __construct
     */
    public function __construct()
    {

        // Do not remove the next line: It would break the functionality
        $this->initializeObject();
    }

    /**
     * Initializes all ObjectStorage properties when model is reconstructed from DB (where __construct is not called)
     * Do not modify this method!
     * It will be rewritten on each save in the extension builder
     * You may modify the constructor of this class instead
     *
     * @return void
     */
    public function initializeObject()
    {
        $this->orderitem = $this->orderitem ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
    }

    /**
     * Adds a OrderItem
     *
     * @param \Torresani\Surf\Domain\Model\OrderItem $orderitem
     * @return void
     */
    public function addOrderitem(\Torresani\Surf\Domain\Model\OrderItem $orderitem)
    {
        $this->orderitem->attach($orderitem);
    }

    /**
     * Removes a OrderItem
     *
     * @param \Torresani\Surf\Domain\Model\OrderItem $orderitemToRemove The OrderItem to be removed
     * @return void
     */
    public function removeOrderitem(\Torresani\Surf\Domain\Model\OrderItem $orderitemToRemove)
    {
        $this->orderitem->detach($orderitemToRemove);
    }

    /**
     * Returns the orderitem
     *
     * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Torresani\Surf\Domain\Model\OrderItem>
     */
    public function getOrderitem()
    {
        return $this->orderitem;
    }

    /**
     * Sets the orderitem
     *
     * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Torresani\Surf\Domain\Model\OrderItem> $orderitem
     * @return void
     */
    public function setOrderitem(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $orderitem)
    {
        $this->orderitem = $orderitem;
    }

    /**
     * Returns the status
     *
     * @return int
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Sets the status
     *
     * @param int $status
     * @return void
     */
    public function setStatus(int $status)
    {
        $this->status = $status;
    }

    /**
     * Sets uid
     *
     * @param int $uid
     * @return void
     */
    public function setUid(int $uid)
    {
        $this->uid = $uid;
    }
}