Here 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 return 1,the role_id
field can not update...
help plz..