<commit_before><?php

/*
 * This file is part of the Sylius package.
 *
 * (c) <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sylius\Bundle\SalesBundle\Model;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Sylius\Bundle\ResourceBundle\Model\TimestampableInterface;

/**
 * Model for orders.
 *
 * @author <NAME> <<EMAIL>>
 */
class Order implements OrderInterface, TimestampableInterface
{
    /**
     * Id.
     *
     * @var mixed
     */
    protected $id;

    /**
     * Order number.
     *
     * @var string
     */
    protected $number;

    /**
     * Items in order.
     *
     * @var Collection
     */
    protected $items;

    /**
     * Items total.
     *
     * @var integer
     */
    protected $itemsTotal;

    /**
     * Adjustments.
     *
     * @var Collection
     */
    protected $adjustments;

    /**
     * Adjustments total.
     *
     * @var integer
     */
    protected $adjustmentsTotal;

    /**
     * Calculated total.
     * Items total + adjustments total.
     *
     * @var integer
     */
    protected $total;

    /**
     * Whether order was confirmed.
     *
     * @var Boolean
     */
    protected $confirmed;

    /**
     * Confirmation token.
     *
     * @var string
     */
    protected $confirmationToken;

    /**
     * Creation time.
     *
     * @var \DateTime
     */
    protected $createdAt;

    /**
     * Modification time.
     *
     * @var \DateTime
     */
    protected $updatedAt;

    /**
     * Total items count.
     *
     * @var integer
     */
    protected $totalItems;

    /**
     * Total quantity of items.
     *
     * @var integer
     */
    protected $totalQuantity;

    /**
     * Is cart locked?
     * Locked carts should not be removed
     * even if expired.
     *
     * @var Boolean
     */
    protected $locked;

    /**
     * Expiration time.
     *
     * @var \DateTime
     */
    protected $expiresAt;

    /**
     * Constructor.
     */
    public function __construct()
    {
        $this->items = new ArrayCollection();
        $this->itemsTotal = 0;
        $this->adjustments = new ArrayCollection();
        $this->adjustmentsTotal = 0;
        $this->total = 0;
        $this->confirmed = true;
        $this->createdAt = new \DateTime();
        $this->totalItems = 0;
        $this->totalQuantity = 0;
        $this->locked = false;
        $this->incrementExpiresAt();
    }

    /**<commit_msg>Update Order constructor<commit_after><?php

/*
 * This file is part of the Sylius package.
 *
 * (c) <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sylius\Bundle\SalesBundle\Model;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Sylius\Bundle\ResourceBundle\Model\TimestampableInterface;

/**
 * Model for orders.
 *
 * @author <NAME> <<EMAIL>>
 */
class Order implements OrderInterface, TimestampableInterface
{
    /**
     * Id.
     *
     * @var mixed
     */
    protected $id;

    /**
     * Order number.
     *
     * @var string
     */
    protected $number;

    /**
     * Items in order.
     *
     * @var Collection
     */
    protected $items;

    /**
     * Items total.
     *
     * @var integer
     */
    protected $itemsTotal;

    /**
     * Adjustments.
     *
     * @var Collection
     */
    protected $adjustments;

    /**
     * Adjustments total.
     *
     * @var integer
     */
    protected $adjustmentsTotal;

    /**
     * Calculated total.
     * Items total + adjustments total.
     *
     * @var integer
     */
    protected $total;

    /**
     * Whether order was confirmed.
     *
     * @var Boolean
     */
    protected $confirmed;

    /**
     * Confirmation token.
     *
     * @var string
     */
    protected $confirmationToken;

    /**
     * Creation time.
     *
     * @var \DateTime
     */
    protected $createdAt;

    /**
     * Modification time.
     *
     * @var \DateTime
     */
    protected $updatedAt;

    /**
     * Total items count.
     *
     * @var integer
     */
    protected $totalItems;

    /**
     * Total quantity of items.
     *
     * @var integer
     */
    protected $totalQuantity;

    /**
     * Is cart locked?
     * Locked carts should not be removed
     * even if expired.
     *
     * @var Boolean
     */
    protected $locked;

    /**
     * Expiration time.
     *
     * @var \DateTime
     */
    protected $expiresAt;

    /**
     * Constructor.
     */
    public function __construct()
    {
        $this->number = uniqid(sha1(microtime(true)));
        $this->items = new ArrayCollection();
        $this->itemsTotal = 0;
        $this->adjustments = new ArrayCollection();
        $this->adjustmentsTotal = 0;
        $this->total = 0;
        $this->confirmed = false;
        $this->createdAt = new \DateTime();
        $this->totalItems = 0;
        $this->totalQuantity = 0;
        $this->locked = false;
        $this->incrementExpiresAt();
    }

    /**
{'fraction_non_alphanumeric': 0.12578977599080987, 'fraction_numerical': 0.002106069308826345, 'mean_word_length': 1.6941722537390407, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6336431', 'n_tokens_mistral': 1605, 'n_tokens_neox': 1537, 'n_words': 374}