Item
[ class tree: Item ] [ index: Item ] [ all elements ]

Class: Formagic_Item_Container

Source Location: /Item/Container.php

Class Overview

Formagic_Item
   |
   --Formagic_Item_Container

Formagic Container Item class


Author(s):

  • Florian Sonnenburg

Version:

  • $Id: Container.php 11 2007-08-12 20:02:57Z meweasle $

Copyright:

  • Copyright (c) 2007 Florian Sonnenburg

Variables

Methods


Child classes:

Formagic_Item_Page
Formagic page item class
Formagic_Item_PageController
Formagic_Item_PageController

Inherited Variables

Inherited Methods

Class: Formagic_Item

Formagic_Item::__construct()
Constructor
Formagic_Item::addRule()
Adds rule object to Formagic item
Formagic_Item::block()
Sets blocked flag
Formagic_Item::disable()
Sets disabled flag for item and thus removes it from form
Formagic_Item::getCaller()
Returns parent Formagic object
Formagic_Item::getErrorMessage()
Returns item error message
Formagic_Item::getHtml()
HTML template for renderers that use HTML-Code
Formagic_Item::getLabel()
Returns label for this item.
Formagic_Item::getValue()
Returns current value for this item
Formagic_Item::hasRule()
Tells if rule exists for this item
Formagic_Item::isDisabled()
Returns disabled status of item
Formagic_Item::isHidden()
Returns hidden status of item
Formagic_Item::setAttributes()
Sets additional attributes for this item
Formagic_Item::setCaller()
Can be called to set caller object if not passed to constructor
Formagic_Item::setHidden()
Sets hidden flag for item
Formagic_Item::validate()
Performs rule checks
Formagic_Item::_execEvent()
Event dispatcher
Formagic_Item::_getAttributeStr()
Returns attribute string for HTML tag
Formagic_Item::_handleArg()
Handler for additional item arguments
Formagic_Item::_onCreate()
Executed when object is created
Formagic_Item::_onFetch()
Executed when Formagic::fetch() is called
Formagic_Item::_onPostValidate()
Executed after item validation is done
Formagic_Item::_onPreValidate()
Executed before item validation
Formagic_Item::__toString()
Returns string representation of formItem object

Class Details

[line 41]
Formagic Container Item class

Changes on following flag will be applied recursively to all items added to the container object:

  • _isHidden
  • _isBlocked
  • _isDisabled
Changes on the flag _isPostItem will only be applied to the container item itself (and defaults to false as there is no use posting a container item).




Tags:

author:  Florian Sonnenburg
version:  $Id: Container.php 11 2007-08-12 20:02:57Z meweasle $
copyright:  Copyright (c) 2007 Florian Sonnenburg


[ Top ]


Class Variables

$hasHtml =  true

[line 59]

Tells renderer if container has its own surrounding template



Tags:

access:  public

Type:   boolean


[ Top ]

$headline =  ''

[line 53]

Container headline



Tags:

access:  public

Type:   string


[ Top ]

$_items = array()

[line 47]

Pointer to items array section of formagic object



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


method addItem [line 105]

object formagicItem addItem( mixed $type, string $name, [array $args = null])

Adds formagic item object to array of items.

Creates new item object and adds this, or adds passed formagicItem object




Tags:

return:  object
access:  public


Overridden in child classes as:

Formagic_Item_PageController::addItem()
Overwrites Formagic_Container::addItem()

Parameters:

mixed   $type   String with item type or formagicItem object
string   $name   String with item name. NULL if $type is formagicItem object
array   $args   Array with additional item information. NULL if $type is formagicItem object

[ Top ]

method block [line 175]

boolean block( )

Blocks container item and all its descendants



Tags:

access:  public


Overrides Formagic_Item::block() (Sets blocked flag)

[ Top ]

method countItems [line 130]

integer countItems( )

Counts items added to self and all sub-containers



Tags:

access:  public


[ Top ]

method disable [line 207]

boolean disable( )

Disables container item and all its descendants and thus removes all involved items from form



Tags:

access:  public


Overrides Formagic_Item::disable() (Sets disabled flag for item and thus removes it from form)

[ Top ]

method getAttributeStr [line 236]

string getAttributeStr( )

Returns HTML attributes as one assembled string



Tags:

access:  public


[ Top ]

method getItem [line 162]

Formagic_Item getItem( integer $name)

Returns added item $name

Throws Formagic_Exception if item does not exist




Tags:

throws:  Formagic_Exception
access:  public


Parameters:

integer   $name  

[ Top ]

method getItems [line 148]

array &getItems( )

Returns pointer to items array



Tags:

access:  public


Overridden in child classes as:

Formagic_Item_PageController::getItems()
Returns items of currently displayed page

[ Top ]

method getValue [line 222]

array &getValue( )

Returns values of all stored items.



Tags:

access:  public


Overrides Formagic_Item::getValue() (Returns current value for this item)

[ Top ]

method setHidden [line 190]

boolean setHidden( $flag)

Sets hidden flag on container item and all its descendants



Tags:

access:  public


Overrides Formagic_Item::setHidden() (Sets hidden flag for item)

Parameters:

   $flag  

[ Top ]

method validate [line 253]

boolean validate( )

Validates containing items

Iterates through all containing items. If any rule is violated, sub-item will return violated Formagic_Rule item and the container will pass it on.

If all items pass violation, validate() calls onValidate-handler and returns its result.




Tags:

access:  public


Overrides Formagic_Item::validate() (Performs rule checks)

[ Top ]

method _handleArg [line 68]

void _handleArg( string $key, mixed $arg)

Generic argument handler



Tags:

access:  protected


Overrides Formagic_Item::_handleArg() (Handler for additional item arguments)

Parameters:

string   $key  
mixed   $arg  

[ Top ]

method _onCreate [line 84]

boolean _onCreate( )

OnCreate-Handler implementation



Tags:

access:  protected


Overrides Formagic_Item::_onCreate() (Executed when object is created)

[ Top ]

method _onFetch [line 274]

void _onFetch( )

OnFetch-handler implementation



Tags:

access:  protected


Overridden in child classes as:

Formagic_Item_PageController::_onFetch()
Implementation of fetch handler

Overrides Formagic_Item::_onFetch() (Executed when Formagic::fetch() is called)

[ Top ]


Documentation generated on Thu, 23 Aug 2007 00:29:35 +0200 by phpDocumentor 1.4.0