public function findWith(QueryBuilder $query)
    {
        $this->load($query);

        $result = $query->execute()->fetchAll();
        if ($result) {
            return $this->hydrateAll($result, $query);
        }

        return [];
    }
public function findWith(QueryBuilder $query)
    {
        $this->load($query);

        $result = $query->execute()->fetchAll();
        if ($result) {
            return $this->hydrateAll($result, $query);
        }

        return [];
    }
public function findWith ( QueryBuilder $ query ) { $ this -> load ( $ query ) ; $ result = $ query -> execute ( ) -> fetchAll ( ) ; if ( $ result ) { return $ this -> hydrateAll ( $ result , $ query ) ; } return [ ] ; }
Method to hydrate and return a QueryBuilder query.

@param QueryBuilder $query

@return array Entity
Method to hydrate and return a QueryBuilder query .