public function create()
    {
        /**
         * @var Cart $cart
         */
        $classNamespace = $this->getEntityNamespace();
        $cart = new $classNamespace();
        $cart
            ->setOrdered(false)
            ->setCartLines(new ArrayCollection())
            ->setPurchasableAmount($this->createZeroAmountMoney())
            ->setAmount($this->createZeroAmountMoney())
            ->setCouponAmount($this->createZeroAmountMoney())
            ->setShippingAmount($this->createZeroAmountMoney())
            ->setCreatedAt($this->now());

        return $cart;
    }
public function create()
    {
        /**
         * @var Cart $cart
         */
        $classNamespace = $this->getEntityNamespace();
        $cart = new $classNamespace();
        $cart
            ->setOrdered(false)
            ->setCartLines(new ArrayCollection())
            ->setPurchasableAmount($this->createZeroAmountMoney())
            ->setAmount($this->createZeroAmountMoney())
            ->setCouponAmount($this->createZeroAmountMoney())
            ->setShippingAmount($this->createZeroAmountMoney())
            ->setCreatedAt($this->now());

        return $cart;
    }
public function create ( ) { /**
         * @var Cart $cart
         */ $ classNamespace = $ this -> getEntityNamespace ( ) ; $ cart = new $ classNamespace ( ) ; $ cart -> setOrdered ( false ) -> setCartLines ( new ArrayCollection ( ) ) -> setPurchasableAmount ( $ this -> createZeroAmountMoney ( ) ) -> setAmount ( $ this -> createZeroAmountMoney ( ) ) -> setCouponAmount ( $ this -> createZeroAmountMoney ( ) ) -> setShippingAmount ( $ this -> createZeroAmountMoney ( ) ) -> setCreatedAt ( $ this -> now ( ) ) ; return $ cart ; }
Creates an instance of Cart.

Cart factory does not need to known about Currency
objects in order to initialize Money objects for
properties such as Cart::amount, Cart::purchasableAmount
and Cart::couponAmount since they are meant to be
set by event listeners.

@see Elcodi\Component\Cart\EventListener\CartEventListener::loadCartPrices()

@return Cart New Cart entity
Creates an instance of Cart .