Pimcore\Model\Document\Dao::getNextIndex PHP Method

getNextIndex() public method

Fetches the maximum index value from siblings.
public getNextIndex ( ) : string
return string
    public function getNextIndex()
    {
        $index = $this->db->fetchOne("SELECT MAX(`index`) FROM documents WHERE parentId = ?", [$this->model->getParentId()]);
        $index++;
        return $index;
    }