protected function getMinIdx($parentId = 0, $moreThen = false)
    {
        $query = call_user_func("$this->ownerClassName::find")
            ->select("MIN($this->sortField)");
        if ( $moreThen !== false ) {
            $query->where([ '>', $this->sortField, $moreThen ]);
        }
        if ( $this->parentIdField ) {
            $query->andWhere([ $this->parentIdField => $parentId ]);
        }
        $result = $query->scalar();
        if ( $result === null ) {
            $result = $moreThen + 100;
        }
        return (int)$result;
    }
protected function getMinIdx($parentId = 0, $moreThen = false)
    {
        $query = call_user_func("$this->ownerClassName::find")
            ->select("MIN($this->sortField)");
        if ( $moreThen !== false ) {
            $query->where([ '>', $this->sortField, $moreThen ]);
        }
        if ( $this->parentIdField ) {
            $query->andWhere([ $this->parentIdField => $parentId ]);
        }
        $result = $query->scalar();
        if ( $result === null ) {
            $result = $moreThen + 100;
        }
        return (int)$result;
    }
protected function getMinIdx ( $ parentId = 0 , $ moreThen = false ) { $ query = call_user_func ( "$this->ownerClassName::find" ) -> select ( "MIN($this->sortField)" ) ; if ( $ moreThen !== false ) { $ query -> where ( [ '>' , $ this -> sortField , $ moreThen ] ) ; } if ( $ this -> parentIdField ) { $ query -> andWhere ( [ $ this -> parentIdField => $ parentId ] ) ; } $ result = $ query -> scalar ( ) ; if ( $ result === null ) { $ result = $ moreThen + 100 ; } return ( int ) $ result ; }
Find min index
@param integer $parentId
@param integer $moreThen
@return integer
Find min index