/** * Get Users latest Cart * * @return bool */ public function getLatestCart() { $list = new CoreShopCart\Listing(); $list->setCondition("user__id = ?", array($this->getId())); $list->setOrderKey("o_creationDate"); $list->setOrder("DESC"); $carts = $list->getObjects(); if (count($carts) > 0) { return $carts[0]; } return false; }
/** * Get all existing Carts * * @return array CoreShopCart */ public static function getAll() { $list = new CoreShopCart\Listing(); return $list->getObjects(); }