original_string: public function assign($userId, $name)
      {
          if ($this->searchRoleRecursive($this->roles, $name)) {
              $exists = $this->db->exists('rbac_user', ['user' => $userId, 'role' => $name]);
              if (!$exists) {
                  return $this->db->insert('rbac_user', ['role' => $name, 'user' => $userId]);
              }
          }
  
          return false;
      }
code: public function assign($userId, $name)
      {
          if ($this->searchRoleRecursive($this->roles, $name)) {
              $exists = $this->db->exists('rbac_user', ['user' => $userId, 'role' => $name]);
              if (!$exists) {
                  return $this->db->insert('rbac_user', ['role' => $name, 'user' => $userId]);
              }
          }
  
          return false;
      }
code_tokens: public function assign ( $ userId , $ name ) { if ( $ this -> searchRoleRecursive ( $ this -> roles , $ name ) ) { $ exists = $ this -> db -> exists ( 'rbac_user' , [ 'user' => $ userId , 'role' => $ name ] ) ; if ( ! $ exists ) { return $ this -> db -> insert ( 'rbac_user' , [ 'role' => $ name , 'user' => $ userId ] ) ; } } return false ; }
docstring: Assign RBAC element into user
  
  @access public
  
  @param integer $userId user id
  @param string $name element name
  
  @return bool
docstring_tokens: Assign RBAC element into user