I have table and have to pull out some stuff from Model "Alerts" . The problem is that I am seeingn whole lot of things in my resultset apart of query answer. Since I am new to phalcon or any framework, I suppose its better to get the pointer hence, asking here.
$alerts = Alerts::find(
[
'conditions' => 'completed = :completed: AND time < :currentTime: ',
'bind' =>
[
'completed' => 0,
'currentTime' => $currentTime
]
]);
It takes out stuff as I need but I can't iterate on result object as I see in $alerts is whole PDO object or what should I call .. here it is.
Phalcon\Mvc\Model\Resultset\Simple Object
(
[_result:protected] => Phalcon\Db\Result\Pdo Object
(
[_connection:protected] => Phalcon\Db\Adapter\Pdo\Mysql Object
(
[_eventsManager:protected] =>
[_descriptor:protected] => Array
(
[host] => 127.0.0.1
[username] => root
[password] => somepass
[dbname] => vdbuser
)
[_dialect:protected] => Phalcon\Db\Dialect\Mysql Object
(
[_customFunctions:protected] =>
[_escapeChar:protected] => `
)
[_connectionId:protected] => 0
[_sqlStatement:protected] =>
[_sqlVariables:protected] =>
There is also my result of interest somewhere :
[_cache:protected] =>
[_isFresh:protected] => 1
[_pointer:protected] => 0
[_count:protected] => 8
[_activeRow:protected] =>
[_rows:protected] => Array
(
[0] => Array
(
[id] => 2
[reminderName] => Ankit Chauhan
[type] => event
[time] =>
[mode] => email
[email] => [email protected]
[phone] => 9098098099
[userId] => 3
[frequency] => weekly
[lastRun] =>
[completed] => 0
)
[1] => Array
(
[id] => 3
[reminderName] => Ankit Ravindra
[type] => goal
[time] =>
[mode] => email
[email] => [email protected]
[phone] => 9098098099
[userId] => 3
[frequency] => weekly
[lastRun] =>
[completed] => 0
)
[2] => Array ......
So how do I get only desired result in $alert ?