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

エンティティからフォームを生成する機構の追加 #2268

Merged
merged 10 commits into from
Apr 17, 2017

Conversation

chihiro-adachi
Copy link
Contributor

@chihiro-adachi chihiro-adachi commented Apr 11, 2017

概要(Overview・Refs Issue)

エンティティからフォームを生成する機構の追加

#2267 に継続しています。

方針(Policy)

  • 拡張機構で、簡単にフォーム生成を行うことを想定
  • 本体側でのFormTypeは現状通り

実装に関する補足(Appendix)

/**
 * @EntityExt(target="Eccube\Entity\BaseInfo")
 */
trait BaseInfoTrait
{
    /**
     * @ORM\Column(name="company_name_vn", type="string", length=255, nullable=true, options={"eccube_form_render":true})
     * @Assert\NotBlank(message="にゅうりょくしてくださいね!!!")
     */
    public $company_name_vn;
} 
  • @Orm\Columnのoptionsにeccube_form_render:trueで自動生成の対象となる
  • FormのレンダリングはSymfonyのTypeGuesserに任せる
    • もう少し細かい制御ができたら良いかもしれない
  • バリデーションはSymfony標準のアノテーションが利用可能

テスト(Test)

実装サンプルをfbdb676 にコミットしています。

相談(Discussion)

ref #1984

@chihiro-adachi chihiro-adachi force-pushed the gen-entity-form branch 2 times, most recently from 90b287b to f0cc6fb Compare April 12, 2017 00:54
@Yangsin Yangsin added this to the 3.1.0 milestone Apr 12, 2017
@Yangsin Yangsin mentioned this pull request Apr 14, 2017
@Yangsin Yangsin merged commit 342757a into EC-CUBE:experimental/3.1 Apr 17, 2017
@chihiro-adachi chihiro-adachi deleted the gen-entity-form branch May 19, 2017 03:53
@chihiro-adachi chihiro-adachi added the document Improvements or additions to documentation label Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document Improvements or additions to documentation enhancement 機能追加 experimental
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants