Agile Toolkit  4.2
Agile Toolkit is a powerful web development framework. Inspired by GUI Applications development
AbstractObject Class Reference
Inheritance diagram for AbstractObject:
AbstractController AbstractModel AbstractView Auth_Basic Controller Controller_Compat Controller_Data_Array Controller_MVCForm Controller_MVCGrid DB jQuery Logger Order PageManager PathFinder System_HTMLSanitizer TMail_Compat TMail_Transport DB_dsql Field GiTemplate jQuery_Chain Model PathFinder_Location SMlite SQL_Many SQL_Relation System_ProcessIO TMail_Basic TMail_Part URL ApiCLI Form_Field HelloWorld Html LoremIpsum Menu_Compat Menu_Light MenuItem MenuSeparator Page Paginator_Compat Text View

Public Member Functions

 init ()
 __clone ()
 __toString ()
 destroy ()
 removeElement ($short_name)
 _removeElement ($short_name)
 newInstance ()
 add ($class, $short_name=null, $template_spot=null, $template_branch=null)
 getElement ($short_name)
 hasElement ($name)
 rename ($short_name)
 setController ($controller)
 setModel ($model)
 getModel ()
 memorize ($name, $value)
 learn ($name, $value1=null, $value2=null, $value3=null)
 forget ($name=null)
 recall ($name, $default=null)
 exception ($message, $type=null)
 fatal ($error, $shift=0)
 info ($msg)
 debug ($msg, $file=null, $line=null)
 warning ($msg, $shift=0)
 upCall ($type, $args=array())
 addHook ($hook_spot, $callable, $arguments=array(), $priority=5)
 removeHook ($hook_spot)
 hook ($hook_spot, $arg=array())
 breakHook ($return)
 __call ($method, $arguments)
 tryCall ($method, $arguments)
 addMethod ($name, $callable)
 hasMethod ($name)
 removeMethod ($name)
 logVar ($var, $msg="")
 logInfo ($info, $msg="")
 logError ($error, $msg="")
 _unique (&$array, $desired=null)
 __destruct ()
 __sleep ()

Data Fields

 $settings = array('extension'=>'.html')
 $model
 $controller
 $default_exception = 'BaseException'
 $default_controller = null
 $name
 $short_name
 $elements = array ()
 $owner
 $api
 $auto_track_element = false
 $_initialized = false
 $hooks = array ()

Detailed Description

A base class for all objects/classes in Agile Toolkit. Do not directly inherit from this class, instead use one of AbstractModel, AbstractController or AbstractView

http://agiletoolkit.org/learn/intro


Constructor & Destructor Documentation

Always call parent if you redefine this

Reimplemented in Model_Table.


Member Function Documentation

__call ( method,
arguments 
)

Reimplemented in jQuery_Chain.

__clone ( )

Reimplemented in SMlite, Model_Table, AbstractView, Model, DB_dsql, and GiTemplate.

__sleep ( )
_removeElement ( short_name)
_unique ( &$  array,
desired = null 
)

This funcion given the associative $array and desired new key will return the best matching key which is not yet in the arary. For example if you have array('foo'=>x,'bar'=>x) and $desired is 'foo' function will return 'foo_2'. If 'foo_2' key also exists in that array, then 'foo_3' is returned and so on.

Reimplemented in DB_dsql.

add ( class,
short_name = null,
template_spot = null,
template_branch = null 
)

Creates new object and adds it as a child. Returns new object http://agiletoolkit.org/learn/understand/base/adding

addHook ( hook_spot,
callable,
arguments = array(),
priority = 5 
)

If priority is negative, then hooks will be executed in reverse order

addMethod ( name,
callable 
)

Add new method for this object

breakHook ( return)
debug ( msg,
file = null,
line = null 
)

Use this function to send debug information. Information will only be sent if you enable debug localy (per-object) by setting $this->debug=true or per-apllication by setting $api->debug=true;

You also may enable debug globaly: $this->api->debug=true; but disable for object $object->debug=false;

destroy ( )

Removes object from parent and prevents it from renedring

Reimplemented in Auth_Basic, and Field_Reference.

exception ( message,
type = null 
)
fatal ( error,
shift = 0 
)

If you have fatal error in your object use the following code:

return $this->fatal("Very serious problem!");

This line will notify parent about fatal error and return null to the caller. Caller don't have to handle error messages, just throw everything up.

Fatal calls are intercepted by API. Or if you want you can intercept them yourself.

TODO: record debug_backtrace depth so we could point acurately at the function/place where fatal is called from.

forget ( name = null)

Forget session data for arg $name. Null forgets all data relevant to this object

getElement ( short_name)

Find child element by their short name. Use in chaining. Exception if not found.

getModel ( )

Reimplemented in AbstractView, Field, and Field_Reference.

hasElement ( name)

Find child element. Use in condition.

hasMethod ( name)

Return if this object have specified method

hook ( hook_spot,
arg = array () 
)
info ( msg)

Call this function to send some information to API. Example:

$this->info("User tried buying traffic without enough money in bank");

learn ( name,
value1 = null,
value2 = null,
value3 = null 
)

Remember one of the supplied arguments, which is not-null

logError ( error,
msg = "" 
)
logInfo ( info,
msg = "" 
)
logVar ( var,
msg = "" 
)
memorize ( name,
value 
)

Remember object-relevant session data

recall ( name,
default = null 
)

Returns session data for this object. If not set, $default is returned

removeElement ( short_name)

Remove child element if it exists

removeHook ( hook_spot)
removeMethod ( name)
rename ( short_name)

Names object accordingly. May not work on some objects

setController ( controller)

Reimplemented in Menu_Compat, View_CRUD, and View_Tabs.

setModel ( model)
tryCall ( method,
arguments 
)

[private] attempts to call method, returns array containing result or false

upCall ( type,
args = array () 
)

Try to handle something on our own and in case we are not able, pass to parent. Such as messages, notifications and request for additional info or descriptions are passed this way.

Reimplemented in ApiCLI.

warning ( msg,
shift = 0 
)

Field Documentation

$_initialized = false
$api

Always points to current API

Reimplemented in Logger.

$auto_track_element = false

When this object is added, owner->elements[$this->short_name] will be == $this;

Reimplemented in PathFinder_Location, TMail_Part, AbstractView, Field, and SQL_Many.

$controller

Reference to the current controller. Read only. Use setController()

Reimplemented in Page_EntityManager.

$default_controller = null

Default controller to initialize when calling setModel()

Reimplemented in Grid_Advanced, AbstractView, Form_Basic, and Grid_Basic.

$default_exception = 'BaseException'

Exception class to use when $this->exception() is called

Reimplemented in Form_Basic, Model, DB_dsql, Page, and GiTemplate.

$elements = array ()

short_name => object hash of children objects

$hooks = array ()
$model

Reference to the current model. Read only. Use setModel()

Reimplemented in TMail_Transport_DBStore, Page_EntityManager, Controller_MVCForm, and Controller_MVCGrid.

$name

Unique object name

$owner

Link to object into which we added this object

Reimplemented in Logger.

$settings = array('extension'=>'.html')

Reimplemented in SMlite.

$short_name

Name of the object in owner's element array

Reimplemented in Form_Field.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations