Subject: how to check the existence of a connection
class Guest extends ActiveRecord\Model {
static $table_name = 'guest';
static $belongs_to = array( array('user') );}// model User.php public function getLogin(){ return $this->users_login ? $this->users_login : 'no user'; }
//and if you delete the user, but leave him messages//trying to get the user name through communications$post->user->getLogin();
//displays an errorCall to a member function getLogin() on a non-object
tell me how to solve this problem
June 27 2010
April 16, 2013
Subject: how to check the existence of a connection
class Guest extends ActiveRecord\Model {
//and if you delete the user, but leave him messages
//trying to get the user name through communications
$post->user->getLogin();
//displays an error
Call to a member function getLogin() on a non-object
tell me how to solve this problem