src/Koldy/Db/Query.php
public function fetchAllObj(string $class = null): array
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        if ($class === null) {
            return $this->getAdapter()->getStatement()->fetchAll(\PDO::FETCH_OBJ);
        } else {
            $objectInstances = [];

            foreach ($this->fetchAll() as $r) {
                $objectInstances[] = new $class($r);
            }

            return $objectInstances;
        }
    }
public function fetchAllObj(string $class = null): array
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        if ($class === null) {
            return $this->getAdapter()->getStatement()->fetchAll(\PDO::FETCH_OBJ);
        } else {
            $objectInstances = [];

            foreach ($this->fetchAll() as $r) {
                $objectInstances[] = new $class($r);
            }

            return $objectInstances;
        }
    }
public function fetchAllObj ( string $ class = null ) : array { if ( ! $ this -> wasExecuted ( ) ) { $ this -> exec ( ) ; } if ( $ class === null ) { return $ this -> getAdapter ( ) -> getStatement ( ) -> fetchAll ( \ PDO :: FETCH_OBJ ) ; } else { $ objectInstances = [ ] ; foreach ( $ this -> fetchAll ( ) as $ r ) { $ objectInstances [ ] = new $ class ( $ r ) ; } return $ objectInstances ; } }
Fetch all results from this query and get array of stdClass instances or your custom class instances

@param string $class

@return array
@throws QueryException
@throws \Koldy\Exception
Fetch all results from this query and get array of stdClass instances or your custom class instances