Object Class Reference

Inheritance diagram for Object:

AclBase AclComponent App AuthComponent BehaviorCollection Cache CacheEngine CakeSchema CakeSocket Component Configure ConnectionManager Controller CookieComponent DataSource Debugger Dispatcher EmailComponent ErrorHandler ErrorHandler Flay Folder I18n L10n MagicDb MagicFileResource ModelBehavior Multibyte Overloadable Overloadable Overloadable2 Overloadable2 RequestHandlerComponent Router Scaffold Security SecurityComponent Set Shell String Validation View XmlNode List of all members.

Public Member Functions

 __construct ()
 __openPersistent ($name, $type=null)
 _persist ($name, $return=null, &$object, $type=null)
 _savePersistent ($name, &$object)
 _set ($properties=array())
 _stop ($status=0)
 cakeError ($method, $messages=array())
 dispatchMethod ($method, $params=array())
 log ($msg, $type=LOG_ERROR)
 Object ()
 requestAction ($url, $extra=array())
 toString ()

Public Attributes

 $_log = null

Detailed Description

Definition at line 37 of file object.php.


Constructor & Destructor Documentation

Object::__construct (  ) 

Class constructor, overridden in descendant classes.

Reimplemented in AclComponent, AclBase, DbAcl, IniAcl, RequestHandlerComponent, Controller, Debugger, CakeErrorController, L10n, ConnectionManager, AclNode, Permission, Overloadable, Overloadable2, JsHelper, and XmlHelper.

Definition at line 63 of file object.php.

Referenced by destroy(), and Object().


Member Function Documentation

Object::__openPersistent ( name,
type = null 
)

Open the persistent class file for reading Used by Object::_persist()

Parameters:
string $name Name of persisted class
string $type Type of persistance (e.g: registry)
Returns:
void private

Definition at line 267 of file object.php.

References ClassRegistry::addObject(), classify(), and App::import().

Referenced by _persist().

Object::_persist ( name,
return = null,
&$  object,
type = null 
)

Checks for a persistent class file, if found file is opened and true returned If file is not found a file is created and false returned If used in other locations of the model you should choose a unique name for the persistent file There are many uses for this method, see manual for examples

Parameters:
string $name name of the class to persist
string $object the object to persist
Returns:
boolean Success protected
Todo:
add examples to manual

Definition at line 219 of file object.php.

References __openPersistent(), and _savePersistent().

Referenced by Controller::loadModel().

Object::_savePersistent ( name,
&$  object 
)

You should choose a unique name for the persistent file

There are many uses for this method, see manual for examples

Parameters:
string $name name used for object to cache
object $object the object to persist
Returns:
boolean true on save, throws error if file can not be created protected

Definition at line 247 of file object.php.

References cache(), and Configure::read().

Referenced by _persist().

Object::_set ( properties = array()  ) 

Allows setting of multiple properties of the object in a single line of code.

Parameters:
array $properties An associative array containing properties and corresponding values.
Returns:
void protected

Definition at line 169 of file object.php.

Referenced by CakeErrorController::__construct(), EmailComponent::initialize(), and CookieComponent::initialize().

Object::_stop ( status = 0  ) 

Stop execution of the current script

Parameters:
$status see http://php.net/exit for values
Returns:
void public

Definition at line 139 of file object.php.

Referenced by ErrorHandler::__construct(), SchemaShell::__create(), ViewTask::__interactive(), TestTask::__interactive(), ViewTask::__loadController(), ApiShell::__parseClass(), SchemaShell::__update(), ExtractTask::__writeFiles(), AjaxHelper::afterRender(), BakeShell::all(), Dispatcher::cached(), Dispatcher::dispatch(), SchemaShell::dump(), ErrorHandler::error(), ErrorHandler::error404(), PluginTask::execute(), ExtractTask::execute(), DbConfigTask::execute(), SchemaShell::generate(), ControllerTask::getName(), ViewTask::help(), ProjectTask::help(), PluginTask::help(), ControllerTask::help(), SchemaShell::help(), ControllerTask::listAll(), BakeShell::loadTasks(), ApiShell::main(), ErrorHandler::missingAction(), ErrorHandler::missingComponentClass(), ErrorHandler::missingComponentFile(), ErrorHandler::missingConnection(), ErrorHandler::missingController(), ErrorHandler::missingDatabase(), ErrorHandler::missingHelperClass(), ErrorHandler::missingHelperFile(), ErrorHandler::missingLayout(), ErrorHandler::missingModel(), ErrorHandler::missingTable(), ErrorHandler::missingView(), ErrorHandler::privateAction(), Controller::redirect(), SchemaShell::run(), AuthComponent::startup(), AclShell::startup(), and SchemaShell::view().

Object::cakeError ( method,
messages = array() 
)

Used to report user friendly errors. If there is a file app/error.php or app/app_error.php this file will be loaded error.php is the AppError class it should extend ErrorHandler class.

Parameters:
string $method Method to be called in the error class (AppError or ErrorHandler classes)
array $messages Message that is to be displayed by the error class
Returns:
error message public

Definition at line 189 of file object.php.

References error(), and App::import().

Referenced by Dispatcher::_invoke(), Component::_loadComponents(), Dispatcher::dispatch(), Controller::loadModel(), MediaView::render(), Model::setDataSource(), and Model::setSource().

Object::dispatchMethod ( method,
params = array() 
)

Calls a method on this object with the given parameters. Provides an OO wrapper for call_user_func_array, and improves performance by using straight method calls in most cases.

Parameters:
string $method Name of the method to call
array $params Parameter list to use when calling $method
Returns:
mixed Returns the result of the method call public

Definition at line 113 of file object.php.

Referenced by ErrorHandler::__construct(), JsHelper::call__(), and Model::invalidFields().

Object::log ( msg,
type = LOG_ERROR 
)

API for logging events.

Parameters:
string $msg Log message
integer $type Error type constant. Defined in app/config/core.php.
Returns:
boolean Success of log write public

Reimplemented in Debugger.

Definition at line 150 of file object.php.

References uses().

Referenced by DboSource::execute().

Object::Object (  ) 

A hack to support __construct() on PHP 4 Hint: descendant classes have no PHP4 class_name() constructors, so this constructor gets called first and calls the top-layer __construct() which (if present) should call parent::__construct()

Returns:
Object

Definition at line 53 of file object.php.

References __construct(), and __destruct().

Object::requestAction ( url,
extra = array() 
)

Calls a controller's method from any location.

Parameters:
mixed $url String or array-based url.
array $extra if array includes the key "return" it sets the AutoRender to true.
Returns:
mixed Boolean true or false on success/failure, or contents of rendered action if 'return' is set in $extra. public

Definition at line 86 of file object.php.

References $url.

Object::toString (  ) 

Object-to-string conversion. Each class can override this method as necessary.

Returns:
string The name of this class public

Definition at line 73 of file object.php.


Member Data Documentation

Object::$_log = null

Definition at line 44 of file object.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:56 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7