Here I have 4 tables Admins, Roles, RolePermissions, RoleResources
Definition below:
Admins
public function initialize() {
$this->belongsTo('role_id','Mallex\Mvc\Models\Roles','id',array('alias' => 'Role'));
}
Roles
public function initialize() {
$this->hasMany('id','Mallex\Mvc\Models\Admins','role_id',array('alias' => 'Admins'));
$this->hasOne('id','Mallex\Mvc\Models\RoleResources','role_id',array('alias' => 'RoleResource'));
$this->hasOne('id','Mallex\Mvc\Models\RolePermissions','role_id',array('alias' => 'RolePermission'));
}
RolePermissions
public function initialize() {
$this->belongsTo('role_id','Mallex\Mvc\Models\Roles','id',array('alias' => 'Role'));
}
RoleResources
public function initialize() {
$this->belongsTo('role_id','Mallex\Mvc\Models\Roles','id',array('alias' => 'Role'));
}
and now, I want to update admin's role_id
, it is always returning 1, the role_id
field cannot be updated...
Help plz..