TemplateCacheService

Type
Class
Namespace
Craft
Inherits
Craft\TemplateCacheService » Craft\BaseApplicationComponent » CApplicationComponent (opens new window) » CComponent (opens new window)
Implements
IApplicationComponent
Since
2.0

Class TemplateCacheService

See also http://craftcms.com

View source (opens new window)

# Public Properties

Property Description
$behaviors (opens new window) array (opens new window) – The behaviors that should be attached to this component.

# Public Methods

Method Description
__call() (opens new window) Calls the named method which is not a class method.
__get() (opens new window) Returns a property value, an event handler list or a behavior based on its name.
__isset() (opens new window) Checks if a property value is null.
__set() (opens new window) Sets value of a component property.
__unset() (opens new window) Sets a component property to be null.
asa() (opens new window) Returns the named behavior object.
attachBehavior() (opens new window) Attaches a behavior to this component.
attachBehaviors() (opens new window) Attaches a list of behaviors to the component.
attachEventHandler() (opens new window) Attaches an event handler to an event.
canGetProperty() (opens new window) Determines whether a property can be read.
canSetProperty() (opens new window) Determines whether a property can be set.
deleteAllCaches() Deletes all the template caches.
deleteCacheById() Deletes a cache by its ID(s).
deleteCachesByCriteria() Deletes caches that include elements that match a given criteria.
deleteCachesByElement() Deletes caches that include a given element(s).
deleteCachesByElementId() Deletes caches that include an a given element ID(s).
deleteCachesByElementType() Deletes caches by a given element type.
deleteCachesByKey() Deletes a cache by its key(s).
deleteExpiredCaches() Deletes any expired caches.
deleteExpiredCachesIfOverdue() Deletes any expired caches if we haven't already done that within the past 24 hours.
detachBehavior() (opens new window) Detaches a behavior from the component.
detachBehaviors() (opens new window) Detaches all behaviors from the component.
detachEventHandler() (opens new window) Detaches an existing event handler.
disableBehavior() (opens new window) Disables an attached behavior.
disableBehaviors() (opens new window) Disables all behaviors attached to this component.
enableBehavior() (opens new window) Enables an attached behavior.
enableBehaviors() (opens new window) Enables all behaviors attached to this component.
endTemplateCache() Ends a template cache.
evaluateExpression() (opens new window) Evaluates a PHP expression or callback under the context of this component.
getEventHandlers() (opens new window) Returns the list of attached event handlers for an event.
getIsInitialized() (opens new window) Checks if this application component has been initialized.
getTemplateCache() Returns a cached template by its key.
hasEvent() (opens new window) Determines whether an event is defined.
hasEventHandler() (opens new window) Checks whether the named event has attached handlers.
hasProperty() (opens new window) Determines whether a property is defined.
includeCriteriaInTemplateCaches() Includes an element criteria in any active caches.
includeElementInTemplateCaches() Includes an element in any active caches.
init() (opens new window) Initializes the application component.
isInitialized() Checks if this application component has been initialized yet, or not.
raiseEvent() (opens new window) Raises an event.
startTemplateCache() Starts a new template cache.

# deleteAllCaches()

Deletes all the template caches.

View source (opens new window)

Returns

boolean (opens new window)

Signature

public boolean deleteAllCaches ( )

# deleteCacheById()

Deletes a cache by its ID(s).

View source (opens new window)

Arguments

Returns

boolean (opens new window)

Signature

public boolean deleteCacheById ( $cacheId )

# deleteCachesByCriteria()

Deletes caches that include elements that match a given criteria.

View source (opens new window)

Arguments

Returns

boolean (opens new window)

Signature

public boolean deleteCachesByCriteria ( Craft\ElementCriteriaModel $criteria )

# deleteCachesByElement()

Deletes caches that include a given element(s).

View source (opens new window)

Arguments

Returns

boolean (opens new window)

Signature

public boolean deleteCachesByElement ( $elements )

# deleteCachesByElementId()

Deletes caches that include an a given element ID(s).

View source (opens new window)

Arguments

Returns

boolean (opens new window)

Throws

Signature

public boolean deleteCachesByElementId ( $elementId, $deleteQueryCaches = true )

# deleteCachesByElementType()

Deletes caches by a given element type.

View source (opens new window)

Arguments

Returns

boolean (opens new window)

Signature

public boolean deleteCachesByElementType ( $elementType )

# deleteCachesByKey()

Deletes a cache by its key(s).

View source (opens new window)

Arguments

Returns

boolean (opens new window)

Signature

public boolean deleteCachesByKey ( $key )

# deleteExpiredCaches()

Signature

public boolean deleteExpiredCaches ( )

# deleteExpiredCachesIfOverdue()

Deletes any expired caches if we haven't already done that within the past 24 hours.

View source (opens new window)

Returns

boolean (opens new window)

Signature

public boolean deleteExpiredCachesIfOverdue ( )

# endTemplateCache()

Ends a template cache.

View source (opens new window)

Arguments

Returns

null (opens new window)

Throws

Signature

public null endTemplateCache ( $key, $global, $duration, $expiration, $body )

# getTemplateCache()

Returns a cached template by its key.

View source (opens new window)

Arguments

Returns

string (opens new window), null (opens new window)

Signature

public string, null getTemplateCache ( $key, $global )

# includeCriteriaInTemplateCaches()

Includes an element criteria in any active caches.

View source (opens new window)

Arguments

Returns

null (opens new window)

Signature

public null includeCriteriaInTemplateCaches ( Craft\ElementCriteriaModel $criteria )

# includeElementInTemplateCaches()

Includes an element in any active caches.

View source (opens new window)

Arguments

Returns

null (opens new window)

Signature

public null includeElementInTemplateCaches ( $elementId )

# startTemplateCache()

Starts a new template cache.

View source (opens new window)

Arguments

Returns

null (opens new window)

Signature

public null startTemplateCache ( $key )