當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Iface::getResourceType方法代碼示例

本文整理匯總了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;
 }
開發者ID:aimeos,項目名稱:ai-admin-jsonadm,代碼行數:22,代碼來源:Base.php

示例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;
     }
 }
開發者ID:aimeos,項目名稱:ai-client-html,代碼行數:21,代碼來源:Base.php


注:本文中的Aimeos\MShop\Common\Item\Iface::getResourceType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。