PHP Class TranslationsListener, Platform-Crud-Plugin

Handles all translations inside Crud and friends Copyright 2010-2012, Nodes ApS. (http://www.nodesagency.com/) Licensed under The MIT License Redistributions of files must retain the above copyright notice.
See also: http://book.cakephp.org/2.0/en/controllers/components.html#Component
Inheritance: implements CakeEventListener
Mostrar archivo Open project: nodesagency/Platform-Crud-Plugin Class Usage Examples

Protected Properties

Property Type Description
$_config array Configurations for TranslationsEvent
$_crud CrudComponent Crud Component reference
$_defaults array domain the translation domain to be used name the name to use in flash messages - defaults to the model's name property event-name the remaining array keys are event-name indexed arrays with the flash-message settings for each event
$_subject CrudSubject Crud Event subject

Public Methods

Method Description
__construct ( CrudSubject $subject ) : void Class constructor
config ( mixed $key = null, mixed $value = null ) : TranslationsEvent Generic config method
getDefaults ( )
implementedEvents ( ) : array Returns a list of all events that will fire in the controller during it's life cycle.
setFlash ( CakeEvent $event ) : void SetFlash Crud Event callback

Method Details

__construct() public method

Class constructor
public __construct ( CrudSubject $subject ) : void
$subject CrudSubject
return void

config() public method

If $key is an array and $value is empty, $key will be merged directly with $this->_config If $key is a string it will be passed into Hash::insert
public config ( mixed $key = null, mixed $value = null ) : TranslationsEvent
$key mixed
$value mixed
return TranslationsEvent

getDefaults() public method

public getDefaults ( )

implementedEvents() public method

You can override this function to add you own listener callbacks
public implementedEvents ( ) : array
return array

setFlash() public method

SetFlash Crud Event callback
public setFlash ( CakeEvent $event ) : void
$event CakeEvent
return void

Property Details

$_config protected_oe property

Configurations for TranslationsEvent
protected array $_config
return array

$_crud protected_oe property

Crud Component reference
protected CrudComponent $_crud
return CrudComponent

$_defaults protected_oe property

domain the translation domain to be used name the name to use in flash messages - defaults to the model's name property event-name the remaining array keys are event-name indexed arrays with the flash-message settings for each event
protected array $_defaults
return array

$_subject protected_oe property

Crud Event subject
protected CrudSubject $_subject
return CrudSubject