public function find($type = 'all', $options = [])
    {
        //Gets from cache the timestamp of the next record to be published
        $next = $this->getNextToBePublished();

        //If the cache is invalid, it clears the cache and sets the next record
        //  to be published
        if ($next && time() >= $next) {
            Cache::clear(false, $this->getCacheName());

            //Sets the next record to be published
            $this->setNextToBePublished();
        }

        return parent::find($type, $options);
    }
public function find($type = 'all', $options = [])
    {
        //Gets from cache the timestamp of the next record to be published
        $next = $this->getNextToBePublished();

        //If the cache is invalid, it clears the cache and sets the next record
        //  to be published
        if ($next && time() >= $next) {
            Cache::clear(false, $this->getCacheName());

            //Sets the next record to be published
            $this->setNextToBePublished();
        }

        return parent::find($type, $options);
    }
public function find ( $ type = 'all' , $ options = [ ] ) { //Gets from cache the timestamp of the next record to be published $ next = $ this -> getNextToBePublished ( ) ; //If the cache is invalid, it clears the cache and sets the next record //  to be published if ( $ next && time ( ) >= $ next ) { Cache :: clear ( false , $ this -> getCacheName ( ) ) ; //Sets the next record to be published $ this -> setNextToBePublished ( ) ; } return parent :: find ( $ type , $ options ) ; }
Creates a new Query for this repository and applies some defaults based
on the type of search that was selected
@param string $type The type of query to perform
@param array|ArrayAccess $options An array that will be passed to
Query::applyOptions()
@return \Cake\ORM\Query The query builder
@uses getCacheName()
@uses MeCms\Model\Table\Traits\NextToBePublishedTrait::getNextToBePublished()
@uses MeCms\Model\Table\Traits\NextToBePublishedTrait::setNextToBePublished()
Creates a new Query for this repository and applies some defaults based on the type of search that was selected