As i am trying to retrieve the records from postgresql database using ZF3 with Pdo adaptor.
But always am getting empty result but field count is shows right one and querystring also proper one,where am able to run directly on CLI.
Yeah, the problem is you ResultSet::arrayObjectPrototype (Application\Model\Users).
It’s must be extend ArrayObject, or implement toArray or getArrayCopy method, if you are use the default Zend\Db\ResultSet\ResultSet.
Second way. You can try use the Zend\Db\ResultSet\HydratingResultSet. This is HydratingResultSet simple code block.
$resultSet = new \Zend\Db\ResultSet\HydratingResultSet(new \Zend\Hydrator\ClassMethods, new UserEntity);
class UserEntity {
protected $userId;
protected $username;
protected $password;
public function getUserId(){ return $this->userId; }
public function setUserId($userId){ $this->userId = $userId; }
public function getUsername(){ return $this->username; }
public function setUsername($username) { $this->username = $username; }
public function getPassword() { return $this->password; }
public function setPassword($password) { $this->password = $password; }
}
As i trying to extend Class with ArrayObject or trying to use HydratingResultSet. But both cases am getting Internal Server Error without any error in detail.
Even already enabled all php_reporting as well.
Let me know how to enable debugging at first to identify the issue.