public function cache($duration = null)
    {
        $this->queryCacheDuration = $duration === null ? $this->db->queryCacheDuration : $duration;
        return $this;
    }
public function cache($duration = null)
    {
        $this->queryCacheDuration = $duration === null ? $this->db->queryCacheDuration : $duration;
        return $this;
    }
public function cache ( $ duration = null ) { $ this -> queryCacheDuration = $ duration === null ? $ this -> db -> queryCacheDuration : $ duration ; return $ this ; }
Enables query cache for this command.
@param int $duration the number of seconds that query result of this command can remain valid in the cache.
If this is not set, the value of [[DatabaseInterface::queryCacheDuration]] will be used instead.
Use 0 to indicate that the cached data will never expire.
@return $this the command object itself
Enables query cache for this command .