public function __construct(Cart $cart = null) { parent::__construct(); if (isset($cart)) { $this->setCart($cart); } }