<?php
/**
 * @version     $Id$
 * @category	Koowa
 * @package     Koowa_Event
 * @copyright   Copyright (C) 2007 - 2010 Johan Janssens and Mathias Verraes. All rights reserved.
 * @license     GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link        http://www.koowa.org
 */

/**
 * Class to handle events.
 *
 * @author 		Johan Janssens <johan@koowa.org>
 * @category	Koowa
 * @package 	Koowa_Event
 */
class KEventHandler extends KObject implements KPatternObserver, KObjectIdentifiable
{
	/**
	 * Get the object identifier
	 * 
	 * @return	KIdentifier	
	 * @see 	KObjectIdentifiable
	 */
	public function getIdentifier()
	{
		return $this->_identifier;
	}
	
	/**
	 * Method to trigger events
	 *
	 * @param  object	The event arguments
	 * @return mixed Routine return value
	 */
	public function update(ArrayObject $args)
	{		
		if (in_array($args['event'], $this->getMethods())) {
			return $this->{$args['event']}($args);
		} 
		
		return null;
	}
}
<?php
/**
 * @version     $Id$
 * @category	Koowa
 * @package     Koowa_Event
 * @copyright   Copyright (C) 2007 - 2010 Johan Janssens and Mathias Verraes. All rights reserved.
 * @license     GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link        http://www.koowa.org
 */

/**
 * Class to handle events.
 *
 * @author 		Johan Janssens <johan@koowa.org>
 * @category	Koowa
 * @package 	Koowa_Event
 */
class KEventHandler extends KObject implements KPatternObserver, KObjectIdentifiable
{
	/**
	 * Get the object identifier
	 * 
	 * @return	KIdentifier	
	 * @see 	KObjectIdentifiable
	 */
	public function getIdentifier()
	{
		return $this->_identifier;
	}
	
	/**
	 * Method to trigger events
	 *
	 * @param  object	The event arguments
	 * @return mixed Routine return value
	 */
	public function update(KConfig $args)
	{		
		if (in_array($args->event, $this->getMethods())) {
			return $this->{$args->event}($args);
		} 
		
		return null;
	}
}
Update method should use KConfig instead of ArrayObject as parameter.
Update method should use KConfig instead of ArrayObject as parameter.
