$itemData]); } /** * @param string $cartItemType * @param array $options * * @return App_ECommerce_Cart_ItemInterface * @throws Qs_Exception */ public static function factory($cartItemType, $options = []) { $itemClass = Qs_SiteMap::getItemTypeClass($cartItemType, 'Obj'); if (!class_exists($itemClass)) { throw new Qs_Exception('Can not create Cart Item Obj - class ' . $itemClass . ' does not exist'); } return new $itemClass($options); } /** * @param string $itemType * * @throws Qs_Exception * @return array [capabilityName, ...] */ public static function getItemCapabilities($itemType) { if (empty(static::$_itemCapabilitiesCache[$itemType])) { $itemClass = Qs_SiteMap::getItemTypeClass($itemType, 'Obj'); if (!class_exists($itemClass)) { throw new Qs_Exception('Can not create Cart Item Obj - class ' . $itemClass . ' does not exist'); } static::$_itemCapabilitiesCache[$itemType] = call_user_func([$itemClass, 'getCartItemCapabilities']); } return static::$_itemCapabilitiesCache[$itemType]; } }