コード例 #1
0
ファイル: AStandardObject.php プロジェクト: Broncko/Savant
 /**
  * magic funtion __call
  * implements aop functionality by invoking methods which have a underscore(_) prefix
  * and weave in aspects before and after method
  * @param string $pMethod methodname
  * @param array $pArgs arguments
  */
 public function __call($pMethod = '', $pArgs = array())
 {
     $aspectMethod = '_' . $pMethod;
     if (!\method_exists($this, $aspectMethod)) {
         throw new EFrameworkInterceptor(sprintf("aspectized method %s does not exists\n", $aspectMethod));
     }
     $joinPoint = new AOP\JoinPoints\CMethodCall(\get_class($this), $pMethod, $pArgs);
     AOP\AFramework::weaveIn($this, $joinPoint);
     $joinPoint->result = call_user_method_array($aspectMethod, $this, $pArgs);
     AOP\AFramework::weaveOut($this, $joinPoint);
     return $joinPoint->result;
 }