public function loadBehavior($behavior) {
		if(!is_object($behavior))
			return;
		if(!$behavior instanceof \Asgard\Entity\Behavior)
			throw new \Exception($this->entityClass.' has an invalid behavior object.');
		$behavior->setDefinition($this);
		$behavior->load($this);

		$reflection = new \ReflectionClass($behavior);
		foreach($reflection->getMethods() as $methodReflection) {
			if(strpos($methodReflection->getName(), 'call_') === 0)
				$this->calls[str_replace('call_', '', $methodReflection->getName())] = [$behavior, $methodReflection->getName()];
			elseif(strpos($methodReflection->getName(), 'static_') === 0)
				$this->statics[str_replace('static_', '', $methodReflection->getName())] = [$behavior, $methodReflection->getName()];
			elseif($methodReflection->getName() === 'staticCatchAll')
				$this->staticsCatchAll[] = $behavior;
			elseif($methodReflection->getName() === 'callCatchAll')
				$this->callsCatchAll[] = $behavior;
		}

		$this->behaviors[] = $behavior;
	}
public function loadBehavior($behavior) {
		if(!is_object($behavior))
			return;
		if(!$behavior instanceof \Asgard\Entity\Behavior)
			throw new \Exception($this->entityClass.' has an invalid behavior object.');
		$behavior->setDefinition($this);
		$behavior->load($this);

		$reflection = new \ReflectionClass($behavior);
		foreach($reflection->getMethods() as $methodReflection) {
			if(strpos($methodReflection->getName(), 'call_') === 0)
				$this->calls[str_replace('call_', '', $methodReflection->getName())] = [$behavior, $methodReflection->getName()];
			elseif(strpos($methodReflection->getName(), 'static_') === 0)
				$this->statics[str_replace('static_', '', $methodReflection->getName())] = [$behavior, $methodReflection->getName()];
			elseif($methodReflection->getName() === 'staticCatchAll')
				$this->staticsCatchAll[] = $behavior;
			elseif($methodReflection->getName() === 'callCatchAll')
				$this->callsCatchAll[] = $behavior;
		}

		$this->behaviors[] = $behavior;
	}
public function loadBehavior ( $ behavior ) { if ( ! is_object ( $ behavior ) ) return ; if ( ! $ behavior instanceof \ Asgard \ Entity \ Behavior ) throw new \ Exception ( $ this -> entityClass . ' has an invalid behavior object.' ) ; $ behavior -> setDefinition ( $ this ) ; $ behavior -> load ( $ this ) ; $ reflection = new \ ReflectionClass ( $ behavior ) ; foreach ( $ reflection -> getMethods ( ) as $ methodReflection ) { if ( strpos ( $ methodReflection -> getName ( ) , 'call_' ) === 0 ) $ this -> calls [ str_replace ( 'call_' , '' , $ methodReflection -> getName ( ) ) ] = [ $ behavior , $ methodReflection -> getName ( ) ] ; elseif ( strpos ( $ methodReflection -> getName ( ) , 'static_' ) === 0 ) $ this -> statics [ str_replace ( 'static_' , '' , $ methodReflection -> getName ( ) ) ] = [ $ behavior , $ methodReflection -> getName ( ) ] ; elseif ( $ methodReflection -> getName ( ) === 'staticCatchAll' ) $ this -> staticsCatchAll [ ] = $ behavior ; elseif ( $ methodReflection -> getName ( ) === 'callCatchAll' ) $ this -> callsCatchAll [ ] = $ behavior ; } $ this -> behaviors [ ] = $ behavior ; }
Load a behavior.
@param  mixed $behavior
Load a behavior .