public function actionClearDeprecated($interval)
    {
        $ids = PushRecord::find()
            ->deprecated($interval)
            ->done()
            ->select('push.id')
            ->asArray()->column();
        $count = count($ids);
        if ($count && $this->confirm("Do you want to delete $count records?")) {
            $count = PushRecord::getDb()->transaction(function () use ($ids) {
                ExecRecord::deleteAll(['push_id' => $ids]);
                return PushRecord::deleteAll(['id' => $ids]);
            });
            $this->stdout("$count records deleted.\n");
        }
    }
public function actionClearDeprecated($interval)
    {
        $ids = PushRecord::find()
            ->deprecated($interval)
            ->done()
            ->select('push.id')
            ->asArray()->column();
        $count = count($ids);
        if ($count && $this->confirm("Do you want to delete $count records?")) {
            $count = PushRecord::getDb()->transaction(function () use ($ids) {
                ExecRecord::deleteAll(['push_id' => $ids]);
                return PushRecord::deleteAll(['id' => $ids]);
            });
            $this->stdout("$count records deleted.\n");
        }
    }
public function actionClearDeprecated ( $ interval ) { $ ids = PushRecord :: find ( ) -> deprecated ( $ interval ) -> done ( ) -> select ( 'push.id' ) -> asArray ( ) -> column ( ) ; $ count = count ( $ ids ) ; if ( $ count && $ this -> confirm ( "Do you want to delete $count records?" ) ) { $ count = PushRecord :: getDb ( ) -> transaction ( function ( ) use ( $ ids ) { ExecRecord :: deleteAll ( [ 'push_id' => $ ids ] ) ; return PushRecord :: deleteAll ( [ 'id' => $ ids ] ) ; } ) ; $ this -> stdout ( "$count records deleted.\n" ) ; } }
Clear deprecated records.

@param string $interval
@link https://www.php.net/manual/en/dateinterval.construct.php
Clear deprecated records .