Обновить инфоблок
@param $id
@throws \Exception
188646
public function update($id)
    {
        $obj = new \CIBlock();
        if (!$obj->Update($id, $this->fields)) {
            throw new \Exception($obj->LAST_ERROR);
        }

        Logger::log("Обновлен инфоблок {$id}", Logger::COLOR_GREEN);
    }
209235
public function setId($id = null)
        {
            if (null !== $id && !is_string($id) && !is_numeric($id)) {
                throw new Exception(
                        'Invalid argument: $id must be a string, number or null');
            }

            $this->_id = null === $id ? $id : (string) $id;

            return $this;
        }
346968
public function complete($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        return $this->rest->put("$this->action/$id/complete");
    }
1237113
public function tryLoad($id)
    {
        if (!$this->persistence) {
            throw new Exception(['Model is not associated with any database']);
        }

        if (!$this->persistence->hasMethod('tryLoad')) {
            throw new Exception('Persistence does not support tryLoad()');
        }

        if ($this->loaded()) {
            $this->unload();
        }

        $this->data = $this->persistence->tryLoad($this, $id);
        if ($this->data) {
            $this->id = $id;

            $ret = $this->hook('afterLoad');
            if ($ret === false) {
                return $this->unload();
            } elseif (is_object($ret)) {
                return $ret;
            }
        } else {
            $this->unload();
        }

        return $this;
    }
536337
public function handleDeleteRole(int $id): void
	{
		if ($this->isAjax()) {
			$role = $this->orm->aclRoles->getById($id);
			$this->orm->aclRoles->removeAndFlush($role);
			$this['rolesList']->reload();
		} else {
			$this->terminate();
		}
	}
633094
protected function addImportedId($id)
    {
        if (!array_key_exists($id, $this->importedIds)) {
            $this->importedIds[$id] = true;
        }
    }
830876
public function getById($id)
    {
        $inputResult = $this->getRequest()->request(
            'GET',
            $this->getRequestUrl(sprintf('inputs/%s', $id))
        );

        if (isset($inputResult['input'])) {
            $input = new Input($inputResult['input']);
        } else {
            throw new \Exception('Input Not Found');
        }

        return $input;
    }
1037954
public function setInternalId($id)
    {
        if ($this->_id !== null && $this->_id !== $id) {
            throw new ClientException('Should not update the id of an existing document');
        }


        if (!preg_match('/^[a-zA-Z0-9_-]{1,64}\/[a-zA-Z0-9_:.@\-()+,=;$!*\'%]{1,254}$/', $id)) {
            throw new ClientException('Invalid format for document id');
        }

        $this->_id = (string) $id;
    }
965718
public function delete($id): Response
    {
        if ($objectInfo = $this->model->findFirst($id)) {
            if ($objectInfo->delete() === false) {
                foreach ($objectInfo->getMessages() as $message) {
                    throw new Exception($message);
                }
            }

            return $this->response(['Delete Successfully']);
        } else {
            throw new Exception(_('Record not found'));
        }
    }
1048699
public static function delete($id)
    {
        if (!\CIBlock::Delete($id)) {
            throw new \Exception('Ошибка при удалении инфоблока');
        }

        Logger::log("Удален инфоблок {$id}", Logger::COLOR_GREEN);
    }
1283825
public function actionEdit(int $id): void
	{
		$this->page = $this->orm->pages->getById($id);
		if (!$this->page) {
			$this->error();
		}

		$gallery = $this['gallery'];
		$gallery->setStorage($this->orm->pagesGalleries);
		$gallery->setForeignKey('page', $this->page->id);
		$gallery->setNamespace('page/' . $this->page->url);
	}
532245
public function write($id, $data)
    {
        try {
            return $this->db->write($id, $data);
        } catch (\Exception $e) {
            throw $e;
        }
    }
145008
public function actionUp($id)
    {
        if ($category = Category::findOne($id)) {
            $this->trigger(self::EVENT_BEFORE_EDIT_CATEGORY);

            if ($category->movePrev()) {
                $this->trigger(self::EVENT_AFTER_EDIT_CATEGORY,
                    new CategoryEvent(['id' => $id]));
                if (\Yii::$app->request->isAjax) {
                    return 'up';
                }
            }
            return $this->actionIndex();
        }
        throw new NotFoundHttpException();
    }
390851
public function findById($id)
    {
        $businessEntity = $this->reader->findById($id);
        if ($businessEntity === null) {
            throw new \Exception('"'.$id.'" does not seems to be a valid BusinessEntity');
        }

        return $businessEntity;
    }
67736
public function edit($id = null) {
		if (!$this->IvaResponsabilidad->exists($id)) {
			throw new NotFoundException(__('Invalid iva responsabilidad'));
		}
		if ($this->request->is(array('post', 'put'))) {
			if ($this->IvaResponsabilidad->save($this->request->data)) {
				$this->Session->setFlash(__('The iva responsabilidad has been saved.'));
				return $this->redirect(array('action' => 'index'));
			} else {
				$this->Session->setFlash(__('The iva responsabilidad could not be saved. Please, try again.'));
			}
		} else {
			$options = array('conditions' => array('IvaResponsabilidad.' . $this->IvaResponsabilidad->primaryKey => $id));
			$this->request->data = $this->IvaResponsabilidad->find('first', $options);
		}
		$tipoFacturas = $this->IvaResponsabilidad->TipoFactura->find('list');
		$this->set(compact('tipoFacturas'));
	}
508790
public function setDatatableId($id)
    {
        if (!array_key_exists($id, self::$instances)) {
            self::$instances[$id] = $this;
        } else {
            throw new \Exception('Identifer already exists');
        }

        return $this;
    }
6177
public function handleVisibility(int $id)
	{
		if ($this->isAjax()) {
			$page = $this->orm->pages->getById($id);
			$page->visible = !$page->visible;
			$this->orm->persistAndFlush($page);

			$this['list']->setDataSource($this->orm->pages->findById($id));
			$this['list']->redrawItem($id);
		} else {
			$this->terminate();
		}
	}