src/Shell/SearchShell.php
public function cleanup(string $time = self::DEFAULT_MAX_LENGTH) : void
    {
        $table = $this->loadModel('Search.SavedSearches');

        $date = strtotime($time);

        if (false === $date) {
            $this->err(sprintf('Failed to remove pre-saved searches, unsupported time value provided: %s', $time));

            return;
        }

        $count = $table->deleteAll([
            'modified <' => $date,
            'OR' => ['name' => '', 'name IS' => null]
        ]);

        $this->info($count . ' outdated pre-saved searches removed.');
    }
public function cleanup(string $time = self::DEFAULT_MAX_LENGTH) : void
    {
        $table = $this->loadModel('Search.SavedSearches');

        $date = strtotime($time);

        if (false === $date) {
            $this->err(sprintf('Failed to remove pre-saved searches, unsupported time value provided: %s', $time));

            return;
        }

        $count = $table->deleteAll([
            'modified <' => $date,
            'OR' => ['name' => '', 'name IS' => null]
        ]);

        $this->info($count . ' outdated pre-saved searches removed.');
    }
public function cleanup ( string $ time = self :: DEFAULT_MAX_LENGTH ) : void { $ table = $ this -> loadModel ( 'Search.SavedSearches' ) ; $ date = strtotime ( $ time ) ; if ( false === $ date ) { $ this -> err ( sprintf ( 'Failed to remove pre-saved searches, unsupported time value provided: %s' , $ time ) ) ; return ; } $ count = $ table -> deleteAll ( [ 'modified <' => $ date , 'OR' => [ 'name' => '' , 'name IS' => null ] ] ) ; $ this -> info ( $ count . ' outdated pre-saved searches removed.' ) ; }
Method responsible for outdated pre-saved searches cleanup.

@param string $time A date/time string. Valid formats are explained in http://php.net/manual/en/datetime.formats.php
@return void
Method responsible for outdated pre - saved searches cleanup .