Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entityイベントの実装 #2261

Merged
merged 2 commits into from
Apr 12, 2017

Conversation

kiy0taka
Copy link
Contributor

@kiy0taka kiy0taka commented Apr 6, 2017

概要(Overview・Refs Issue)

実装例(Productエンティティが更新されたときに処理を実行)

/**
 * @PreUpdate("Eccube\Entity\Product")
 */
class MyProductUpdateListener implements EntityEventListener
{
    public function execute(LifecycleEventArgs $eventArgs)
    {
        // 商品情報が更新されたときの処理を実装
    }
}

方針(Policy)

実装に関する補足(Appendix)

  • イベントリスナーを登録する方法については要検討
    • 現時点での実装では各ServiceProviderでリスナーを追加しているが、最終的にはアノテーションをみて自動登録されるようにしたい

テスト(Test)

  • テストケース
    • EntityEventDispatcherTest.php
  • サンプル実装
    • app/Acme/Entity/SoldOutEventListener.php

相談(Discussion)

  • アノテーション等の名前空間(Eccube\Entity\Event\Annotations)は適切か?

@t-nagahashi t-nagahashi added this to the 3.1.0 milestone Apr 11, 2017
@Yangsin Yangsin added the enhancement 機能追加 label Apr 12, 2017
@Yangsin Yangsin merged commit c83f5d8 into EC-CUBE:experimental/3.1 Apr 12, 2017
@kiy0taka
Copy link
Contributor Author

Eccube\Entity\Event\Annotations -> Eccube\Annotationに変更する。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants