I have pasted both model class and resultset, please help me to findout why not working
namespace Yesse\Model;
use Phalcon\Mvc\Model;
class Account extends Model {
public function initialize() {
$this->setSource( "accounts" );
$this->hasMany( 'id', 'Yesse\Model\AccountDomains', 'accounts_id' );
}
}
use Phalcon\Mvc\Model;
class AccountDomains extends Model {
protected $id;
protected $account_id;
protected $username;
public function initialize() {
$this->setSource( "account_domains" );
$this->belongsTo( "account_id", "Yesse\Model\Account", "id", array( 'alias' => 'accountDomains' ) );
}
}
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
(
[adapter] => Mysql
[host] => 127.0.0.1
[username] => root
[password] => 123
[dbname] => yesse
)
[_dialect:protected] => Phalcon\Db\Dialect\Mysql Object
(
[_customFunctions:protected] =>
[_escapeChar:protected] => `
)
[_connectionId:protected] => 0
[_sqlStatement:protected] =>
[_sqlVariables:protected] =>
[_sqlBindTypes:protected] =>
[_transactionLevel:protected] => 0
[_transactionsWithSavepoints:protected] =>
[_pdo:protected] => PDO Object
(
)
[_affectedRows:protected] =>
[_type:protected] => mysql
[_dialectType:protected] => mysql
)
[_result:protected] =>
[_fetchMode:protected] => 2
[_pdoStatement:protected] => PDOStatement Object
(
[queryString] => SELECT `accounts`.`id`, `accounts`.`name`, `accounts`.`username`, `accounts`.`created_at` FROM `accounts`
)
[_sqlStatement:protected] => SELECT `accounts`.`id`, `accounts`.`name`, `accounts`.`username`, `accounts`.`created_at` FROM `accounts`
[_bindParams:protected] =>
[_bindTypes:protected] =>
[_rowCount:protected] => 2
)
[_cache:protected] =>
[_isFresh:protected] => 1
[_pointer:protected] => 0
[_count:protected] => 2
[_activeRow:protected] =>
[_rows:protected] => Array
(
[0] => Array
(
[id] => 1
[name] => demo
[username] => demo
[created_at] => 2016-04-27 00:00:00
)
[1] => Array
(
[id] => 2
[name] => demo2
[username] => demo2
[created_at] => 2016-04-27 00:00:00
)
)
[_row:protected] =>