public function getAllInterfaces($types = self::FULL_HIERARCHY) {
    if ($types & self::WITH_OWN) {
      $interfaces = clone $this->interfaces;
    } else {
      $interfaces = new GObjectCollection(array());
    }
    
    if (($types & self::WITH_PARENTS) && ($parent = $this->getParent()) != NULL) {
      $parentTypes = $types | self::WITH_OWN;
      foreach ($parent->getAllInterfaces($parentTypes) as $interface) {
        if (!$interfaces->has($interface)) {
          $interfaces->add($interface);
        }
      }
    }
    
    return $interfaces->toArray();
  }