Source for file List.php
Documentation is available at List.php
declare(encoding = "utf-8");
* This file is part of ForwardFW a web application framework.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* @author Alexander Opitz <opitz.alexander@primacom.net>
* @copyright 2009,2010 The Authors
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
* @link http://forwardfw.sourceforge.net
* @since File available since Release 0.0.1
require_once 'ForwardFW/Object.php';
* This is the basic List class for ForwardFW Object
* @author Alexander Opitz <opitz.alexander@primacom.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
* @link http://forwardfw.sourceforge.net
* Name of the object this list will manage
* Creates a new object of type $strObjectName which won't be added to list
* and returns this object.
* @return ForwardFW_Object The created Base_Object
return new $this->strObjectName();
* Creates a new Object of type $strObjectName, adds it to the list and
* @return ForwardFW_Object
* Adds object to the list
* @param ForwardFW_Object $obj The object which should be add
* @return boolean if $obj could be add to the list
public function addToList(ForwardFW_Object $obj)
* Removes given Object from List and returns state if it was in list.
* @param ForwardFW_Object $obj The object that should be removed from list.
* @return boolean True if object could be removed otherwise false
foreach ($this as $key => $value) {
if ($value->ID == $obj->ID) {
* Creates a new object of the List type, loads it with the array information
* and add it to the list.
* @param array $arObject An Array which have fill up Data for the object
$obj->loadByArray($arObject);
* Loads an array to this list. The array needs to hold arrays with the data
* @param array $arData the array with the objects for this list.
foreach ($arData as $arObject) {
* Examines if the given object is from typet this list will hold.
* @param ForwardFW_Object $obj Object to examine
* @return boolean True if given object can be managed by this list
* @TODO: Examine if it is a child of type
public function isUseable(ForwardFW_Object $obj)
* Returns the Name of the objects this list will manage
* @return string Name of the objects
|