Return the instance fields of itemtype identified by id.
@param string $itemType
@param integer $id
@param array $queryString
@return array
10251
public function getItem($itemType, $id, array $queryString = []) {
      $options = [];
      if ($queryString) {
         $options['query'] = $queryString;
      }
      $response = $this->client->request('get', $itemType . '/' . $id, $options);
      return [
         'statusCode' => $response->getStatusCode(),
         'body' => $response->getBody()->getContents(),
      ];
   }
627717
public function GetCommentsPage(int $itemType = GnCommentItemType::Community, string $itemKey = NULL, int $pageSize = NULL, int $lastKnownTicks = GnSettings::FAR_FUTURE_TICKS)
    {
        $result = $this->ExecuteCall("GetCommentsPage", (object)[
            "itemType" => $itemType,
            "itemKey" => $itemKey,
            "pageSize" => $pageSize,
            "lastKnownTicks" => $lastKnownTicks
        ], GnResponseType::ListGnComment);

        return $result;
    }
66049
protected function getQueryInstanceFromQueryString($queryString)
    {
        if (preg_match('/^[ \r\n\t\f]*(?:(only[ \r\n\t\f]+)|(not[ \r\n\t\f]+))?([^ \r\n\t\f]*)[ \r\n\t\f]*(?:(?:and)?[ \r\n\t\f]*)*$/iD', $queryString, $matches)) {
            $type = $matches[3] === "" ? MediaQuery::TYPE_ALL : $matches[3];
            $query = new MediaQuery($type);
            if (!empty($matches[1])) {
                $query->setIsOnly(true);
            }
            if (!empty($matches[2])) {
                $query->setIsNot(true);
            }
            return $query;
        }
        return null;
    }
699863
public function addQueryParameters($queryString)
    {
        $queries = preg_split('/&(amp;)?/i', $queryString);

        foreach ($queries as $v) {
            $explode = explode('=', $v);

            $name  = $explode[0];
            $value = isset($explode[1]) ? $explode[1] : '';
            $rpos  = strrpos($name, '?');

            if ($rpos !== false) {
                $name = substr($name, ($rpos + 1));
            }

            if (empty($name)) {
                continue;
            }

            $this->setQueryParameter($name, $value);
        }

        return $this;
    }
756012
public function getIds($entityType, array $selector = [], array $params = [])
    {
        $params['fields'] = '_id';

        return array_column($this->search($entityType, $selector, $params), '_id');
    }
279591
public function requestRepresentableQueryItem(): QueryItem {
		$selectBuilder  = $this->queryState->getPdo()->getMetaData()->createSelectStatementBuilder();
		$this->queryModel->apply($selectBuilder);
		
		return $selectBuilder->toQueryResult();
	}
520678
private function parseArrayToFieldEntity(array $item, $elementType)
    {
        $entity = new Field();
        $entity->set($item);
        $entity->element_type = $elementType;

        return $entity;
    }
586379
public function containsItemWithRootPageId(string $itemType, int $itemUid, int $rootPageId) : bool
    {
        $queryBuilder = $this->getQueryBuilderForContainsMethods($itemType, $itemUid);
        return (bool)$queryBuilder
            ->andWhere($queryBuilder->expr()->eq('root', $rootPageId))
            ->execute()->fetchColumn(0);
    }
40013
public function itemShow($item_id)
    {
        $response = $this->getGuzzleClient()
            ->get('/items/' . $item_id, $this->setQuery());

        return $this->serializer->deserialize(
            $response->getBody()->getContents(),
            Item::class,
            'json'
        );
    }
1003127
protected function queryColumns ($queryType, $queryValues, $valueType, $keyValue = false, $ignoreNull = false) {
        $target_columns = array();

        if($queryType === "col_list") {
            // The caller has already specified a list of columns
            $target_columns = $queryValues;
        }
        else {
            /**
             * @var  $key
             * @var SQLColumn $col
             */
            foreach($this->columns as $key => $col) {
                if($queryType === "category") {
                    if(in_array($col->category, $queryValues)) {
                        $target_columns []= $key;
                    }
                }
                else if ($queryType === "all") {
                    $target_columns []= $key;
                }
            }
        }

        $results = array();

        foreach($target_columns as $colKey) {
            /**
             * @var $column SQLColumn
             */
            $column = $this->columns[$colKey];
            $resultItem = null;
            switch($valueType) {
                case "id":
                    $resultItem = $colKey;
                    break;
                case "expr":
                    $resultItem = $column->getExpr();
                    break;
                case "exprAs":
                    $resultItem = $column->getExprAs();
                    break;
                case "object":
                    $resultItem = $column;
                    break;
                case "schema":
                    $resultItem = $column->getSchema();
                    break;
                case "summary":
                    $resultItem = $column->getSummaryConfig();
                    break;
                default:
                    //TODO: Throw library-specific exceptions
                    throw new \Exception("Unknown value type $valueType");
            }

            if(is_null($resultItem) && $ignoreNull) {
                continue;
            }

            if($keyValue) {
                $results[$colKey] = $resultItem;
            }
            else {
                $results []= $resultItem;
            }
        }

        return $results;
    }
