@param string $id

@return mixed

@throws Exception
163579
public function inspectExec(string $id)
    {
        $url = self::$base_url.'/exec'.$id.'/json';

        return self::$curl->get($url);
    }
104040
public function lock($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        return $this->rest->put("$this->action/$id/lock");
    }
673428
public function raw(string $id)
    {
        $id = $this->getRealId($id);

        if (array_key_exists($id, $this->definitions)) {
            return $this->definitions[$id];
        }

        throw new Exception\NotFoundException($id);
    }
1274014
public function actionView($id)
    {
        try{

            $request = \Yii::$app->request;
            if ($request->getIsOptions()) {
                return $this->ResponseOptions($this->verbs()['view']);
            }
            $model = $this->findModel($id);
            if($model!=null){
                $result= ['success'=>true,'rules'=>$model];
            } else {
                $result= ['success'=>false,'message'=>'没有对应规则'];
            }

            return $result;
        }catch(Exception $e){
            throw new Exception($e);
        }
        //return $this->render('view', ['model' => $model]);
    }
722671
protected function iblockLocate($id)
    {
        if (empty($id)) {
            throw new Exception('Id parameter must not be empty');
        } elseif (!is_numeric($id)) {
            $findByCode = $this->iblockGetIdByCode($id);
            if ($findByCode === null) {
                throw new Exception("Can't find iblock by code: {$id}");
            }
            $id = $findByCode;
        }

        $iblock = $this->iblockGetById($id);
        if ($iblock === null) {
            throw new Exception("Can't find iblock by id: {$id}");
        }

        return $iblock;
    }
1089369
public function actionDelete($id)
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['delete']);
        }
        try{
            $model = $this->findModel($id);
            Configs::authManager()->remove($model->item);
            Helper::invalidate();

        }catch (Exception $e){
            throw new Exception($e);
        }


        return ['success'=>true];
    }
98816
public function delPermission($id = 0)
    {
        $model = new Permission($this->db);
        try {
            return $model->delPermission($id);
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }
    }
281911
public function get($id)
    {
        if ($this->has($id) === false)
        {
            $message = (string) 'Class (%s) does not exists';

            throw new NotFoundException(sprintf($message, $id));
        }

        $reflection = new \ReflectionClass($id);

        if ($constructor = $reflection->getConstructor())
        {
            $arguments = $this->arguments($constructor);

            return $reflection->newInstanceArgs($arguments);
        }

        return new $id;
    }
1331371
public function get($id, $params = null)
    {
        $id = (int)$id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        return $this->rest->get("$this->action/$id", $params);
    }
424903
public function getById($id)
    {
        $sql = "SELECT * FROM " . $this->getTable() . " WHERE " . $this->getPrimaryKey() . " = " . intval($id) . ";";

        try {
            $result = $this->db->query($sql);
        } catch (\PDOException $e) {
            throw new DatabaseException($e->getMessage() . '<br>' . $sql);
        }
        return $this->fetchAssoc($result);

    }
189960
public function show($id = null)
    {
        // Check the ID
        if (!isset($id)) {
            throw new \InvalidArgumentException('Undefined ID', 400);
        }

        // Get record
        $item = $this->model->find($id);

        // Abort if the record is not found
        if (!$item) {
            throw new \Exception('Element not found', 404);
        }

        // Return response
        return [
            'success' => true,
            'data' => $item
        ];
    }
1136640
public function handlerById($id)
    {
        if (isset($this->_handlers[$id])) {
            return $this->_handlers[$id];
        }
        throw new \Exception("Property handler with id {$id} not found");
    }
746485
public function retrieve(string $id)
    {
        $data = $this->retrieveAll();

        if (!array_key_exists($id, $data)) {
            throw new \RuntimeException(sprintf('Unable to load object of type "%s" with ID "%s"', $this->className, $id));
        }

        $object = $data[$id];

        Assertion::isInstanceOf($object, $this->className);

        return $object;
    }
196033
public function get(string $id)
    {
        if ($this->can('get')) {
            $this->flow->getLogger()->debug("Retrieving Resource: $this->id => $id");
            return $this->make(
                $this->performGet($this->id, $id)
            );
        }
        throw new \BadMethodCallException('Method '.__FUNCTION__.' does not exist');
    }
90942
public function id($id = null)
    {
        if ($id) {
            if (!$this->isValidId($id)) {
                throw new \InvalidArgumentException('$id may contain only [a-zA-Z0-9-_]');
            }
            if ($this->id) {
                throw new Exception('Cannot set id while session is active');
            }
            $this->requestedId = $id;
        }
        return $this->id;
    }
794756
public function getById($id) : Response
    {
        //find the info
        $user = $this->model->findFirst([
            'id = ?0 AND is_deleted = 0',
            'bind' => [$this->userData->getId()],
        ]);

        $user->password = null;

        //get relationship
        if ($this->request->hasQuery('relationships')) {
            $relationships = $this->request->getQuery('relationships', 'string');

            $user = QueryParser::parseRelationShips($relationships, $user);
        }

        if ($user) {
            return $this->response($user);
        } else {
            throw new Exception('Record not found');
        }
    }
37796
protected function _getNodeById( $id )
	{
		$conn = $this->_dbm->acquire( $this->_dbname );

		try
		{
			$stmt = $conn->create( str_replace( ':cond', '1=1', $this->_config['get'] ) );
			$stmt->bind( 1, $id, MW_DB_Statement_Abstract::PARAM_INT );
			$stmt->bind( 2, 0, MW_DB_Statement_Abstract::PARAM_INT );
			$result = $stmt->execute();

			if( ( $row = $result->fetch() ) === false ) {
				throw new MW_Tree_Exception( sprintf( 'No node with ID "%1$d" found', $id ) );
			}

			$node = $this->_createNode( $row );

			$this->_dbm->release( $conn, $this->_dbname );
		}
		catch( Exception $e )
		{
			$this->_dbm->release( $conn, $this->_dbname );
			throw $e;
		}

		return $node;
	}