Inheritance diagram for TranslateBehavior:

Public Member Functions | |
| _getLocale (&$model) | |
| afterDelete (&$model) | |
| afterFind (&$model, $results, $primary) | |
| afterSave (&$model, $created) | |
| beforeFind (&$model, $query) | |
| beforeValidate (&$model) | |
| bindTranslation (&$model, $fields, $reset=true) | |
| cleanup (&$model) | |
| setup (&$model, $config=array()) | |
| & | translateModel (&$model) |
| unbindTranslation (&$model, $fields=null) | |
Public Attributes | |
| $runtime = array() | |
Definition at line 35 of file translate.php.
| TranslateBehavior::_getLocale | ( | &$ | model | ) |
Get selected locale for model
Definition at line 339 of file translate.php.
References I18n::getInstance(), App::import(), and Configure::read().
Referenced by afterFind(), afterSave(), beforeFind(), and beforeValidate().
| TranslateBehavior::afterDelete | ( | &$ | model | ) |
afterDelete Callback
Reimplemented from ModelBehavior.
Definition at line 328 of file translate.php.
References translateModel().
| TranslateBehavior::afterFind | ( | &$ | model, | |
| $ | results, | |||
| $ | primary | |||
| ) |
afterFind Callback
| array | $results | |
| boolean | $primary |
Reimplemented from ModelBehavior.
Definition at line 211 of file translate.php.
References __(), _getLocale(), and beforeFind().
| TranslateBehavior::afterSave | ( | &$ | model, | |
| $ | created | |||
| ) |
afterSave Callback
| boolean | $created |
Reimplemented from ModelBehavior.
Definition at line 286 of file translate.php.
References _getLocale(), ModelBehavior::beforeSave(), and translateModel().
| TranslateBehavior::beforeFind | ( | &$ | model, | |
| $ | query | |||
| ) |
beforeFind Callback
| array | $query |
Reimplemented from ModelBehavior.
Definition at line 90 of file translate.php.
References __(), _getLocale(), ConnectionManager::getDataSource(), name(), and translateModel().
Referenced by afterFind().
| TranslateBehavior::beforeValidate | ( | &$ | model | ) |
beforeValidate Callback
Reimplemented from ModelBehavior.
Definition at line 253 of file translate.php.
References _getLocale(), and ModelBehavior::beforeSave().
| TranslateBehavior::bindTranslation | ( | &$ | model, | |
| $ | fields, | |||
| $ | reset = true | |||
| ) |
Bind translation for fields, optionally with hasMany association for fake field
| object | instance of model | |
| mixed | string with field or array(field1, field2=>AssocName, field3) | |
| boolean | $reset |
Definition at line 387 of file translate.php.
References __(), and translateModel().
Referenced by setup().
| TranslateBehavior::cleanup | ( | &$ | model | ) |
Callback
Reimplemented from ModelBehavior.
Definition at line 78 of file translate.php.
References unbindTranslation().
| TranslateBehavior::setup | ( | &$ | model, | |
| $ | config = array() | |||
| ) |
Callback
$config for TranslateBehavior should be array( 'fields' => array('field_one', 'field_two' => 'FieldAssoc', 'field_three'))
With above example only one permanent hasMany will be joined (for field_two as FieldAssoc)
$config could be empty - and translations configured dynamically by bindTranslation() method
| array | $config |
Reimplemented from ModelBehavior.
Definition at line 57 of file translate.php.
References $config, __(), bindTranslation(), ConnectionManager::getDataSource(), and translateModel().
| & TranslateBehavior::translateModel | ( | &$ | model | ) |
Get instance of model for translations
Definition at line 357 of file translate.php.
References ClassRegistry::init().
Referenced by afterDelete(), afterSave(), beforeFind(), bindTranslation(), setup(), and unbindTranslation().
| TranslateBehavior::unbindTranslation | ( | &$ | model, | |
| $ | fields = null | |||
| ) |
Unbind translation for fields, optionally unbinds hasMany association for fake field
| object | instance of model | |
| mixed | string with field, or array(field1, field2=>AssocName, field3), or null for unbind all original translations |
Definition at line 458 of file translate.php.
References translateModel().
Referenced by cleanup().
| TranslateBehavior::$runtime = array() |
Used for runtime configuration of model
Definition at line 39 of file translate.php.
1.4.7