core/traits/NextPrevModel.php
public function getPrev()
    {
        return self::find()->where(['<', 'id', $this->id])->orderBy(['id' => SORT_DESC])->limit(1)->one();
    }
public function getPrev()
    {
        return self::find()->where(['<', 'id', $this->id])->orderBy(['id' => SORT_DESC])->limit(1)->one();
    }
public function getPrev ( ) { return self :: find ( ) -> where ( [ '<' , 'id' , $ this -> id ] ) -> orderBy ( [ 'id' => SORT_DESC ] ) -> limit ( 1 ) -> one ( ) ; }
Get the previous record of a current id

@return ActiveQuery
Get the previous record of a current id