Add new divider item.

@param int   $order
@param array $attributes

@return \Rinvex\Menus\Models\MenuItem
2355
public function divider(int $order = null, array $attributes = []): MenuItem
    {
        return $this->add(['type' => 'divider', 'order' => $order, 'attributes' => $attributes]);
    }
218068
public function addOrders( $orders )
	{
		if( !is_array( $orders ) )
			throw new InvalidArgumentException( 'An Array should be given.' );
		foreach( $orders as $column => $direction )
			$this->addOrder( $column, $direction );
	}
816435
public function orderByCreatedAt($sort = SORT_ASC)
    {
        /* @var $this ActiveQuery */
        $model = $this->noInitModel;
        if (!is_string($model->createdAtAttribute) || empty($model->createdAtAttribute)) {
            return $this;
        }
        return $this->addOrderBy([$model->createdAtAttribute => $sort]);
    }
1039401
public function setOrder(int $order) : CNabuDataObject
    {
        if ($order === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$order")
            );
        }
        $this->setValue('nb_site_target_section_order', $order);
        
        return $this;
    }
207020
public function addMenu( $attributes = [], $priority = 1 )
    {
        $defaultAttributes = [
            'page_title' => $this->plugin['config']->get('plugin.namespace'),
            'menu_title' => $this->plugin['config']->get('plugin.namespace'),
            'capability' => 'read',
            'menu_slug' => $this->plugin['config']->get('plugin.slug'),
            'icon_url' => '',
            'position' => null,
            'controller' => null,
        ];

        $attributes = array_merge($defaultAttributes,$attributes);

        add_action('admin_menu', function () use ($attributes) {
            // Add shortcode support for widgets
            add_menu_page(
                $attributes['page_title'],
                $attributes['menu_title'],
                $attributes['capability'],
                $attributes['menu_slug'],
                function () use ( $attributes ){
                    return $this->executeController($attributes['controller'], $attributes);
                },
                $attributes['icon_url'],
                $attributes['position']
            );
        }, $priority);
    }
455417
public function addItem(GridItem $item, $order = null)
    {
        if (empty($this->getItem($item->getUuid()))) {
            $rowItem = new GridRowItem();
            $rowItem->setOrder(isset($order) || 0 === $order ? $order : $this->rowItems->count());
            $rowItem->setRow($this);
            $rowItem->setItem($item);

            $this->rowItems->add($rowItem);
        }
    }
1027115
protected function addDivider(ItemInterface $menu)
    {
        do {
            $name = 'divider'.mt_rand();
        } while (in_array($name, $this->dividers));

        $this->dividers[] = $name;

        $item = $menu->addChild($name, array());
        $item->setLabel('');
        $item->setAttribute('class', 'divider');

        return $item;
    }
1072925
public function withAttributes(array $attributes = []): Element
    {
        $this->attributes = array_merge(
            $this->attributes,
            $attributes
        );

        return $this;
    }
704072
public function order_by( $cols, $order = 'asc' ) 
	{
		if ( !is_array( $cols ) ) 
		{
			$this->orders[] = array( $cols, $order ); return $this;
		}
		else
		{
			foreach( $cols as $key => $col ) 
			{
				if ( is_numeric( $key ) ) 
				{
					$this->orders[] = array( $col, $order );	
				} 
				else 
				{
					$this->orders[] = array( $key, $col );
				}
			}
		}
		
		return $this;
	}
75609
public function addSubMenu( $attributes = [], $priority = 10 )
    {
        $defaultAttributes = [
            'page_title' => $this->plugin['config']->get('plugin.namespace'),
            'menu_title' => $this->plugin['config']->get('plugin.namespace'),
            'capability' => 'read',
            'menu_slug' => $this->plugin['config']->get('plugin.slug'),
            'parent_slug' => '',
            'controller' => '',
        ];

        $attributes = array_merge($defaultAttributes,$attributes);

        add_action('admin_menu', function () use ($attributes) {
            // Add shortcode support for widgets
            add_submenu_page(
                $attributes['parent_slug'],
                $attributes['page_title'],
                $attributes['menu_title'],
                $attributes['capability'],
                $attributes['menu_slug'],
                function () use ( $attributes ){
                    return $this->executeController($attributes['controller'], $attributes);
                }
            );
        }, $priority);
    }
787607
public function orderBy($attribute, bool $desc = false)
    {
        $this->data->sortBy($attribute, $desc ? FieldSort::DESC : FieldSort::ASC);

        return $this;
    }
503697
public function addOrderBy($field, $order = 'ASC')
    {
        $alias = self::DEFAULT_TABLE_ALIAS;
        if (strpos($field, '.') > 0) {
            //monta os joins
            $newAliasField = $this->associationQueryFields($field);
            $alias = $newAliasField['alias'];
            $field = $newAliasField['field'];
        }
        $this->queryBuilder->addOrderBy($this->getFullFieldName($field, $alias), $order);

        return $this;
    }
771495
protected static function setBranchOrder(array $order)
    {
        static::$branchOrder = array_flip(Arr::flatten($order));

        static::$branchOrder = array_map(function ($item) {
            return ++$item;
        }, static::$branchOrder);
    }
112225
public function order($order, $direction = self::ASC)
    {
        $this->order = $order;
        $this->direction = $direction;
        return $this;
    }
715873
public function setOrder($order)
    {
        if (! is_array($order)) {
            $order = func_get_args();
        }

        $this->order = $order;

        return $this;
    }
814798
public function addColumns(array $names, $order = false)
    {
        foreach ($names as $name => $attribute) {
            if (is_int($name)) {
                $name = $attribute;
            }

            $this->addColumn($name, function ($model) use ($attribute) {
                return $model->getAttribute($attribute);
            }, is_int($order) ? $order++ : $order);
        }

        return $this;
    }
161660
public function divide($attributes = array())
    {
        $attributes['class'] = Builder::formatGroupClass($attributes, array('class' => 'divider'));

        $this->divider = $attributes;

        return $this;
    }