コード例 #1
0
ファイル: Collection.php プロジェクト: okite11/frames21
 /**
  * Add Record to collection
  *
  * @param \Migration\Resource\Record $record
  * @return $this
  * @throws Exception
  */
 public function addRecord($record)
 {
     if (!$record->getStructure()) {
         $record->setStructure($this->structure);
     }
     if (!$record->validateStructure($this->structure)) {
         throw new Exception("Record structure does not equal Collection structure");
     }
     $this->data[] = $record;
     return $this;
 }
コード例 #2
0
 public function testGetFieldsInvalid()
 {
     $this->record->setStructure(null);
     $this->setExpectedException('Exception', 'Structure not set');
     $this->record->getFields();
 }