本文整理匯總了PHP中Aimeos\MShop\Common\Item\Iface::getResourceType方法的典型用法代碼示例。如果您正苦於以下問題:PHP Iface::getResourceType方法的具體用法?PHP Iface::getResourceType怎麽用?PHP Iface::getResourceType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Aimeos\MShop\Common\Item\Iface
的用法示例。
在下文中一共展示了Iface::getResourceType方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addItemData
/**
* Adds the data from the given object to the item
*
* @param \Aimeos\MShop\Common\Manager\Iface $manager Manager object
* @param \Aimeos\MShop\Common\Item\Iface $item Item object to add the data to
* @param \stdClass $data Object with "attributes" property
* @param string $domain Domain of the type item
* @return \Aimeos\MShop\Common\Item\Iface Item including the data
*/
protected function addItemData(\Aimeos\MShop\Common\Manager\Iface $manager, \Aimeos\MShop\Common\Item\Iface $item, \stdClass $data, $domain)
{
if (isset($data->attributes)) {
$attr = (array) $data->attributes;
$key = str_replace('/', '.', $item->getResourceType());
if (isset($attr[$key . '.type'])) {
$typeItem = $manager->getSubManager('type')->findItem($attr[$key . '.type'], array(), $domain);
$attr[$key . '.typeid'] = $typeItem->getId();
}
$item->fromArray($attr);
}
return $item;
}
示例2: addMetaItemSingle
/**
* Adds expire date and tags for a single item.
*
* @param \Aimeos\MShop\Common\Item\Iface $item Item, maybe with associated list items
* @param array &$expires Will contain the list of expiration dates
* @param array &$tags List of tags the new tags will be added to
* @param boolean $tagAll True of tags for all items should be added, false if only for the main item
*/
private function addMetaItemSingle(\Aimeos\MShop\Common\Item\Iface $item, array &$expires, array &$tags, $tagAll)
{
$domain = str_replace('/', '_', $item->getResourceType());
// maximum compatiblity
if ($tagAll === true) {
$tags[] = $domain . '-' . $item->getId();
} else {
$tags[] = $domain;
}
if ($item instanceof \Aimeos\MShop\Common\Item\Time\Iface && ($date = $item->getDateEnd()) !== null) {
$expires[] = $date;
}
}