public function getPrevious($modelForm, $auditId)
    {
        $query = new Query;
        $this->prepareCondition($query, $modelForm);
        $query->andWhere('audit_id < :auditId', ['auditId' => $auditId]);
        $query->orderBy('audit_id desc');
        $columns = $this->getRelations($query, $modelForm->table);
        $columns[] = 'audit.*';
        $query->select(join(', ', $columns))->from("audits.{$modelForm->table} audit");
        $row = $query->one();
        return $this->unsetHiddenColumns($row);
    }
public function getPrevious($modelForm, $auditId)
    {
        $query = new Query;
        $this->prepareCondition($query, $modelForm);
        $query->andWhere('audit_id < :auditId', ['auditId' => $auditId]);
        $query->orderBy('audit_id desc');
        $columns = $this->getRelations($query, $modelForm->table);
        $columns[] = 'audit.*';
        $query->select(join(', ', $columns))->from("audits.{$modelForm->table} audit");
        $row = $query->one();
        return $this->unsetHiddenColumns($row);
    }
public function getPrevious ( $ modelForm , $ auditId ) { $ query = new Query ; $ this -> prepareCondition ( $ query , $ modelForm ) ; $ query -> andWhere ( 'audit_id < :auditId' , [ 'auditId' => $ auditId ] ) ; $ query -> orderBy ( 'audit_id desc' ) ; $ columns = $ this -> getRelations ( $ query , $ modelForm -> table ) ; $ columns [ ] = 'audit.*' ; $ query -> select ( join ( ', ' , $ columns ) ) -> from ( "audits.{$modelForm->table} audit" ) ; $ row = $ query -> one ( ) ; return $ this -> unsetHiddenColumns ( $ row ) ; }
Gets previous element from database

@param \yii\base\Model $modelForm
@param integer $auditId
@return array
Gets previous element from database