src/ElementBase.php
public function generateElementSortForHolder()
    {
        if (!$this->Sort)
        {
            $holderFilter = ['PageID' => $this->PageID];
            if ($this->ElementID) $holderFilter = ['ElementID' => $this->ElementID];

            $this->Sort = self::get()
                ->filter($holderFilter)
                ->max('Sort') + 1
            ;
        }
        return $this;
    }
public function generateElementSortForHolder()
    {
        if (!$this->Sort)
        {
            $holderFilter = ['PageID' => $this->PageID];
            if ($this->ElementID) $holderFilter = ['ElementID' => $this->ElementID];

            $this->Sort = self::get()
                ->filter($holderFilter)
                ->max('Sort') + 1
            ;
        }
        return $this;
    }
public function generateElementSortForHolder ( ) { if ( ! $ this -> Sort ) { $ holderFilter = [ 'PageID' => $ this -> PageID ] ; if ( $ this -> ElementID ) $ holderFilter = [ 'ElementID' => $ this -> ElementID ] ; $ this -> Sort = self :: get ( ) -> filter ( $ holderFilter ) -> max ( 'Sort' ) + 1 ; } return $ this ; }
Generate next Sort value on element creation.

@return ElementBase
Generate next Sort value on element creation .