Создает меню

@param string $alias алиас меню
@param string $name название меню
@return Menu
@throws Exception\CMS
771105
public static function create() 
    {
		$alias = func_get_arg(0);
		$name = func_get_arg(1);
		
        try {
            $m = self::getByAlias($alias);
        } catch (\Exception $e) {}
        
        if ($m) throw new Exception\CMS('Меню c таким алиасом уже существует.');
        
        self::getDbConnection()->insert('menus', array(
			'alias' => $alias,
			'name'  => $name
		));
  		return self::getById( self::getDbConnection()->lastInsertId() );
  	}
39542
public function alias($alias)
    {
        $this->alias = $alias;

        if (!in_array('`' . $alias . '`.*', $this->select)) {
            $this->select[] = '`' . $alias . '`.*';
        }

        if (in_array('`' . $this->table . '`.*', $this->select)) {
            unset($this->select[array_search('`' . $this->table . '`.*', $this->select)]);
        }

        return $this;
    }
1114310
protected function _addMenu($name, $options)
    {
        $requstParams = $this->Controller->request->params;
        if (key_exists('prefix', $requstParams) && $requstParams['prefix'] == 'admin') {
            $this->Controller->Menu->add($options['alias'], [
                'url' => [
                    'prefix' => 'admin',
                    'plugin' => 'PostTypes',
                    'controller' => 'PostTypes',
                    'action' => 'index',
                    'type' => lcfirst($name),
                ]
            ]);
        }
    }
1299821
public function column($name, string $alias = null): self
    {
        $this->sql->addColumn($name, $alias);
        return $this;
    }
822749
public static function create($name, $alias, $url) : self
    {
        $self = new static();
        $self->name  = $name;
        $self->alias = $alias;
        $self->url   = $url;
        $self->created_by = Yii::$app->user->identity->id;
        $self->updated_by = Yii::$app->user->identity->id;
        return $self;
    }
910316
public function columnSet($name,&$alias=null)
	{
		if( is_null($alias) )
		{
			$alias = $name;
			$this->setColumns($name, $this->getAlias());
		}
		else
		{
			$this->setColumns(array($alias=>$name), $this->getAlias());
		}
		$this->addSetting($alias,self::settingDefaultGet($name));
		return $this;
	}
10551
public function removeAction($name)
    {

        if (isset($this->actions[$name])) {
            unset($this->actions[$name]);
        }

        return $this;
    }
1004306
public function addAlias($name, $alias, $shared = null)
    {
        return $this->add($name, $alias, self::ENTRY_TYPE_ALIAS, $shared);
    }
924161
public final function alias($alias) {
        $this->alias         = $alias;
        $this->qualifiedName = $this->table . ' AS ' . $this->alias;

        return $this;
    }
1084067
public function alias(string $name, string $alias): ManagerInterface
    {
        if (!$this->isRegistered($name)) {
            throw RegisterException::missing($name);
        }
        if ($this[$name] instanceof AliasInterface) {
            $this[$name]->alias($alias);
        } else {
            throw RegisterException::noAlias();
        }

        if (!$this[$name] instanceof ContainerAwareInterface) {
            parent::register($this[$name], $alias);
        }

        return $this;
    }
974670
public function getAliasNamespace($alias)
    {
        foreach (array_keys($this->getManagers()) as $name) {
            try {
                return $this->getManager($name)->getConfiguration()->getDocumentNamespace($alias);
            } catch (PHPCRException $e) {
            }
        }

        throw PHPCRException::unknownDocumentNamespace($alias);
    }
829502
public function remove($name)
    {
        if (isset($this->aliasIndex[$name])) {
            $this->remove($this->aliasIndex[$name]);

            return;
        }

        if (isset($this->shortNameIndex[$name])) {
            $this->remove($this->shortNameIndex[$name]);

            return;
        }

        unset($this->commands[$name]);

        foreach ($this->shortNameIndex as $shortName => $targetName) {
            if ($name === $targetName) {
                unset($this->shortNameIndex[$shortName]);
            }
        }

        foreach ($this->aliasIndex as $alias => $targetName) {
            if ($name === $targetName) {
                unset($this->aliasIndex[$alias]);
            }
        }
    }
1262037
public static function create($alias = null)
    {
        $card = new static();

        $response = (new AuthorizationBuilder(TransactionType::ALIAS, $card))
            ->withAlias(AliasAction::CREATE, $alias)
            ->execute();

        if ($response->responseCode === '00') {
            return $response->giftCard;
        }

        throw new ApiException($response->responseMessage);
    }
818826
public static function getMenu($alias, $ordered = false)
    {
        if (!isset(self::$_menus[$alias])) {
            throw new Exception(__d('wasabi_core', 'No menu with alias "{0}" does exist.', $alias));
        }
        if (!$ordered) {
            return self::$_menus[$alias];
        }

        return self::$_menus[$alias]->getOrderedArray();
    }
477960
protected function addTabMenuItem($name)
    {
        if (is_object($name)) {
            $tab = $name;
        } else {
            $tab = new Tab($name);
        }

        $tab = $this->add([$tab, 'class' => ['item']], 'Menu')
            ->setElement('a')
            ->setAttr('data-tab', $tab->name);

        if (empty($this->activeTabName)) {
            $this->activeTabName = $tab->name;
        }

        return $tab;
    }
236320
public function findByAlias(string $alias): ?Tag
    {
        /** @var TagModel $adapter */
        $adapter = $this->framework->getAdapter(TagModel::class);

        $criteria = $this->getCriteria();
        $criteria['alias'] = $alias;

        if (null === ($model = $adapter->findOneByCriteria($criteria))) {
            return null;
        }

        return ModelCollection::createTagFromModel($model);
    }
707641
public static function create(string $name, array $options = [])
    {
        $menu = new Menu($name, new MenuConfiguration($options));

        if (array_key_exists('share', $options)) {
            if (is_bool($options['share'])) { // we should also handle if 'share' => false is passed
                if (true === $options['share']) { // but only actually share if true
                    View::share($menu->name, $menu);
                }
            } else {
                View::share((string)$options['share'], $menu);
            }
        }

        return $menu;
    }