BookStack\Repos\BookRepo::getNewPriority PHP Method

getNewPriority() public method

Get the next child element priority.
public getNewPriority ( Book $book ) : integer
$book BookStack\Book
return integer
    public function getNewPriority($book)
    {
        $lastElem = $this->getChildren($book)->pop();
        return $lastElem ? $lastElem->priority + 1 : 0;
    }