Get next sequence number

@param string|null $type
simple
advanced
@return array
16365
public function nextval($type = null) {
		$result = $this->getByType('nextval');
		if (!empty($type)) {
			return $result[$type];
		}
		return $result;
	}
1210000
public function knownExtensions($type = null)
    {
        $extensions = [
            'images'   => static::$imageExtensions,
            'audios'    => static::$audiosExtensions,
            'archives' => static::$archivesExtensions,
            'videos'   => static::$videosExtensions,
        ];

        if ($type) {
            if (in_array($type, array_keys($extensions))) {
                return $extensions[$type];
            }

            return null;
        }

        return $extensions;
    }
1024613
protected function getFirstGroup($type, $minLevel)
    {
        $i = $this->groupLevel;
        while ($i--) {
            $group = $this->groups[$i];

            if ($group->type === $type && $i >= $minLevel) {
                return $group;
            }
        }

        return null;
    }
14895
public function _nextSequence($sequence)
    {
        $sequence = strtoupper($sequence);
        $id = $this->_lockSequence($sequence);
        $increment = $this->_connection->execute(
            "UPDATE sequences SET id=id+1 WHERE name=?", $sequence);

        return $id;
    }
1049792
protected static function _getList($type) {
        $types = array();

        foreach (self::$_types as $ext => $mimeType) {
            if (is_array($mimeType)) {
                $mimeType = $mimeType[0];
            }

            if (strpos($mimeType, $type) === 0) {
                $types[$ext] = $mimeType;
            }
        }

        return $types;
    }
1023620
protected function findNextMessages($types)
    {
        return $this->messageManager->findByTypes($types, MessageInterface::STATE_OPEN, $this->batchSize);
    }
475951
public function getIndex($type = null)
	{
		$container = Input::get('c');
		$files = Input::get('files', '');
		
		if (empty($type) || !in_array($type, array('style', 'script'))) {
			App::abort(404);
		}
		
		if (empty($container)) {
			App::abort(404);
		}
		
		$files = json_decode(base64_decode($files), true);
		if (empty($files) || !is_array($files)) {
			App::abort(404);
		}
		
		foreach ($files as $file) {
			Facades\Casset::container($container)->add(
				array_get($file, 'source'),
				array(),
				array_get($file, 'dependencies', array())
			);
		}
		
		$response = Response::make(Facades\Casset::container($container)->content($type));
		
		if ('style' == $type) {
			$response->headers->set('Content-Type', 'text/css');
		}
		else {
			
			$response->headers->set('Content-Type', 'application/json');
		}
		
		return $response;
	}
94079
protected function getMessagesForRender($type = null)
    {
        if (is_null($type)) {
            if (count($this->groupForRender) > 0) {
                $messages = array();

                foreach ($this->groupForRender as $typeToRender) {
                    $messages = array_merge($messages, $this->get($typeToRender)->all());
                }

                return new Collection($messages);
            }

            return $this->all();
        }
        return $this->get($type);
    }
1202323
public static function getTypeName($type = null)
    {
        $result = [
            Item::TYPE_PERMISSION => 'Permission',
            Item::TYPE_ROLE => 'Role',
        ];
        if ($type === null) {
            return $result;
        }

        return $result[$type];
    }
1251923
public function first($type = 'object')
    {
        $data = self::query($type);
        if (Collection::count($data) > 0) {
            return $data[0];
        }
    }
1103454
public function getNumberOfEnabledPages($type)
    {
        return $this
            ->createQueryBuilder('p')
            ->select('COUNT(p)')
            ->where('p.enabled = :enabled')
            ->andWhere('p.type = :type')
            ->setParameters([
                'enabled' => true,
                'type' => $type,
            ])
            ->getQuery()
            ->getSingleScalarResult();
    }
1137531
public function get($type = null)
    {
        $result = [];

        foreach ($this->session[$this->prefix] as $offset => $message) {
            if ($type === null || $message['type'] === $type) {
                $result[] = $message;
                unset($this->session[$this->prefix][$offset]);
            }
        }

        return $result;
    }
257707
static public function getNamespaces($type=null)
	{
	    static::initNamespace();
	    
	    if ($type) {
	        $nss = [];
	        foreach (static::$namespaces as $k => $v) {
	            $nss[$k] = $v . ucfirst($type) . '\\';
	        }
	        return $nss;
	    } else {
	        return static::$namespaces;
	    }
	}
591517
public function getTags(int $type = null): array
    {
        if ($type === null) {
            return $this->tags;
        }

        return array_filter($this->tags, function (Tag $tag) use ($type): bool {
            return $tag->getType() === $type;
        });
    }
102546
public static function getSubType($type)
    {
        if (preg_match('/^(.+)\[\]$/', $type, $matches) || preg_match('/^_(.+)$/', $type, $matches)) {
            return $matches[1];
        }

        return $type;
    }
304677
private function resolveTypes($type)
    {
        $sortTypes = [];

        do {
            $sortTypes[] = $sortType = $this->sortRegistry[$type];
        } while (($type = $sortType->getParent()) !== null);

        return $sortTypes;
    }
64175
public function currval($type = null) {
		$result = $this->getByType('currval');
		if (!empty($type)) {
			return $result[$type];
		}
		return $result;
	}