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

Class: Item

Source Location: /Item.php

Class Item

Class Overview

Controller item class. Controller Units operate on Items

Located in /Item.php [line 15]

Instance
   |
   --Item

Methods

[ Top ]
Descendants
Child Class Description
Link A Link is an Item that belongs to Relation and links Items from several Units together

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

Inherited From Instance

Instance::$data
Instance::$entity

Inherited From Instance

Instance::__construct()
Creates object from SQL result row or array of parameter values or blank to be filled later.
Instance::delete()
Removes object instance from the database
Instance::exists()
Checks whether instance exists in database
Instance::get_key()
Instance::save()
Saves unit object in database. Performs UPDATE if object ID is set or INSERT otherwise.
Instance::__get()
Returns property value
Instance::__isset()
Checks for property
Instance::__set()
Sets property value
Instance::__unset()
Unsets property value

[ Top ]
Method Summary
Item   __construct()   Instance constructor. Creates object from SQL result row, loads by ID or just leaves blank to be filled later.
void   display()   Single object display using XTemplate object.
void   display_auto()   Row-based automatic unit render TPL designer specifies parameters implicitly with row block.
Item   get_referenced_item()   Gets a referenced object as result row to be passed to exact class constructor
array   get_referencing_items()   Gets all items which reference to this item with a specific entity parameter.
array   get_related_items()   Gets items from another Unit which reference to this Item with a many-to-many Relation
bool   import()   Imports data from user input, validates it and stores in the object
bool   load()   Loads object from database

[ Top ]
Methods
Constructor __construct  [line 23]

  Item __construct( [Unit $unit = NULL], [mixed $source = NULL]  )

Instance constructor. Creates object from SQL result row, loads by ID or just leaves blank to be filled later.

Parameters:
Unit   $unit:  Reference to parent unit
mixed   $source:  ID or query result row

API Tags:
Access:  public


Redefinition of:
Instance::__construct()
Creates object from SQL result row or array of parameter values or blank to be filled later.

Redefined in descendants as:
  • Link::__construct() : Instance constructor. Creates object from SQL result row, loads by ID or just leaves blank to be filled later.

[ Top ]
display  [line 216]

  void display( XTemplate $tpl, string $block  )

Single object display using XTemplate object.

Controller logic for XTemplate: assings tags, parses blocks. TPL designer must specify unit parameters explicitly. TPL example: <!-- BEGIN: MY_UNIT --> <stong>{FOO_TITLE}:</strong> {FOO} <stong>{BAR_TITLE}:</strong> {BAR} <!-- END: MY_UNIT -->

Parameters:
XTemplate   $tpl:  Layout template object
string   $block:  Full block name to render the object in, e.g. 'MAIN.MY_UNIT'

API Tags:
Access:  public


Redefined in descendants as:
  • Link::display() : Row-based automatic unit render TPL designer specifies parameters implicitly with row block.

[ Top ]
display_auto  [line 251]

  void display_auto( XTemplate $tpl, string $block, [string $row_block = 'PARAM'], [string $title_tag = 'PARAM_TITLE'], [string $value_tag = 'PARAM_VALUE']  )

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

TPL example: <!-- BEGIN: MY_UNIT --> <!-- BEGIN: MY_PARAM --> <stong>{PARAM_TITLE}:</strong> {PARAM_VALUE} <!-- 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   $title_tag:  Tag name for parameter title
string   $value_tag:  Tag name for parameter value

API Tags:
Access:  public


[ Top ]
get_referenced_item  [line 121]

  Item get_referenced_item( string $param_name  )

Gets a referenced object as result row to be passed to exact class constructor

Parameters:
string   $param_name:  Reference parameter name

API Tags:
Return:  An item that is referenced to
Access:  public


[ Top ]
get_referencing_items  [line 140]

  array get_referencing_items( Unit $unit, [string $param_name = '']  )

Gets all items which reference to this item with a specific entity parameter.

Parameters:
Unit   $unit:  Unit that references to this unit
string   $param_name:  Referencing parameter name

API Tags:
Return:  List of Items
Access:  public


[ Top ]
get_related_items  [line 174]

  array get_related_items( Unit $unit, Relation $relation, [string $relation_source = ''], [string $relation_target = '']  )

Gets items from another Unit which reference to this Item with a many-to-many Relation

Parameters:
Unit   $unit:  Target unit which relates to this unit
Relation   $relation:  Relation which connects units
string   $relation_source:  Relation parameter name which references to this item
string   $relation_target:  Relation parameter which references to target unit

API Tags:
Return:  List of Items
Access:  public


[ Top ]
import  [line 89]

  bool import( [string $method = 'P'], [string $prefix = NULL]  )

Imports data from user input, validates it and stores in the object

Parameters:
string   $method:  Input method 'P' for POST or 'G' for GET
string   $prefix:  Input name prefix, defaults to database column prefix

API Tags:
Return:  TRUE on successfull validation or FALSE if validation has failed
See:  Unit::display_add()
Access:  public


[ Top ]
load  [line 69]

  bool load( int $id  )

Loads object from database

Parameters:
int   $id:  Instance ID

API Tags:
Return:  TRUE on success, FALSE on error
Access:  public


[ Top ]

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