public function setRoles()
    {
        $this->roles = [];
        if (null !== $records = $this->select()) {
            foreach ($records as $record) {
                $this->roles[(int) $record['id']] = $record['role'];
            }
        }
    }
public function setRoles()
    {
        $this->roles = [];
        if (null !== $records = $this->select()) {
            foreach ($records as $record) {
                $this->roles[(int) $record['id']] = $record['role'];
            }
        }
    }
public function setRoles ( ) { $ this -> roles = [ ] ; if ( null !== $ records = $ this -> select ( ) ) { foreach ( $ records as $ record ) { $ this -> roles [ ( int ) $ record [ 'id' ] ] = $ record [ 'role' ] ; } } }
this is called by constructor and also should be called after a change to roles from single page app to reset them.
this is called by constructor and also should be called after a change to roles from single page app to reset them .