src/PostgreSQL.php
public function executeAndFetch($query, $parameters = [], $castModel = null)
    {
        $statement = $this->link->prepare($query);

        $statement->execute($parameters);
        $data = $statement->fetch(PDO::FETCH_ASSOC);
        $statement->closeCursor();

        return (
            $castModel && $data
            ? $data
            : $data
        );
    }
public function executeAndFetch($query, $parameters = [], $castModel = null)
    {
        $statement = $this->link->prepare($query);

        $statement->execute($parameters);
        $data = $statement->fetch(PDO::FETCH_ASSOC);
        $statement->closeCursor();

        return (
            $castModel && $data
            ? $data
            : $data
        );
    }
public function executeAndFetch ( $ query , $ parameters = [ ] , $ castModel = null ) { $ statement = $ this -> link -> prepare ( $ query ) ; $ statement -> execute ( $ parameters ) ; $ data = $ statement -> fetch ( PDO :: FETCH_ASSOC ) ; $ statement -> closeCursor ( ) ; return ( $ castModel && $ data ? $ data : $ data ) ; }
Execute a query and fetch first row as associative array

@param  string $query
@param  array  $parameters Query parameters
@return array Returns a single row from database
@throws \Phramework\Exceptions\DatabaseException
Execute a query and fetch first row as associative array