public function setCachePolicy(string $policy)
    {
        if ($policy !== self::CACHE_DISABLE && $policy !== self::CACHE_PUBLIC && $policy !== self::CACHE_PRIVATE)
            throw new \InvalidArgumentException("Invalid cache policy: " . $policy);

        $this->cache_policy = $policy;
        return $this;
    }
public function setCachePolicy(string $policy)
    {
        if ($policy !== self::CACHE_DISABLE && $policy !== self::CACHE_PUBLIC && $policy !== self::CACHE_PRIVATE)
            throw new \InvalidArgumentException("Invalid cache policy: " . $policy);

        $this->cache_policy = $policy;
        return $this;
    }
public function setCachePolicy ( string $ policy ) { if ( $ policy !== self :: CACHE_DISABLE && $ policy !== self :: CACHE_PUBLIC && $ policy !== self :: CACHE_PRIVATE ) throw new \ InvalidArgumentException ( "Invalid cache policy: " . $ policy ) ; $ this -> cache_policy = $ policy ; return $ this ; }
Set the cache policy for this response.
@param string $policy One of CachePolicy::CACHE_PUBLIC, CACHE_PRIVATE or CACHE_DISABLED.
@return CachePolicy Provides fluent interface
Set the cache policy for this response .