cakephp-1.3 > Set :: apply()
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

apply

line:1140 at /cake/libs/set.php
Allows the application of a callback method to elements of an array extracted by a Set::extract() compatible path.

Method

(mixed) apply ($path, $data, $callback, $options = array())

Parameters

ParameterTypeCommentDefault
$path mixed required Set-compatible path to the array value
$data array required An array of data to extract from & then process with the $callback.
$callback mixed required Callback method to be applied to extracted data. See http://ca2.php.net/manual/en/language.pseudo-types.php#language.types.callback for examples of callback formats.
$options array optional Options are: - type : can be pass, map, or reduce. Map will handoff the given callback to array_map, reduce will handoff to array_reduce, and pass will use call_user_func_array(). array()

Return

mixed

Comment

Allows the application of a callback method to elements of an
array extracted by a Set::extract() compatible path.

@param mixed $path Set-compatible path to the array value
@param array $data An array of data to extract from & then process with the $callback.
@param mixed $callback Callback method to be applied to extracted data.
See http://ca2.php.net/manual/en/language.pseudo-types.php#language.types.callback for examples
of callback formats.
@param array $options Options are:
- type : can be pass, map, or reduce. Map will handoff the given callback
to array_map, reduce will handoff to array_reduce, and pass will
use call_user_func_array().
@return mixed Result of the callback when applied to extracted data
@access public
@static