本文整理汇总了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;
}
}