GlobalsService

Type
Class
Namespace
Craft
Inherits
Craft\GlobalsService » Craft\BaseApplicationComponent » CApplicationComponent » CComponent
Implements
IApplicationComponent
Since
1.0

Class GlobalsService

See also http://craftcms.com

View source

Public Properties

PropertyDescription
$behaviorsarray – The behaviors that should be attached to this component.

Public Methods

MethodDescription
__call()Calls the named method which is not a class method.
__get()Returns a property value, an event handler list or a behavior based on its name.
__isset()Checks if a property value is null.
__set()Sets value of a component property.
__unset()Sets a component property to be null.
asa()Returns the named behavior object.
attachBehavior()Attaches a behavior to this component.
attachBehaviors()Attaches a list of behaviors to the component.
attachEventHandler()Attaches an event handler to an event.
canGetProperty()Determines whether a property can be read.
canSetProperty()Determines whether a property can be set.
deleteSetById()Deletes a global set by its ID.
detachBehavior()Detaches a behavior from the component.
detachBehaviors()Detaches all behaviors from the component.
detachEventHandler()Detaches an existing event handler.
disableBehavior()Disables an attached behavior.
disableBehaviors()Disables all behaviors attached to this component.
enableBehavior()Enables an attached behavior.
enableBehaviors()Enables all behaviors attached to this component.
evaluateExpression()Evaluates a PHP expression or callback under the context of this component.
getAllSetIds()Returns all of the global set IDs.
getAllSets()Returns all global sets.
getEditableSetIds()Returns all of the global set IDs that are editable by the current user.
getEditableSets()Returns all global sets that are editable by the current user.
getEventHandlers()Returns the list of attached event handlers for an event.
getIsInitialized()Checks if this application component has been initialized.
getSetByHandle()Returns a global set by its handle.
getSetById()Returns a global set by its ID.
getTotalEditableSets()Returns the total number of global sets that are editable by the current user.
getTotalSets()Returns the total number of global sets.
hasEvent()Determines whether an event is defined.
hasEventHandler()Checks whether the named event has attached handlers.
hasProperty()Determines whether a property is defined.
init()Initializes the application component.
isInitialized()Checks if this application component has been initialized yet, or not.
onBeforeSaveGlobalContent()Fires an 'onBeforeSaveGlobalContent' event.
onSaveGlobalContent()Fires an 'onSaveGlobalContent' event.
raiseEvent()Raises an event.
saveContent()Saves a global set's content
saveSet()Saves a global set.

deleteSetById()

Deletes a global set by its ID.

View source

Arguments

Returns

boolean

Throws

Signature

public boolean deleteSetById ( $setId )

getAllSetIds()

Returns all of the global set IDs.

View source

Returns

array

Signature

public array getAllSetIds ( )

getAllSets()

Returns all global sets.

View source

Arguments

Returns

array

Signature

public array getAllSets ( $indexBy = null )

getEditableSetIds()

Returns all of the global set IDs that are editable by the current user.

View source

Returns

array

Signature

public array getEditableSetIds ( )

getEditableSets()

Returns all global sets that are editable by the current user.

View source

Arguments

Returns

array

Signature

public array getEditableSets ( $indexBy = null )

getSetByHandle()

Returns a global set by its handle.

View source

Arguments

Returns

Craft\GlobalSetModel, null

Signature

public Craft\GlobalSetModel, null getSetByHandle ( $globalSetHandle, $localeId = null )

getSetById()

Returns a global set by its ID.

View source

Arguments

Returns

Craft\GlobalSetModel, null

Signature

public Craft\GlobalSetModel, null getSetById ( $globalSetId, $localeId = null )

getTotalEditableSets()

Returns the total number of global sets that are editable by the current user.

View source

Returns

integer

Signature

public integer getTotalEditableSets ( )

getTotalSets()

Returns the total number of global sets.

View source

Returns

integer

Signature

public integer getTotalSets ( )

onBeforeSaveGlobalContent()

Fires an 'onBeforeSaveGlobalContent' event.

View source

Arguments

Returns

null

Signature

public null onBeforeSaveGlobalContent ( Craft\Event $event )

onSaveGlobalContent()

Fires an 'onSaveGlobalContent' event.

View source

Arguments

Returns

null

Signature

public null onSaveGlobalContent ( Craft\Event $event )

saveContent()

Saves a global set's content

View source

Arguments

Returns

boolean

Throws

Signature

public boolean saveContent ( Craft\GlobalSetModel $globalSet )

saveSet()

Saves a global set.

View source

Arguments

Returns

boolean

Throws

Signature

public boolean saveSet ( Craft\GlobalSetModel $globalSet )