public function moveLast($parentId = false)
    {
        if ( $this->parentIdField && $parentId === false ) {
            $parentId = $this->owner->{$this->parentIdField};
        }
        $maxIdx = $this->getMaxIdx($parentId);
        if ( $maxIdx == $this->defaultSortVal ) {
            $this->reorder($parentId);
            $maxIdx = $this->getMaxIdx($parentId);
        }
        if ( $this->parentIdField ) {
            call_user_func("$this->ownerClassName::updateAll", [
                $this->sortField => $maxIdx + 100,
                $this->parentIdField => $parentId,
            ], [ $this->primaryKey => $this->owner->primaryKey ]);
        } else {
            call_user_func("$this->ownerClassName::updateAll",
                [ $this->sortField => $maxIdx + 100 ],
                [ $this->primaryKey => $this->owner->primaryKey ]);
        }
        $this->invalidateTagDependency();
    }
public function moveLast($parentId = false)
    {
        if ( $this->parentIdField && $parentId === false ) {
            $parentId = $this->owner->{$this->parentIdField};
        }
        $maxIdx = $this->getMaxIdx($parentId);
        if ( $maxIdx == $this->defaultSortVal ) {
            $this->reorder($parentId);
            $maxIdx = $this->getMaxIdx($parentId);
        }
        if ( $this->parentIdField ) {
            call_user_func("$this->ownerClassName::updateAll", [
                $this->sortField => $maxIdx + 100,
                $this->parentIdField => $parentId,
            ], [ $this->primaryKey => $this->owner->primaryKey ]);
        } else {
            call_user_func("$this->ownerClassName::updateAll",
                [ $this->sortField => $maxIdx + 100 ],
                [ $this->primaryKey => $this->owner->primaryKey ]);
        }
        $this->invalidateTagDependency();
    }
public function moveLast ( $ parentId = false ) { if ( $ this -> parentIdField && $ parentId === false ) { $ parentId = $ this -> owner -> { $ this -> parentIdField } ; } $ maxIdx = $ this -> getMaxIdx ( $ parentId ) ; if ( $ maxIdx == $ this -> defaultSortVal ) { $ this -> reorder ( $ parentId ) ; $ maxIdx = $ this -> getMaxIdx ( $ parentId ) ; } if ( $ this -> parentIdField ) { call_user_func ( "$this->ownerClassName::updateAll" , [ $ this -> sortField => $ maxIdx + 100 , $ this -> parentIdField => $ parentId , ] , [ $ this -> primaryKey => $ this -> owner -> primaryKey ] ) ; } else { call_user_func ( "$this->ownerClassName::updateAll" , [ $ this -> sortField => $ maxIdx + 100 ] , [ $ this -> primaryKey => $ this -> owner -> primaryKey ] ) ; } $ this -> invalidateTagDependency ( ) ; }
Move model to last
@param integer $parentId
Move model to last