コード例 #1
0
 /**
  * Add Record to collection
  *
  * @param \Migration\ResourceModel\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
 /**
  * @throws \Migration\Exception
  * @return void
  */
 public function testGetFieldsInvalid()
 {
     $this->record->setStructure(null);
     $this->setExpectedException('Exception', 'Structure not set');
     $this->record->getFields();
 }