Changeset 2500

User picture

Author: Johan Janssens

(2010/08/28 15:23) Over 1 year ago

Implemented KCommandInterface::getPriority() function.

Affected files

Updated branches/99-toolbar/code/libraries/koowa/mixin/callback.php Download diff

24992500
24
 	 */
24
 	 */
25
	protected $_callbacks = array();
25
	protected $_callbacks = array();
26
	
26
	
27
	
27
	/**
28
	/**
29
	 * The command priority
30
	 *
31
	 * @var KIdentifierInterface
32
	 */
33
	protected $_priority;
34
	
35
	/**
28
	 * Object constructor
36
	 * Object constructor
29
	 *
37
	 *
30
	 * @param 	object 	An optional KConfig object with configuration options
38
	 * @param 	object 	An optional KConfig object with configuration options
...
...
36
		if(is_null($config->command_chain)) {
44
		if(is_null($config->command_chain)) {
37
			throw new KMixinException('command_chain [KCommandChain] option is required');
45
			throw new KMixinException('command_chain [KCommandChain] option is required');
38
		}
46
		}
47
		
48
		//Set the command priority
49
		$this->_priority = $config->command_priority;
39
	
50
	
40
		//Enque the command in the mixer's command chain
51
		//Enque the command in the mixer's command chain
41
		$config->command_chain->enqueue($this, $config->command_priority);
52
		$config->command_chain->enqueue($this, $this->getPriority());
42
	}
53
	}
43
	
54
	
44
	/**
55
	/**
...
...
165
	 */
176
	 */
166
	public function getMixableMethods(KObject $mixer = null) 
177
	public function getMixableMethods(KObject $mixer = null) 
167
	{
178
	{
168
        return array_diff(parent::getMixableMethods(), array('execute'));  
179
        return array_diff(parent::getMixableMethods(), array('execute', 'getPriority'));  
169
	}
180
	}
181
	
182
	/**
183
	 * Get the priority of a behavior
184
	 *
185
	 * @return	integer The command priority
186
	 */
187
  	public function getPriority()
188
  	{
189
  		return $this->_priority;
190
  	}
170
}
191
}