GDS\Store::fetchOne PHP Method

fetchOne() public method

Fetch ONE Entity based on a GQL query
public fetchOne ( $str_query = null, array | null $arr_params = null ) : Entity
$str_query
$arr_params array | null
return Entity
    public function fetchOne($str_query = null, $arr_params = null)
    {
        if (null !== $str_query) {
            $this->query($str_query, $arr_params);
        }
        $arr_results = $this->obj_gateway->withSchema($this->obj_schema)->withTransaction($this->str_transaction_id)->gql($this->str_last_query . ' LIMIT 1', $this->arr_last_params);
        return count($arr_results) > 0 ? $arr_results[0] : null;
    }