/**
  *  割り込み処理を起動する
  *
  *  @param   Cascade_AOP_Invocation  データ問い合わせの呼び出し定義
  *  @return  mixed                   データ問い合わせ結果
  */
 public function invoke(Cascade_AOP_Invocation $invocation)
 {
     $criteria = $invocation->getStatement()->getCriteria();
     $data_format = $invocation->getStatement()->getDataFormat();
     // キャッシュ機能がOFFになっている場合
     if ($data_format->isDisableCacheMode($criteria)) {
         return $invocation->proceed();
     }
     // 条件に該当する結果がキャッシュされているか確認
     $ident = md5(serialize($criteria));
     if ($criteria->type === $criteria->getConstant('TYPE_IS_GET') || $criteria->type === $criteria->getConstant('TYPE_IS_MGET')) {
         if (NULL !== ($result = $this->get($ident))) {
             return $result;
         }
     }
     // 実行処理
     $result = $invocation->proceed();
     // 実行結果値をキャッシュする (更新系はキャッシュデータを削除)
     if ($criteria->type === $criteria->getConstant('TYPE_IS_GET') || $criteria->type === $criteria->getConstant('TYPE_IS_MGET')) {
         $this->set($ident, $result);
     } else {
         $this->refresh();
     }
     // 実行結果値を返す
     return $result;
 }
Example #2
0
 /**
  *  ステートメントを実行する
  *
  *  ステートメントを実行して、その実行結果を返す。
  *
  *  @param   boolean  (optional) TRUE:割り込み処理を無視する
  *  @return  mixed    実行結果
  */
 public final function execute($ignore_icptr = FALSE)
 {
     if ($ignore_icptr === FALSE) {
         $invocation = new Cascade_AOP_Invocation($this);
         return $invocation->proceed();
     }
     $this->prepare();
     return $this->perform();
 }