phpDocumentor CCL
[ class tree: CCL ] [ index: CCL ] [ all elements ]

Class: Unit

Source Location: /Unit.php

Class Unit

Descendants
Child Class Description
Relation Link is a relation that links Units with each other

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Entity

Entity::$col_prefix
Entity::$name
Entity::$primary_key
Entity::$table_name
Entity::$table_prefix

Inherited From Container

Container::$data

Inherited From Entity

Entity::__construct()
Entity constructor
Entity::add()
Adds a new entry to the entity parameter list. After the parameter has been added, you will be able to access it by name in associative array style.
Entity::define()
Defines entity structure all at once
Entity::get_primary_key()
Fetches Param used as primary key for the entity

Inherited From Container

Container::__construct()
Constructs container and puts data inside
Container::current()
Returns current container element
Container::key()
Fetches current key from the container
Container::key_exists()
Checks if key exists in container
Container::next()
Fetches next element from the container
Container::offsetExists()
Checks if any item is assigned to a key
Container::offsetGet()
Returns contained item by key or NULL on error
Container::offsetSet()
Sets a contained item value in array style
Container::offsetUnset()
Removes contained item by key
Container::rewind()
Sets iterator pointer to the beginning of the container
Container::serialize()
Serializes the container
Container::unserialize()
Unserializes container data
Container::valid()
Checks if iterator pointer points to a valid element (non-false)

[ Top ]
Property Summary
array   $back_references  
string   $item_class  
string   $item_title  
string   $order  
array   $relations  
string   $title  
string   $zone  

[ Top ]
Method Summary
Unit   __construct()   Initializes controller Unit
void   add()   Basic add scenario
void   display_form()   Renders add/edit form display. A form will be empty if object has no data and if some data was imported, it will be already in the inputs.
void   display_form_auto()   Row-based automatic form render TPL designer specifies parameters implicitly with row block.
void   display_item()   Basic item display scenario
void   display_list()   Renders a simple list of objects to be displayed on screen.
void   display_list_edit()   Renders an editable list of objects to edit many instances of the entity at once
void   edit()   Basic edit scenario
void   list_items()   Basic item listing scenario
void   main()   Basic main unit scenario
void   remove()   Basic remove scenario

[ Top ]
Properties
array   $back_references = array() [line 22]
API Tags:
Access:  public


[ Top ]
string   $item_class = 'Item' [line 34]
API Tags:
Access:  public


[ Top ]
string   $item_title = '' [line 38]
API Tags:
Access:  public


[ Top ]
string   $order = '' [line 42]
API Tags:
Access:  public


[ Top ]
array   $relations = array() [line 18]
API Tags:
Access:  public


[ Top ]
string   $title [line 30]
API Tags:
Access:  public


[ Top ]
string   $zone [line 26]
API Tags:
Access:  public


[ Top ]
Methods
Constructor __construct  [line 53]

  Unit __construct( string $name, [string $item_class = 'Item'], [string $prefix = ''], [string $col_prefix = ''], [array $params = NULL], [string $primary_key = 'id']  )

Initializes controller Unit

Parameters:
string   $name:  Unit name
string   $item_class:  Name of the Item class representing objects for this Unit
string   $prefix:  Table prefix
string   $col_prefix:  Column prefix
array   $params:  Array of Param objects
string   $primary_key:  Primary key

API Tags:
Access:  public


Redefinition of:
Entity::__construct()
Entity constructor

Redefined in descendants as:

[ Top ]
add  [line 204]

  void add( )

Basic add scenario


API Tags:
Access:  public


Redefinition of:
Entity::add()
Adds a new entry to the entity parameter list. After the parameter has been added, you will be able to access it by name in associative array style.

[ Top ]
display_form  [line 83]

  void display_form( XTemplate $tpl, [string $block = 'MAIN'], [string $action = 'update'], [Item $item = NULL]  )

Renders add/edit form display. A form will be empty if object has no data and if some data was imported, it will be already in the inputs.

