public function getFirstParent($role=null, $type=null, $values=null, $properties=null, $useRegExp=true) {

    $parents = $this->getParentsEx(null, $role, $type, $values, $properties, $useRegExp);
    if (sizeof($parents) > 0) {
      return $parents[0];
    }
    else {
      return null;
    }
  }