public function fetchRelations(string $sql, array $params = [])
    {
        $stmt = $this->prepare($sql, $params);

        $result = $stmt->fetchAll(\PDO::FETCH_ASSOC);

        // prepare results
        $result = Relations::fetch($result);

        $stmt->closeCursor();
        $this->ok();
        return $result;
    }
public function fetchRelations(string $sql, array $params = [])
    {
        $stmt = $this->prepare($sql, $params);

        $result = $stmt->fetchAll(\PDO::FETCH_ASSOC);

        // prepare results
        $result = Relations::fetch($result);

        $stmt->closeCursor();
        $this->ok();
        return $result;
    }
public function fetchRelations ( string $ sql , array $ params = [ ] ) { $ stmt = $ this -> prepare ( $ sql , $ params ) ; $ result = $ stmt -> fetchAll ( \ PDO :: FETCH_ASSOC ) ; // prepare results $ result = Relations :: fetch ( $ result ) ; $ stmt -> closeCursor ( ) ; $ this -> ok ( ) ; return $ result ; }
Returns an array of linked objects containing the result set

@param  string $sql    SQL query with placeholders
"SELECT '__users', u.*, '__users_profile', up.*
FROM users u
LEFT JOIN users_profile up ON up.userId = u.id
WHERE u.name = :name"
@param  array  $params params for query placeholders (optional)
array (':name' => 'John')

@return array|false
@throws DbException
Returns an array of linked objects containing the result set