Project

General

Profile

Actions

Enhancement(機能追加・改善) #933

closed

Notify Doctrine_Event as symfony's one (Doctrineのイベントをsymfonyのイベントとして通知する)

Added by Eitarow Fukamachi almost 15 years ago. Updated over 14 years ago.

Status:
Fixed(完了)
Priority:
Normal(通常)
Target version:
Start date:
2010-04-06
Due date:
% Done:

100%

Estimated time:

Description

内容

Doctrineのモデルが変更されたときなど、Doctrine_Eventが発生したときにsymfonyのイベントを通知することで、OpenPNEのコードからフックできるようにする。


Related issues 1 (0 open1 closed)

Related to OpenPNE 3 - Enhancement(機能追加・改善) #2916: op_doctrine.pre_save 等のnotifyイベントで、発生元のモデルオブジェクトを受信側で取得できるようにするFixed(完了)Youichi Kimura2012-04-04

Actions
Actions #1

Updated by Eitarow Fukamachi almost 15 years ago

  • % Done changed from 30 to 90
Actions #2

Updated by Eitarow Fukamachi almost 15 years ago

  • Status changed from Accepted(着手) to Pending Review(レビュー待ち)
Actions #3

Updated by Eitarow Fukamachi almost 15 years ago

  • Subject changed from Doctrineのイベントをsymfonyのイベントとして通知する to Notify Doctrine_Event as symfony's one (Doctrineのイベントをsymfonyのイベントとして通知する)
Actions #4

Updated by Eitarow Fukamachi almost 15 years ago

  • Target version changed from OpenPNE 3.4.3 to OpenPNE 3.5.2
Actions #5

Updated by Kousuke Ebihara over 14 years ago

  • Status changed from Pending Review(レビュー待ち) to Rejected(差し戻し)
  • Target version changed from OpenPNE 3.5.2 to OpenPNE 3.5.3
  • % Done changed from 90 to 0

http://redmine.openpne.jp/projects/op3/wiki/Ticket_Workflow_%28ja%29#Pending-Review%EF%BC%88%E3%83%AC%E3%83%93%E3%83%A5%E3%83%BC%E5%BE%85%E3%81%A1%EF%BC%89

Pending Review(レビュー待ち)¶

開発者がチケットの対応を完了し、レビューを依頼していることを示すステータスです。

このステータスにする際は、「git://github.com/openpne/OpenPNE3.git の master もしくはリリースブランチにコードがマージされている」「チケットに関連するコミットが紐づけられているか、記載されている」という条件を満たしていなければなければなりません。条件を満たしていない場合、レビューを行うことができず、「Rejected(差し戻し)」となる場合があります。

Actions #6

Updated by Kousuke Ebihara over 14 years ago

  • Target version changed from OpenPNE 3.5.3 to OpenPNE 3.6beta1
Actions #7

Updated by Kousuke Ebihara over 14 years ago

  • Status changed from Rejected(差し戻し) to Pending Review(レビュー待ち)
Actions #8

Updated by Shogo Kawahara over 14 years ago

  • Status changed from Pending Review(レビュー待ち) to Rejected(差し戻し)

openpne:install 時に以下のエラーメッセージが表示されます。

The "default" context does not exist.

以下のような修正が必要かと思われます。(案

diff --git a/lib/util/opDoctrineEventNotifier.class.php b/lib/util/opDoctrineEventNotifier.class.php
index 12b3e66..00ff5e1 100644
--- a/lib/util/opDoctrineEventNotifier.class.php
+++ b/lib/util/opDoctrineEventNotifier.class.php
@@ -19,8 +19,11 @@ class opDoctrineEventNotifier extends Doctrine_Record_Listener
 {
   private static function notify($when, $action, $doctrineEvent)
   {
-    $dispatcher = sfContext::getInstance()->getEventDispatcher();
-    $dispatcher->notify(new sfEvent(null, sprintf('op_doctrine.%s_%s_%s', $when, $action, get_class($doctrineEvent->getInvoker()))));
+    if (sfContext::hasInstance())
+    {
+      $dispatcher = sfContext::getInstance()->getEventDispatcher();
+      $dispatcher->notify(new sfEvent(null, sprintf('op_doctrine.%s_%s_%s', $when, $action, get_class($doctrineEvent->getInvoker()))));
+    }
   }

   public function preSave(Doctrine_Event $event)

Actions #9

Updated by Kousuke Ebihara over 14 years ago

  • Status changed from Rejected(差し戻し) to Pending Review(レビュー待ち)

更新履歴 63dfc9619b974314d085eb2388361d330de7d04b で適用されました。

Actions #10

Updated by Shogo Kawahara over 14 years ago

  • Status changed from Pending Review(レビュー待ち) to Pending Testing(テスト待ち)
  • % Done changed from 50 to 70
Actions #11

Updated by Kousuke Ebihara over 14 years ago

  • Status changed from Pending Testing(テスト待ち) to Fixed(完了)
  • % Done changed from 70 to 100
Actions

Also available in: Atom PDF