<?php

/**
 * Action Composite
 *
 * Composite object for other IActionAdapter objects.
 * Useful if you need to perform more than one Action and/or Behaviour on event.
 *
 * @version DR1.7
 */
class ActionComposite implements IActionAdapter {



	protected $adapters;



	public function __construct(ArrayObject $a) {
		$this->adapters = new ArrayObject();
		foreach ($a as $i => $adapter) {
			if (!($adapter instanceof IActionAdapter)) {
				throw new Exception("IActionAdapter expected at position $a");
			}
			$this->adapters[] = $adapter;
		}
	}



	public function __toString() {
		$out = '';
		foreach ($this->adapters as $adapter)
			$out .= $adapter->__toString() . '; ';
		return $out;
	}



} // class ActionComposite

?>