Get an array of device interface types

@see $TYPES
@param boolean $translate If true, return the string representation
@return array An array of interface admin types
425526
public function types($translate = false) {
        $types = $this->getSNMP()->subOidWalk(self::OID_TYPE, 12);

        if (!$translate)
            return $types;

        return $this->getSNMP()->translate($types, self::$TYPES);
    }
1372295
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();
  }
762262
public function systemPowerState( $translate = false )
    {
        $states = $this->getSNMP()->get( self::OID_SYSTEM_POWER_STATE );

        if( !$translate )
            return $states;

        return $this->getSNMP()->translate( $states, self::$POWER_STATES );
    }
622899
public function getServiceNamesByType($types, $only_active = false)
    {
        $names = [];
        $map = $this->getServiceNameTypeMap($only_active);
        if (is_string($types)) {
            $types = array_map('trim', explode(',', trim($types, ',')));
        }
        foreach ($map as $name => $type) {
            if (false !== array_search($type, $types)) {
                $names[] = $name;
            }
        }

        return $names;
    }
347010
protected function getSolidityTypes($types)
    {
        if (!is_array($types)) {
            throw new InvalidArgumentException('Types must be array');
        }
        $solidityTypes = array_fill(0, count($types), 0);

        foreach ($types as $key => $type) {
            $match = [];

            if (preg_match('/^([a-zA-Z]+)/', $type, $match) === 1) {
                if (isset($this->types[$match[0]])) {
                    $className = $this->types[$match[0]];

                    if (call_user_func([$this->types[$match[0]], 'isType'], $type) === false) {
                        // check dynamic bytes
                        if ($match[0] === 'bytes') {
                            $className = $this->types['dynamicBytes'];
                        } else {
                            throw new InvalidArgumentException('Unsupport solidity parameter type: ' . $type);
                        }
                    }
                    $solidityTypes[$key] = $className;
                }
            }
        }
        return $solidityTypes;
    }
676519
public static function typeAncestry(FormInterface $form)
    {
        $types = [];
        self::typeAncestryForType($form->getConfig()->getType(), $types);

        return $types;
    }
721332
public function transform($translation)
    {
        $translation = $this->entityToArray(BlockTranslation::class, $translation);
        return [
            'id'           => (int) $translation['id'],
            'langCode'     => $translation['lang_code'],
            'title'        => $translation['title'],
            'body'         => $translation['body'],
            'customFields' => $this->transformCustomFields($translation),
            'isActive'     => (bool) $translation['is_active'],
            'createdAt'    => $translation['created_at'],
            'updatedAt'    => $translation['updated_at'],
        ];
    }
836489
public function states($translate = false) {
        $states = $this->getSNMP()->subOidWalk(self::OID_STATUS, 12);

        if (!$translate)
            return $states;

        return $this->getSNMP()->translate($states, self::$STATES);
    }
589400
public function getSupportedTypes( $disable_translation = false, $disable_custom = false ) {

		if ( $disable_translation ) {
			add_filter( 'gettext', [ $this, 'disableTranslation' ], 999, 3 );
		}

		// Supported
		$supported = [
			'public-domain' => [
				'api' => [
					'license' => 'mark',
					'commercial' => 'y',
					'derivatives' => 'y',
				],
				'url' => 'https://creativecommons.org/publicdomain/mark/1.0/',
				'desc' => __( 'Public Domain', 'pressbooks' ),
			],
			'cc-zero' => [
				'api' => [
					'license' => 'zero',
					'commercial' => 'y',
					'derivatives' => 'y',
				],
				'url' => 'https://creativecommons.org/publicdomain/zero/1.0/',
				'desc' => __( 'CC0 (Creative Commons Zero)', 'pressbooks' ),
			],
			'cc-by' => [
				'api' => [
					'license' => 'standard',
					'commercial' => 'y',
					'derivatives' => 'y',
				],
				'url' => 'https://creativecommons.org/licenses/by/4.0/',
				'desc' => __( 'CC BY (Attribution)', 'pressbooks' ),
				'longdesc' => __( 'Creative Commons Attribution 4.0 International License', 'pressbooks' ),
			],
			'cc-by-sa' => [
				'api' => [
					'license' => 'standard',
					'commercial' => 'y',
					'derivatives' => 'sa',
				],
				'url' => 'https://creativecommons.org/licenses/by-sa/4.0/',
				'desc' => __( 'CC BY-SA (Attribution ShareAlike)', 'pressbooks' ),
				'longdesc' => __( 'Creative Commons Attribution-ShareAlike 4.0 International License', 'pressbooks' ),
			],
			'cc-by-nd' => [
				'api' => [
					'license' => 'standard',
					'commercial' => 'y',
					'derivatives' => 'n',
				],
				'url' => 'https://creativecommons.org/licenses/by-nd/4.0/',
				'desc' => __( 'CC BY-ND (Attribution NoDerivatives)', 'pressbooks' ),
				'longdesc' => __( 'Creative Commons Attribution-NoDerivatives 4.0 International License', 'pressbooks' ),
			],
			'cc-by-nc' => [
				'api' => [
					'license' => 'standard',
					'commercial' => 'n',
					'derivatives' => 'y',
				],
				'url' => 'https://creativecommons.org/licenses/by-nc/4.0/',
				'desc' => __( 'CC BY-NC (Attribution NonCommercial)', 'pressbooks' ),
				'longdesc' => __( 'Creative Commons Attribution-NonCommercial 4.0 International License', 'pressbooks' ),
			],
			'cc-by-nc-sa' => [
				'api' => [
					'license' => 'standard',
					'commercial' => 'n',
					'derivatives' => 'sa',
				],
				'url' => 'https://creativecommons.org/licenses/by-nc-sa/4.0/',
				'desc' => __( 'CC BY-NC-SA (Attribution NonCommercial ShareAlike)', 'pressbooks' ),
				'longdesc' => __( 'Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License', 'pressbooks' ),
			],
			'cc-by-nc-nd' => [
				'api' => [
					'license' => 'standard',
					'commercial' => 'n',
					'derivatives' => 'n',
				],
				'url' => 'https://creativecommons.org/licenses/by-nc-nd/4.0/',
				'desc' => __( 'CC BY-NC-ND (Attribution NonCommercial NoDerivatives)', 'pressbooks' ),
				'longdesc' => __( 'Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License', 'pressbooks' ),
			],
			'all-rights-reserved' => [
				'api' => [], // Not supported
				'url' => 'https://choosealicense.com/no-license/',
				'desc' => __( 'All Rights Reserved', 'pressbooks' ),
			],
		];

		// Custom
		if ( ! $disable_custom ) {
			$custom = get_terms(
				[
					'taxonomy' => self::TAXONOMY,
					'hide_empty' => false,
				]
			);
			if ( is_array( $custom ) ) {
				foreach ( $custom as $custom_term ) {
					if ( ! isset( $supported[ $custom_term->slug ] ) ) {
						$supported[ $custom_term->slug ] = [
							'api' => [], // Not supported
							'url' => "https://choosealicense.com/no-license/#{$custom_term->slug}",
							'desc' => $custom_term->name,
						];
					}
				}
			}
		}

		if ( $disable_translation ) {
			remove_filter( 'gettext', [ $this, 'disableTranslation' ], 999 );
		}

		return $supported;
	}
1243211
public static function getMimeTypes($format)
    {
        if (null === static::$formats) {
            static::initializeFormats();
        }

        return isset(static::$formats[$format]) ? static::$formats[$format] : [];
    }
1312834
private function formExportList($domains, $force)
    {
        $output = [];
        $filters = array_filter([
            'messages.locale' => $this->getLocales(),
            'domain' => $domains
        ]);

        $translations = $this->translationManager->getAll($filters);

        /** @var Translation $translation */
        foreach ($translations as $translation) {
            $messages = $translation->getMessages();

            foreach ($messages as $key => $message) {
                if ($message->getStatus() === Message::DIRTY || $force) {
                    $path = sprintf(
                        '%s' . DIRECTORY_SEPARATOR . '%s.%s.%s',
                        $translation->getPath(),
                        'messages',
                        $message->getLocale(),
                        $translation->getFormat()
                    );
                    $output[$path][$translation->getKey()] = $message->getMessage();

                    $message->setStatus(Message::FRESH);
                    $this->refresh[] = $translation;
                }
            }
        }

        return $output;
    }
1223888
protected function getExportOption($key, $format)
    {
        if ('1.2.xliff' !== $format) {
            return;
        }

        $translate = true;

        if (in_array(
            $key,
            $this->seoAttributes
        )) {
            $translate = false;
        }

        return [
            'translate' => $translate,
        ];
    }
1079005
public static function getTypes($collection = false)
    {
        return array_merge($collection ? self::getCompoundTypes() : self::getSimpleTypes(), self::getEmptyTypes());
    }
969741
protected function getAdminExtensionReferenceByTypes(array $types)
    {
        $references = [];
        foreach ($types as $type) {
            $references[$type] = new Reference('sonata_translation.admin.extension.'.$type.'_translatable');
        }

        return $references;
    }
579431
public function geti18nTypes()
    {
        $i18nTypes = [];
        // Get translatable labels
        foreach ($this->Types as $key => $label) {
            $i18nTypes[$key] = _t(__CLASS__ . '.TYPE'.strtoupper($key), $label);
        }
        $this->extend('updatei18nTypes', $i18nTypes);
        return $i18nTypes;
    }
1029563
protected function getSuggestedTypes($type)
    {
        $mapping = [
            'void'    => false,
            'mixed'   => false,
            'null'    => false,
            'int'     => 'int',
            'integer' => 'int',
            'string'  => 'string',
            'float'   => 'float',
            'bool'    => 'bool',
            'boolean' => 'bool',
        ];

        $typeNames = explode('|', $type);
        return array_unique(
            array_map(
                function ($typeName) use ($mapping) {
                    if (isset($mapping[$typeName])) {
                        return $mapping[$typeName];
                    }

                    if ($this->isTypeArray($typeName)) {
                        return 'array';
                    }

                    if ($this->isTypeCallable($typeName)) {
                        return 'callable';
                    }

                    if ($this->isTypeObject($typeName)) {
                        return $typeName;
                    }

                    return false;
                },
                $typeNames
            )
        );
    }
582639
private function getTypes($middleware)
    {
        $types = [];

        if ($middleware instanceof PrepareableInterface) {
            $types[] = 'prepareable';
        }
        if ($middleware instanceof RespondableInterface) {
            $types[] = 'respondable';
        }
        if ($middleware instanceof CloseableInterface) {
            $types[] = 'closeable';
        }

        return $types;
    }