PHP Class Prado\Collections\TListItemCollection

TListItemCollection maintains a list of {@link TListItem} for {@link TListControl}.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TList
显示文件 Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
createListItem ( $index ) : TListItem Creates a list item object.
findIndexByText ( $text, $includeDisabled = true ) : integer Finds the lowest cardinal index of the item whose text is the one being looked for.
findIndexByValue ( $value, $includeDisabled = true ) : integer Finds the lowest cardinal index of the item whose value is the one being looked for.
findItemByText ( $text, $includeDisabled = true ) : TListItem Finds the item whose text is the one being looked for.
findItemByValue ( $value, $includeDisabled = true ) : TListItem Finds the item whose value is the one being looked for.
insertAt ( $index, $item ) Inserts an item into the collection.
loadState ( $state ) Loads state into every item in the collection.
saveState ( ) : array | null Saves state of items.

Protected Methods

Method Description
createNewListItem ( $text = null ) : TListItem

Method Details

createListItem() public method

This method may be overriden to provide a customized list item object.
public createListItem ( $index ) : TListItem
return Prado\Web\UI\WebControls\TListItem list item object

createNewListItem() protected method

protected createNewListItem ( $text = null ) : TListItem
return Prado\Web\UI\WebControls\TListItem new item.

findIndexByText() public method

Finds the lowest cardinal index of the item whose text is the one being looked for.
public findIndexByText ( $text, $includeDisabled = true ) : integer
return integer the index of the item found, -1 if not found.

findIndexByValue() public method

Finds the lowest cardinal index of the item whose value is the one being looked for.
public findIndexByValue ( $value, $includeDisabled = true ) : integer
return integer the index of the item found, -1 if not found.

findItemByText() public method

Finds the item whose text is the one being looked for.
public findItemByText ( $text, $includeDisabled = true ) : TListItem
return Prado\Web\UI\WebControls\TListItem the item found, null if not found.

findItemByValue() public method

Finds the item whose value is the one being looked for.
public findItemByValue ( $value, $includeDisabled = true ) : TListItem
return Prado\Web\UI\WebControls\TListItem the item found, null if not found.

insertAt() public method

Inserts an item into the collection.
public insertAt ( $index, $item )

loadState() public method

This method should only be used by framework and control developers.
public loadState ( $state )

saveState() public method

This method should only be used by framework and control developers.
public saveState ( ) : array | null
return array | null the saved state