Пример #1
0
 /**
  *
  * @internal
  *
  * @param $name
  * @param $value
  * @throws ObjectNotFoundException
  * @throws \Bitrix\Main\ArgumentOutOfRangeException
  */
 public function initField($name, $value)
 {
     if ($this->parentId == null && ($name == "TYPE" && $value == static::TYPE_SET)) {
         $this->parentId = $this->getBasketCode();
     }
     parent::initField($name, $value);
     if ($this->parentId == null && $name == "SET_PARENT_ID" && intval($value) > 0 && $value != $this->getId()) {
         /** @var BasketItem $parentBasketItem */
         if (!($parentBasketItem = $this->getParentBasketItem())) {
             throw new ObjectNotFoundException('Entity "BasketItem" not found');
         }
         $this->parentId = $parentBasketItem->getBasketCode();
     }
 }