public function hasType($type) { if ($type instanceof Type) { $type = $type->getName(); } return in_array($type, $this->_types); }