本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例7: resolve
public function resolve($entity)
{
return parent::resolve($entity);
}