code: protected function getAttributeImplementing($interface)
      {
          $result = array();
          foreach ($this->getAttributes() as $colName => $attribute) {
              if ($attribute instanceof $interface) {
                  $result[$colName] = $attribute;
              }
          }
  
          return $result;
      }
docs: Retrieve all attributes implementing the given interface.
  
  @param string $interface The interface name.
  
  @return array