/** * Creates the repeater for the specified item. * * @param Opf_Item $item The item to repeat. * @param integer $repetitions The number of repetitions. */ public function __construct(Opf_Item $item, $repetitions = 0) { $this->_repetitions = $repetitions; $this->_name = $item->getName(); $this->_wrappers = array(); for ($i = 0; $i < $repetitions; $i++) { $this->_wrappers[] = clone $item; } }
/** * Assigns the widget to a form item. * @param Opf_Item $item The item the widget is assigned to. */ public function setItem(Opf_Item $item) { // TODO: How about assigning forms here? $this->_item = $item; $this->_name = $item->getName(); }