public function call(Entity $entity, $name, array $arguments) {
		if(isset($this->calls[$name])) {
			array_unshift($arguments, $entity);
			return call_user_func_array($this->calls[$name], $arguments);
		}
		else {
			foreach($this->callsCatchAll as $behavior) {
				$processed = false;
				$res = call_user_func_array([$behavior, 'callCatchAll'], [$entity, $name, $arguments, &$processed]);
				if($processed)
					return $res;
			}

			throw new \Exception('Method '.$name.' does not exist for entity '.$this->entityClass);
		}
	}
public function call(Entity $entity, $name, array $arguments) {
		if(isset($this->calls[$name])) {
			array_unshift($arguments, $entity);
			return call_user_func_array($this->calls[$name], $arguments);
		}
		else {
			foreach($this->callsCatchAll as $behavior) {
				$processed = false;
				$res = call_user_func_array([$behavior, 'callCatchAll'], [$entity, $name, $arguments, &$processed]);
				if($processed)
					return $res;
			}

			throw new \Exception('Method '.$name.' does not exist for entity '.$this->entityClass);
		}
	}
public function call ( Entity $ entity , $ name , array $ arguments ) { if ( isset ( $ this -> calls [ $ name ] ) ) { array_unshift ( $ arguments , $ entity ) ; return call_user_func_array ( $ this -> calls [ $ name ] , $ arguments ) ; } else { foreach ( $ this -> callsCatchAll as $ behavior ) { $ processed = false ; $ res = call_user_func_array ( [ $ behavior , 'callCatchAll' ] , [ $ entity , $ name , $ arguments , & $ processed ] ) ; if ( $ processed ) return $ res ; } throw new \ Exception ( 'Method ' . $ name . ' does not exist for entity ' . $ this -> entityClass ) ; } }
Handle a custom call.
@param  Entity $entity
@param  string $name
@param  array  $arguments
@throws \Exception If method name does not exist.
@return mixed
Handle a custom call .