TPL designer must specify unit parameters explicitly. TPL example: <!-- BEGIN: MY_UNIT --> <form action="{ACTION}" method="post"> <stong>{FOO_TITLE}:</strong> {FOO_INPUT} <em>{FOO_HINT}</em> <stong>{BAR_TITLE}:</strong> {BAR_INPUT} <em>{BAR_HINT}</em> <input type="submit" value="Submit" /> </form> <!-- END: MY_UNIT -->

Parameters:
XTemplate   $tpl:  Layout template object
string   $block:  Full block name to render the object in, e.g. 'MAIN.MY_UNIT'
string   $action:  Action that is being performed by the form. Usually 'edit', 'add' or 'remove'
Item   $item:  An imported item if performing edit rather than add

API Tags:
See:  Item::import(), Unit::display_form_auto()
Access:  public


[ Top ]
display_form_auto  [line 135]

  void display_form_auto( XTemplate $tpl, string $block, string $row_block, [string $action = 'update'], [Item $item = NULL], [string $title_tag = 'PARAM_TITLE'], [string $input_tag = 'PARAM_INPUT'], [string $hint_tag = 'PARAM_HINT']  )

Row-based automatic form render TPL designer specifies parameters implicitly with row block.

TPL example: <!-- BEGIN: MY_UNIT --> <!-- BEGIN: MY_PARAM --> <stong>{PARAM_TITLE}:</strong> {PARAM} <!-- END: MY_PARAM --> <!-- END: MY_UNIT -->

Parameters:
XTemplate   $tpl:  Layout template object
string   $block:  Full block name to render the object in, e.g. 'MAIN.MY_UNIT'
string   $row_block:  Row block name for parameter row, e.g. 'MY_PARAM'
string   $action:  Action that is being performed by the form. Usually 'edit', 'add' or 'remove'
Item   $item:  An imported item if performing edit rather than add
string   $title_tag:  Tag name for parameter title
string   $input_tag:  Tag name for parameter value input
string   $hint_tag:  Tag name for hint displayed for the input

API Tags:
See:  Unit::display_form()
Access:  public


[ Top ]
display_item  [line 385]

  void display_item( )

Basic item display scenario


API Tags:
Access:  public


[ Top ]
display_list  [line 173]

  void display_list( XTemplate $tpl, [string $block = 'MAIN'], [string $filter = ''], [int $start = 0], [int $items = NULL]  )

Renders a simple list of objects to be displayed on screen.

Parameters:
XTemplate   $tpl:  Layout template object
string   $block:  Full block name to render the object in, e.g. 'MAIN.MY_UNIT'
string   $filter:  Filter condition
int   $start:  Index of an item in the result set to start with
int   $items:  Max. number of items to select from result set. NULL - unlimited.

API Tags:
Access:  public


[ Top ]
display_list_edit  [line 196]

  void display_list_edit( XTemplate $tpl, [string $block = 'MAIN'], [string $filter = ''], [int $start = 0], [int $items = NULL]  )

Renders an editable list of objects to edit many instances of the entity at once

Parameters:
XTemplate   $tpl:  Layout template object
string   $block:  Full block name to render the object in, e.g. 'MAIN.MY_UNIT'
string   $filter:  Filter condition
int   $start:  Index of an item in the result set to start with
int   $items:  Max. number of items to select from result set. NULL - unlimited.

API Tags:
Access:  public


[ Top ]
edit  [line 252]

  void edit( )

Basic edit scenario


API Tags:
Access:  public


[ Top ]
list_items  [line 345]

  void list_items( )

Basic item listing scenario


API Tags:
Access:  public


[ Top ]
main  [line 401]

  void main( )

Basic main unit scenario


API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
remove  [line 314]

  void remove( )

Basic remove scenario


API Tags:
Access:  public


[ Top ]

Documentation generated on Thu, 09 Jul 2009 14:11:37 +0400 by phpDocumentor 1.4.1