public function applyRoleMask(CNabuRole $nb_role, array $additional = null)
    {
        $total = $this->getSize();
        $count = 0;
        $this->iterate(function($key, INabuRoleMask $item) use($count, $nb_role, $additional) {
            if ($item->applyRoleMask($nb_role, $additional)) {
                $count++;
            } else {
                $this->removeItem($item);
            }
            return true;
        });

        $this->role_applied = true;

        return $total === 0 || ($count > 0 && $count <= $total);
    }
public function applyRoleMask(CNabuRole $nb_role, array $additional = null)
    {
        $total = $this->getSize();
        $count = 0;
        $this->iterate(function($key, INabuRoleMask $item) use($count, $nb_role, $additional) {
            if ($item->applyRoleMask($nb_role, $additional)) {
                $count++;
            } else {
                $this->removeItem($item);
            }
            return true;
        });

        $this->role_applied = true;

        return $total === 0 || ($count > 0 && $count <= $total);
    }
public function applyRoleMask ( CNabuRole $ nb_role , array $ additional = null ) { $ total = $ this -> getSize ( ) ; $ count = 0 ; $ this -> iterate ( function ( $ key , INabuRoleMask $ item ) use ( $ count , $ nb_role , $ additional ) { if ( $ item -> applyRoleMask ( $ nb_role , $ additional ) ) { $ count ++ ; } else { $ this -> removeItem ( $ item ) ; } return true ; } ) ; $ this -> role_applied = true ; return $ total === 0 || ( $ count > 0 && $ count <= $ total ) ; }
Applies Role policies to this list. All items that does not accomplishes the policies are removed.
@param CNabuRole $nb_role Role instance to be applied.
@param array $additional Additional data to be considered. The treatment of this data depends on the
class representing each item.
@return int Return the number of items that accomplished policies.
Applies Role policies to this list . All items that does not accomplishes the policies are removed .