예제 #1
0
 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);
 }
예제 #2
0
 /**
  * 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);
 }
예제 #3
0
 /**
  * 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);
 }
예제 #4
0
 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);
 }
예제 #5
0
 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);
 }
예제 #6
0
 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);
 }
예제 #7
0
 public function resolve($entity)
 {
     return parent::resolve($entity);
 }