1067661
private function _parseQueryString($queryString)
    {
        $queryObjs = json_decode($queryString);
        if (!$queryObjs) {
            throw new SqlException(
                'There was an error parsing your filter query string. '
                . 'The filter query must be in the format of a JSON object.'
            );
        }

        //inject a single object into an array.
        if (!is_array($queryObjs)) {
            $queryObj = $queryObjs;
            $queryObjs = [];
            $queryObjs[] = $queryObj;
        }

        $firstObj = true;
        foreach ($queryObjs as $queryObj) {
            $firstProperty = true;
            foreach ($queryObj as $property => $value) {
                if (is_array($value)) {
                    foreach ($value as $val) {
                        $this->_addFilterComparison($firstObj, $firstProperty, $property, $val);
                    }
                } else {
                    $this->_addFilterComparison($firstObj, $firstProperty, $property, $value);
                }
                $firstProperty = false;
            }
            $firstObj = false;
        }
    }
269315
public function updateItems($itemType, $id, array $queryString) {
      if (!$id) {
         if (!$queryString) {
            throw new InsufficientArgumentsException(ErrorHandler::getMessage('ERROR_APILIB_ARGS_MANDATORY', "'id' to identify the item"));
         }
         foreach ($queryString as $item) {
            if (is_array($item) && !array_key_exists('id', $item)) {
               throw new InsufficientArgumentsException(ErrorHandler::getMessage('ERROR_APILIB_ARGS_MANDATORY', "'id' to identify the item"));
            }
         }
      }
      $options['body'] = json_encode(['input' => $queryString]);
      $response = $this->client->request('put', $itemType . '/' . $id, $options);
      return [
         'statusCode' => $response->getStatusCode(),
         'body' => $response->getBody()->getContents(),
      ];
   }
1282052
protected Query<E> query(String queryString) {
        return currentSession().createQuery(requireNonNull(queryString), getEntityClass());
    }
333684
public function sqlQuery($queryString)
    {
        try {
            // execute query
            $query = $this->connection->prepare(
                $queryString,
                [\PDO::ATTR_CURSOR => \PDO::CURSOR_FWDONLY]
            );
            $query->execute();

            return $query;
        } catch (\PDOException $e) {
            throw new \Exception($e->getMessage());
        }
    }
752681
static function fetchIDListContainingDatatype( $dataTypeString )
    {
        $db = eZDB::instance();

        $version = self::VERSION_STATUS_DEFINED;
        $escapedDataTypeString = $db->escapeString( $dataTypeString );

        $sql = "SELECT DISTINCT contentclass_id
                FROM ezcontentclass_attribute
                WHERE version=$version
                AND data_type_string='$escapedDataTypeString'";

        $classIDArray = $db->arrayQuery( $sql, array( 'column' => 'contentclass_id' ) );
        return $classIDArray;
    }
575419
public function findTreeItem($id, MapperTreeItemInterface $item)
    {
        if ($id === $item->getId()) {
            return $item;
        }
        foreach ($item->getChildren() as $child) {
            if (null !== $treeItem = $this->findTreeItem($id, $child)) {
                return $treeItem;
            }
        }

        return null;
    }
1363751
protected function getQueryBuilderForContainsMethods(string $itemType, int $itemUid) : QueryBuilder
    {
        $queryBuilder = $this->getQueryBuilder();
        return $queryBuilder->count('uid')->from($this->table)
            ->andWhere(
                $queryBuilder->expr()->eq('item_type', $queryBuilder->createNamedParameter($itemType)),
                $queryBuilder->expr()->eq('item_uid', $itemUid)
            );
    }