Ejemplo n.º 1
0
 /**
  * 検索条件の生成
  * @return Criteria
  */
 public function build()
 {
     $criteria = new Criteria();
     // タイトル検索
     if (!empty($this->title)) {
         $criteria->andWhere($criteria->expr()->contains('title', $this->title));
     }
     // ステータス検索
     if ($this->status instanceof TodoStatus) {
         $criteria->andWhere($criteria->expr()->eq('status.value', $this->status->getValue()));
     }
     return $criteria;
 }
Ejemplo n.º 2
0
 public function build()
 {
     $criteria = new Criteria();
     $status = new TodoStatus();
     $criteria->andWhere($criteria->expr()->eq('status.value', $status->getValue()));
     return $criteria;
 }