コード例 #1
0
ファイル: MatrixRow.php プロジェクト: khaliqgant/Deep
 /**
  * Set the Matrix columns for this row
  *
  * @param  \rsanchez\Deep\Collection\MatrixColCollection $cols
  * @return void
  */
 public function setCols(MatrixColCollection $cols)
 {
     $row = $this;
     $this->cols = $cols;
     $cols->each(function ($col) use($row) {
         $hidden = $row->getHidden();
         $hidden[] = 'col_id_' . $col->col_id;
         $row->setHidden($hidden);
         $row->setAttribute($col->col_name, $row->getAttribute('col_id_' . $col->col_id));
     });
 }
コード例 #2
0
ファイル: EntryCollection.php プロジェクト: khaliqgant/Deep
 /**
  * Set the Matrix columns for this collection
  *
  * @param  \rsanchez\Deep\Collection\MatrixColCollection $matrixCols
  * @return void
  */
 public function setMatrixCols(MatrixColCollection $matrixCols)
 {
     $fields = $this->fields;
     $matrixCols->each(function ($col) use($fields) {
         $fields->addFieldtype($col->col_type);
     });
     $this->matrixCols = $matrixCols;
 }