コード例 #1
0
ファイル: MatrixHydrator.php プロジェクト: khaliqgant/Deep
 /**
  * {@inheritdoc}
  */
 public function preload(array $entryIds)
 {
     $this->rows = $this->rowModel->entryId($entryIds)->orderBy('row_order')->get();
     foreach ($this->rows as $row) {
         if (!isset($this->sortedRows[$row->entry_id][$row->field_id])) {
             $this->sortedRows[$row->entry_id][$row->field_id] = new MatrixRowCollection();
         }
         $cols = isset($this->sortedCols[$row->field_id]) ? $this->sortedCols[$row->field_id] : new MatrixColCollection();
         $row->setCols($cols);
         $this->sortedRows[$row->entry_id][$row->field_id]->push($row);
     }
 }
コード例 #2
0
 public function testEntryIdScope()
 {
     $query = MatrixRow::entryId(8)->get();
     $this->assertThat($query->fetch('row_id')->all(), new ArrayHasOnlyValuesConstraint([2, 3]));
 }