文字列の配列を保持するPost
フィールドを持つモデルを指定します。例:tags
Post:
id: 1
tags: ['a', 'b', 'c']
Post:
id: 2
tags: ['a', 'z']
配列からすべての値を含むモデルを取得するためのクエリの作成方法['a', 'b']
(この例では、投稿 ID 1 のみを返す)
私はこれらについて考えてきました:
Doctrine ODM QueryBuilder の使用:
// is this correct?
$qb->expr()->field('tags')->all( array('a', 'b') );
Doctrine ORM QueryBuilder の使用:
$qb->expr()->all( /* the docs say to use DQL here.. is there no QueryBuilder alternative? */ )