symfony API

sfFunctionCache Class

« Back to API menu

action

addon

autoload

cache

command

config

controller

creole

database

debug

exception

filter

form

generator

helper

i18n

log

plugin

propel

request

response

routing

storage

task

test

user

util

validator

view

widget

You are currently browsing the symfony documentation for the 1.1 version. Switch to:

This class can be used to cache the result and output of any PHP callable (function and method calls).

Method Summary

  • __construct((sfCache) $cache)
    Constructor.
  • mixed call($callable, $arguments = array())
    Calls a cacheable function or method (or not if there is already a cache for it).

Method Details

  • __construct ((sfCache) $cache)

    $cache An sfCache object instance

    Constructor.

  • (mixed) call ($callable, $arguments = array())

    $callable A PHP callable
    $arguments An array of arguments to pass to the callable

    Calls a cacheable function or method (or not if there is already a cache for it).

    Arguments of this method are read with func_get_args. So it doesn't appear in the function definition.
    The first argument can be any PHP callable:
    $cache->call('functionName', array($arg1, $arg2)); $cache->call(array($object, 'methodName'), array($arg1, $arg2));

    returns The result of the function/method