Closed scruwi closed 8 years ago
If model relations fully configured, Orm\Model::related_class('profile') is working:
Orm\Model::related_class('profile')
class Model_User extends Orm\Model { protected static $_has_one = array( 'profile' => array( 'key_from' => 'id', 'model_to' => 'Model_Profile', 'key_to' => 'user_id', 'cascade_save' => true, 'cascade_delete' => false, ) ); } $rel_name = Model_User::related_class('profile'); // Model_Profile
but if there a short config - return NULL:
NULL
class Model_User extends Orm\Model { `protected static $_has_one = array('profile');` } $rel_name = Model_User::related_class('profile'); // NULL
If model relations fully configured,
Orm\Model::related_class('profile')
is working:but if there a short config - return
NULL
: