当前位置: 首页>>代码示例>>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;未经允许,请勿转载。