메소드 |
설명 |
|
__call ( string $method, array $arguments ) : mixed |
Call method is used to display exception for non-existant methods and
provides ability to extend objects with addMethod(). |
|
__clone ( ) : AbstractObject |
Clones associated controller and model. If cloning views, add them to
the owner. |
|
__construct ( array $options = [] ) |
This is default constructor of ATK4. Please do not re-define it
and avoid calling it directly. Always use add() and init() methods. |
|
__destruct ( ) |
Always call parent if you redefine this/. |
|
__sleep ( ) : mixed |
Do not serialize objects. |
|
__toString ( ) : string |
Converts into string "Object View(myapp_page_view)". |
|
_removeElement ( string $short_name ) |
Actually removes the element. |
|
_shorten ( string $desired ) : string |
Method used internally for shortening object names. |
|
_ticker ( ) |
|
|
_unique ( &$array, string $desired = null ) : string |
This funcion given the associative $array and desired new key will return
the best matching key which is not yet in the array. |
|
_unique_element ( $desired = null ) |
|
|
add ( array | string | object $class, array | string $options = null, string $template_spot = null, array | string $template_branch = null ) : AbstractObject |
Creates new object and adds it as a child of current object. |
|
addHook ( string $hook_spot, AbstractObject | callable $callable, array $arguments = [], integer $priority = 5 ) |
If priority is negative, then hooks will be executed in reverse order. |
|
addMethod ( string | array $name, callable $callable ) |
Add new method for this object. |
|
breakHook ( mixed $return ) |
When called from inside a hook callable, will stop execution of other
callables on same hook. The passed argument will be returned by the
hook method. |
|
debug ( boolean | string $msg = true, string $file = null, string $line = null ) |
Turns on debug mode for this object. |
|
destroy ( $recursive = true ) |
Removes object from parent and prevents it from rendering
\code
$view = $this->add('View');
$view -> destroy();
\endcode. |
|
each ( string | callable $callable ) |
A handy shortcut for foreach(){ . |
|
exception ( string $message = 'Undefined Exception', string $type = null, string $code = null ) : BaseException |
Returns relevant exception class. Use this method with "throw". |
|
fatal ( string $error, integer $shift ) |
Reports fatal error. Use ->exception instead. |
|
forget ( string $key = null ) |
Forget session data for arg $key. If $key is omitted will forget all
associated session data. |
|
getElement ( string $short_name ) : AbstractObject |
Find child element by its short name. Use in chaining. |
|
getModel ( ) : AbstractModel |
Return current model. |
|
hasElement ( string $short_name ) : AbstractObject | boolean |
Find child element. Use in condition. |
|
hasMethod ( string $name ) : boolean |
Return if this object has specified method (either native or dynamic). |
|
hook ( string $hook_spot, array $arg = [] ) : mixed |
Execute all callables assigned to $hook_spot. |
|
info ( $msg ) |
|
|
init ( ) |
Initialize object. Always call parent::init(). Do not call directly. |
|
learn ( string $key, mixed $default = null ) : mixed |
Similar to memorize, but if value for key exist, will return it. |
|
logError ( string $error, string $msg = '' ) |
Output string into error file. |
|
logInfo ( string $info, string $msg = '' ) |
Output string into info file. |
|
logVar ( string $var, string $msg = '' ) |
Output string into log file. |
|
memorize ( string $key, mixed $value ) : mixed |
Remember data in object-relevant session data. |
|
newInstance ( array $properties = null ) : self |
Creates one more instance of $this object. |
|
recall ( string $key, mixed $default = null ) : mixed |
Returns session data for this object. If not previously set, then
$default is returned. |
|
removeElement ( string $short_name ) |
Remove child element if it exists. |
|
removeHook ( string $hook_spot ) |
Delete all hooks for specified spot. |
|
removeMethod ( string $name ) |
Remove dynamically registered method. |
|
rename ( string $short_name ) |
Names object accordingly. May not work on some objects. |
|
runTests ( Tester $tester = null ) |
This method will find private methods started with test_ in
the current class and will execute each method in succession
by passing $t argument to it. Before each test execution
takes place, $t->prepareForTest($test) will be called. It must
return non-false for test to be carried out. |
|
setController ( string | object $controller, string | array $name = null ) : AbstractController |
Associate controller with the object. |
|
setModel ( string | object $model ) : AbstractModel |
Associate model with object. |
|
tryCall ( string $method, array $arguments ) : mixed |
Attempts to call dynamic method. Returns array containing result or false. |
|
upCall ( string $type, array $args = [] ) |
Call specified method for this class and all parents up to app. |
|
warning ( string $msg, integer $shift ) |
Records warning. |
|