タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

doctrineに関するs_moriのブックマーク (4)

  • Doctrine2のInheritanceMapping | QUARTETCOM TECH BLOG

    先月からSymfony2とDoctrine2を触り始めた新人の永井です。 早速Doctrine2のInheritance Mappingという機能を試したので、紹介をしたいと思います。 1つの親エンティティに対していくつかのサブパターンが存在するようなデータ構造を設計することって良くありますよね。 良く見るクラス図をサンプルにするとこんな感じの構造です。 上記の図の場合だと、 どんな図形かについては関心がなく色分けだけしたい場合 正方形のみを取り扱いたい場合 など、やりたいことがいろんな階層である場合に、こういったデータ構造になることがあるかと思います。 OOPの世界では良くある構造なのですが、継承という概念のないRDB上に再現しようとすると途端に面倒になります。 そこで、Doctrine2のInheritance Mappingの登場です。 今回はMartin Fowler先生のPofE

    Doctrine2のInheritanceMapping | QUARTETCOM TECH BLOG
  • Doctrine2 Embeddablesの紹介 | QUARTETCOM TECH BLOG

    Doctrine2 Embeddablesの紹介 Embeddableはエンティティに別のエンティティ(ValueObject)の情報を取り込み、1つのテーブルとしてマッピングする機能です。 Separating Concerns using Embeddables You’ll mostly want to use them to reduce duplication or separating concerns. Value objects such as date range or address are the primary use case for this feature. 同一のプロパティ定義を何度も書く必要がないため、コード量が減らせる 同一のプロパティ定義をValueObject化する事により、関心が分離できる ValueObjectはデザインパターンの1つです。 代表

    Doctrine2 Embeddablesの紹介 | QUARTETCOM TECH BLOG
  • 自作クラスをDoctrine ORM@Columnにマッピングする | QUARTETCOM TECH BLOG

    Doctrine Custom Mapping Typeを定義して自作クラスをORM@Columnにマッピングする方法を紹介します。 Doctrine DBAL 2 documentation http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#custom-mapping-types この記事を書いた環境 Symfony 2.6 Doctrine/ORM 2.5 Doctrine/dbal 2.5 サンプルケース 月次レポートを示すReportエンティティ Reportエンティティは月次レポートを管理するクラスです。年月をyyyymm形式の整数で持っています。 <?php namespace MyProject\Bundle\AcmeDemoBundle\Entity

    自作クラスをDoctrine ORM@Columnにマッピングする | QUARTETCOM TECH BLOG
  • Doctrine Annotations - Common (Common)

    Table of Contents master Edit Doctrine Annotations The Doctrine Common annotations library was born from a need in the Doctrine2 ORM to allow the mapping information to be specified as metadata embedded in the class files, on properties and methods. The library is independent and can be used in your own libraries to implement doc block annotations. Introduction There are several different approach

    Doctrine Annotations - Common (Common)
  • 1