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


PHP Base::resolve方法代碼示例

本文整理匯總了PHP中Base::resolve方法的典型用法代碼示例。如果您正苦於以下問題:PHP Base::resolve方法的具體用法?PHP Base::resolve怎麽用?PHP Base::resolve使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Base的用法示例。


在下文中一共展示了Base::resolve方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: resolve

 public function resolve($entity)
 {
     if ($entity === "price") {
         if (!$this->price && $this->loadFromDatabase()) {
             $this->price = new ElementPrice($this->id);
         }
         if ($this->price) {
             return $this->price;
         }
     } elseif ($entity === "sku") {
         if (!$this->sku && $this->loadFromDatabase()) {
             $this->sku = new ElementSku($this->id);
         }
         if ($this->sku) {
             return $this->sku;
         }
     } elseif ($entity === "store") {
         if (!$this->store) {
             $this->store = new CatalogStore(0);
         }
         if ($this->store) {
             return $this->store;
         }
     }
     return parent::resolve($entity);
 }
開發者ID:ASDAFF,項目名稱:open_bx,代碼行數:26,代碼來源:elementcatalog.php

示例2: resolve

 /**
  * Used to find entity for template processing.
  *
  * @param string $entity What to find.
  *
  * @return \Bitrix\Iblock\Template\Entity\Base
  */
 public function resolve($entity)
 {
     if (intval($entity) > 0) {
         if (\Bitrix\Main\Loader::includeModule('catalog')) {
             return new CatalogStore(intval($entity));
         }
     }
     return parent::resolve($entity);
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:16,代碼來源:catalogstore.php

示例3: resolve

 /**
  * Used to find entity for template processing.
  *
  * @param string $entity What to find.
  *
  * @return \Bitrix\Iblock\Template\Entity\Base
  */
 public function resolve($entity)
 {
     if ($entity === "property") {
         if (!$this->property && $this->loadFromDatabase()) {
             if ($this->fields["IBLOCK_ID"] > 0) {
                 $this->property = new SectionProperty($this->id);
                 $this->property->setIblockId($this->fields["IBLOCK_ID"]);
             }
         }
         if ($this->property) {
             return $this->property;
         }
     } elseif ($entity === "iblock") {
         if (!$this->iblock && $this->loadFromDatabase()) {
             if ($this->fields["IBLOCK_ID"] > 0) {
                 $this->iblock = new Iblock($this->fields["IBLOCK_ID"]);
             }
         }
         if ($this->iblock) {
             return $this->iblock;
         }
     } elseif ($entity === "parent") {
         if (!$this->parent && $this->loadFromDatabase()) {
             if ($this->fields["IBLOCK_SECTION_ID"] > 0) {
                 $this->parent = new Section($this->fields["IBLOCK_SECTION_ID"]);
             } else {
                 return $this->resolve("iblock");
             }
         }
         if ($this->parent) {
             return $this->parent;
         }
     } elseif ($entity === "sections") {
         if (!$this->sections && $this->loadFromDatabase()) {
             if ($this->fields["IBLOCK_SECTION_ID"] > 0) {
                 $this->sections = new SectionPath($this->fields["IBLOCK_SECTION_ID"]);
             }
         }
         if ($this->sections) {
             return $this->sections;
         }
     } elseif ($entity === "catalog") {
         if (!$this->catalog && $this->loadFromDatabase()) {
             if (\Bitrix\Main\Loader::includeModule('catalog')) {
                 $this->catalog = new ElementCatalog(0);
             }
         }
         if ($this->catalog) {
             return $this->catalog;
         }
     }
     return parent::resolve($entity);
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:60,代碼來源:section.php

示例4: resolve

 public function resolve($entity)
 {
     if ($entity === "catalog") {
         if (!$this->catalog && $this->loadFromDatabase()) {
             if (\Bitrix\Main\Loader::includeModule('catalog')) {
                 $this->catalog = new ElementCatalog(0);
             }
         }
         if ($this->catalog) {
             return $this->catalog;
         }
     }
     return parent::resolve($entity);
 }
開發者ID:spas-viktor,項目名稱:books,代碼行數:14,代碼來源:iblock.php

示例5: resolve

 public function resolve($entity)
 {
     if ($this->loadFromDatabase()) {
         if (isset($this->element_link_properties[$entity])) {
             if (!is_object($this->element_link_properties[$entity])) {
                 $this->element_link_properties[$entity] = new Element($this->element_link_properties[$entity]);
             }
             return $this->element_link_properties[$entity];
         } elseif (isset($this->section_link_properties[$entity])) {
             if (!is_object($this->section_link_properties[$entity])) {
                 $this->section_link_properties[$entity] = new Element($this->section_link_properties[$entity]);
             }
             return $this->section_link_properties[$entity];
         }
     }
     return parent::resolve($entity);
 }
開發者ID:spas-viktor,項目名稱:books,代碼行數:17,代碼來源:elementproperty.php

示例6: resolve

 public function resolve($entity)
 {
     if ($entity === "property") {
         if (!$this->property && $this->loadFromDatabase()) {
             if ($this->skuIblockId) {
                 $this->property = new ElementSkuProperty($this->fields["ID"]);
                 $this->property->setIblockId($this->skuIblockId);
             }
         }
         if ($this->property) {
             return $this->property;
         }
     } elseif ($entity === "price") {
         if (!$this->price && $this->loadFromDatabase()) {
             if ($this->skuIblockId) {
                 $this->price = new ElementSkuPrice($this->fields["ID"]);
             }
         }
         if ($this->price) {
             return $this->price;
         }
     }
     return parent::resolve($entity);
 }
開發者ID:ASDAFF,項目名稱:open_bx,代碼行數:24,代碼來源:elementsku.php

示例7: resolve

 public function resolve($entity)
 {
     return parent::resolve($entity);
 }
開發者ID:ASDAFF,項目名稱:open_bx,代碼行數:4,代碼來源:elementprice.php


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