Я пытаюсь var_dump результат (только строки базы данных) запроса select.zf2 Как var_dump результат select
У меня есть простой TableGateway (Facotry service_manager)
public function shwoContactFormMessages)
{
$select = new Select();
$select->from(self::$tableName);
return $this->selectWith($select);
}
МОЯ Контроллер:
public function fooAction()
{
$test = $this->contactFormTable->shwoContactFormMessages();
var_dump($test);
// This will show the results the column and it is working
while ($item = $test->current())
{
echo $item->messageFrom . "<br>";
}
return $view;
}
Результат var_dump ($ тест):
object(Zend\Db\ResultSet\ResultSet)#327 (8) {
["allowedReturnTypes":protected]=>
array(2) {
[0]=>
string(11) "arrayobject"
[1]=>
string(5) "array"
}
["arrayObjectPrototype":protected]=>
object(ArrayObject)#302 (1) {
["storage":"ArrayObject":private]=>
array(0) {
}
}
["returnType":protected]=>
string(11) "arrayobject"
["buffer":protected]=>
NULL
["count":protected]=>
int(5)
["dataSource":protected]=>
object(Zend\Db\Adapter\Driver\Pdo\Result)#326 (8) {
["statementMode":protected]=>
string(7) "forward"
["resource":protected]=>
object(PDOStatement)#307 (1) {
["queryString"]=>
string(49) "SELECT `hw_contact_form`.* FROM `hw_contact_form`"
}
["options":protected]=>
NULL
["currentComplete":protected]=>
bool(false)
["currentData":protected]=>
NULL
["position":protected]=>
int(-1)
["generatedValue":protected]=>
string(1) "0"
["rowCount":protected]=>
int(5)
}
["fieldCount":protected]=>
int(8)
["position":protected]=>
int(0)
}
Я хотел бы var_dump только строки базы данных вместо указанного объекта.
Большое спасибо, я использую его, чтобы проверить результат и работать с именами столбцов. – Haver