Agile Toolkit
4.2
Agile Toolkit is a powerful web development framework. Inspired by GUI Applications development
|
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 () |
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
__destruct | ( | ) |
Always call parent if you redefine this
Reimplemented in Model_Table.
__call | ( | $ | method, |
$ | arguments | ||
) |
Reimplemented in jQuery_Chain.
__clone | ( | ) |
Reimplemented in SMlite, Model_Table, AbstractView, Model, DB_dsql, and GiTemplate.
__sleep | ( | ) |
__toString | ( | ) |
Reimplemented in PathFinder_Location, URL, DB_dsql, jQuery_Chain, and Field.
_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");
init | ( | ) |
Initialize object. Always call parent
This method is called for initialization
Reimplemented in Form_Field_Text, Form_Field_Readonly, Form_Field_Checkbox, PathFinder_Location, TMail_Transport, Logger, TMail_Part_Text, SMlite, Form_Field_Upload, TMail_Part, MenuItem, Grid_Advanced, SQLAuth, TMail_Compat, Form_Basic, Model_Table, Model, PageManager, Form_Field_DateSelector, Auth_Basic, CompleteLister, ApiWeb, System_ProcessIO, Page_EntityManager, Menu_Basic, PathFinder, URL, Form_Field, Menu_Compat, Form_Submit, QuickSearch, Page, jUI, Order, Paginator_Compat, Form_Field_DatePicker, jQuery, Filter, Grid_Basic, InfoWindow, Form_Plain, page_DefaultAbout, View_Icon, Form_Hint, HR, P, HelloWorld, SQL_Relation, Page_Tester, View_Tabs_jUItabs, View_CRUD, Paginator_Basic, TMail_Basic, View_Error, H1, H2, H3, H4, H5, Controller_Compat, DB_dsql_mysql, Controller_Data_Array, and Field_Deleted.
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
newInstance | ( | ) |
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 | ) |
Reimplemented in Form_Field_ValueList, TMail_Transport_DBStore, and Field.
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 |
||
) |
$_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.