@param Type $type

@return Site[]
547784
public function getByType(Type $type)
    {
        $sites = $this->entityManager->getRepository('Concrete\Core\Entity\Site\Site')
            ->findByType($type);
        $return = [];
        foreach ($sites as $site) {
            $factory = new Factory($this->config);
            $return[] = $factory->createEntity($site);
        }

        return $return;
    }
773918
public function getCert(string $type): array
    {
        $type = mb_strtolower($type);
        $this->throwIfNotInArray($type, self::CERTS);
        return $this->_certs[$type] ?? [];
    }
1223577
public function getMiddlewares(string $type = self::BEFORE) : array
  {
    $type = self::validateMiddlewareType($type);
    return $this->middlewares[$type];
  }
867339
protected function getAllowedFields(string $type): array
    {
        \assert($this->hasFilter($type) === true);

        return $this->fieldSets[$type];
    }
1123876
private function getExtendAnnotations(int $type = 1): array
    {
        $annotations = [];
        foreach ($this->extends as $extend) {
            if ($type == 1) {
                $extendAnnoation = $extend->getClassAnnotations();
            } elseif ($type == 2) {
                $extendAnnoation = $extend->getPropertyAnnotations();
            } else {
                $extendAnnoation = $extend->getMethodAnnotations();
            }
            $annotations = array_merge($annotations, $extendAnnoation);
        }

        return $annotations;
    }
873237
public function query(Many $type): array
    {
        $this->name = $type->name;
        $this->description = $type->description;
        $this->entity = $type;

        $this->checkPermission(Post::POST_PERMISSION_PREFIX.$type->slug);

        $this->grid = $type->grid();
        $this->filters = $type->filters();

        return [
            'data' => $type->get(),
        ];
    }
958050
public function getAllPrivilegesByType($type)
    {
        $this->initialize();
        $privileges = [];
        foreach ($this->roles as $role) {
            $privileges = array_merge($privileges, $role->getPrivilegesByType($type));
        }
        return $privileges;
    }
244999
protected function getMessages(string $type): array
    {
        $messages = [];
        $suites = $this->isSingle ? $this->suites : $this->suites[0]->suites;
        foreach ($suites as $suite) {
            $messages = array_merge($messages, array_reduce($suite->cases, function ($result, $case) use ($type) {
                return array_merge($result, array_reduce($case->$type, function ($msgs, $msg) {
                    $msgs[] = $msg['text'];

                    return $msgs;
                }, []));
            }, []));
        }

        return $messages;
    }
297300
public function get(string $type): array
    {
        if (!isset($this->values[$type])) {
            return [];
        }

        return $this->values[$type];
    }
922744
protected function _getCacheTypeArguments( $type )
    {
        switch ( $type )
        {
            case CacheTypes::FILE_SYSTEM:
            case CacheTypes::JSON_FILE:
            case CacheTypes::PHP_FILE:
                $_directory = $this->_findCachePath();

                if ( !is_dir( $_directory ) )
                {
                    @mkdir( $_directory, 0777, true );
                }

                return array($_directory, static::DEFAULT_CACHE_EXTENSION);
        }

        return array();
    }
919297
protected function getIndexes($type) {
		$table = $this->safeTable($type, true);
		$indexes = $this->adapter->get("PRAGMA index_list('$table')");
		$indexInfoList = array();
		foreach($indexes as $i) {
			$indexInfoList[$i['name']] = $this->adapter->getRow("PRAGMA index_info('{$i['name']}') ");
			$indexInfoList[$i['name']]['unique'] = $i['unique'];
		}
		return $indexInfoList;
	}
880283
public static function getAssetFilePaths($type)
    {
        $path = sprintf('%s/assets/%s/', __DIR__, $type);
        $filenames = preg_grep('/^[^\.]/', scandir($path));
        if (!Arr::iterable($filenames)) {
            return array();
        }

        return array_map(function ($filename) use ($path) {
            return $path.$filename;
        }, $filenames);
    }
395415
public function columnsByType(int $type) : array
    {
        $n = $this->numColumns();

        $columns = [];

        for ($i = 0; $i < $n; $i++) {
            if ($this->columnType($i) === $type) {
                $columns[$i] = $this->column($i);
            }
        }

        return $columns;
    }
837402
protected function _allOfType(int $type): array
    {
        return array_values(
            array_filter($this->_targets,
                function (Target $target) use ($type) {
                    return $target->type() == $type;
                }));
    }
1044642
public function getMapping($index, $type)
    {
        $mappings = $this->getMappings($index);

        if (!isset($mappings[$type])) {
            return null;
        }

        if (!isset($mappings[$type]['properties'])) {
            return [];
        }

        return $mappings[$type]['properties'];
    }
1306494
public function lists($type = null)
    {
        $params = [
            'type' => $type,
        ];

        return $this->parseJSON('get', [self::API_LISTS, $params]);
    }
575533
public function getFilteredDefinitions($type) {
    $all = $this->getDefinitions();

    return array_filter($all, function ($definition) use ($type) {
      return $definition['type'] === $type;
    });
  }