cakephp-1.3 > ModelBehavior :: _addToWhitelist()
A AclBase AclBehavior AclComponent AclNode AclShell Aco AcoAction AjaxHelper ApcEngine ApiShell App AppController AppController AppHelper AppHelper AppModel AppModel Aro AuthComponent B BakeShell BakeTask BehaviorCollection C Cache CacheEngine CacheHelper CakeErrorController CakeLog CakeRoute CakeSchema CakeSession CakeSocket ClassRegistry Component Configure ConnectionManager ConsoleShell ContainableBehavior Controller ControllerTask CookieComponent D DataSource DbAcl DbAclSchema DbConfigTask DboMssql DboMysql DboMysqlBase DboMysqli DboOracle DboPostgres DboSource DboSqlite Debugger Dispatcher E EmailComponent ErrorHandler ErrorHandler ExtractTask F File FileEngine FileLog FixtureTask Folder FormHelper H Helper HtmlHelper HttpSocket I I18n I18nModel i18nSchema I18nShell Inflector IniAcl J JavascriptHelper JqueryEngineHelper JsBaseEngineHelper JsHelper L L10n M MagicDb MagicFileResource MediaView MemcacheEngine Model ModelBehavior ModelTask MootoolsEngineHelper Multibyte N NumberHelper O Object Overloadable Overloadable Overloadable2 Overloadable2 P PagesController PagesController PaginatorHelper Permission PluginShortRoute PluginTask ProjectTask PrototypeEngineHelper R RequestHandlerComponent Router RssHelper S Sanitize Scaffold ScaffoldView SchemaShell Security SecurityComponent SessionComponent SessionHelper SessionsSchema Set Shell ShellDispatcher String T TemplateTask TestSuiteShell TestTask TextHelper ThemeView TimeHelper TranslateBehavior TreeBehavior V Validation View ViewTask X XcacheEngine Xml XmlElement XmlHelper XmlManager XmlNode XmlTextNode

_addToWhitelist

line:196 at /cake/libs/model/model_behavior.php
If $model's whitelist property is non-empty, $field will be added to it. Note: this method should *only* be used in beforeValidate or beforeSave to ensure that it only modifies the whitelist for the current save operation. Also make sure you explicitly set the value of the field which you are allowing.

Method

(void) _addToWhitelist (&$model, $field)

Parameters

ParameterTypeCommentDefault
$model object required Model using this behavior
$field string required Field to be added to $model's whitelist

Return

void

Comment

If $model's whitelist property is non-empty, $field will be added to it.
Note: this method should *only* be used in beforeValidate or beforeSave to ensure
that it only modifies the whitelist for the current save operation. Also make sure
you explicitly set the value of the field which you are allowing.

@param object $model Model using this behavior
@param string $field Field to be added to $model's whitelist
@access protected
@return void