public function getNextPosition()
    {
        $query = $this->createQuery()
            ->orderByPosition(Criteria::DESC)
            ->limit(1);

        $this->addCriteriaToPositionQuery($query);

        $last = $query->findOne();

        return $last != null ? $last->getPosition() + 1 : 1;
    }
public function getNextPosition()
    {
        $query = $this->createQuery()
            ->orderByPosition(Criteria::DESC)
            ->limit(1);

        $this->addCriteriaToPositionQuery($query);

        $last = $query->findOne();

        return $last != null ? $last->getPosition() + 1 : 1;
    }
public function getNextPosition ( ) { $ query = $ this -> createQuery ( ) -> orderByPosition ( Criteria :: DESC ) -> limit ( 1 ) ; $ this -> addCriteriaToPositionQuery ( $ query ) ; $ last = $ query -> findOne ( ) ; return $ last != null ? $ last -> getPosition ( ) + 1 : 1 ; }
Get the position of the next inserted object
Get the position of the next inserted object