protected function isTypeInNames($type, $profile, array $names)
    {
        return in_array($type->name, $names) &&
               (($type->profile === null) ? true : ($type->profile == $profile));
    }