Fix error in FixtureTask

The options are always set, use empty() instead.

Fixes #2373
This commit is contained in:
mark_story 2011-12-13 20:40:30 -05:00
parent 0b7d0d7c94
commit dd335cb183

View file

@ -222,14 +222,14 @@ class FixtureTask extends BakeTask {
$schema = $this->_generateSchema($tableInfo); $schema = $this->_generateSchema($tableInfo);
} }
if (!isset($importOptions['records']) && !isset($importOptions['fromTable'])) { if (empty($importOptions['records']) && !isset($importOptions['fromTable'])) {
$recordCount = 1; $recordCount = 1;
if (isset($this->params['count'])) { if (isset($this->params['count'])) {
$recordCount = $this->params['count']; $recordCount = $this->params['count'];
} }
$records = $this->_makeRecordString($this->_generateRecords($tableInfo, $recordCount)); $records = $this->_makeRecordString($this->_generateRecords($tableInfo, $recordCount));
} }
if (isset($this->params['records']) || isset($importOptions['fromTable'])) { if (!empty($this->params['records']) || isset($importOptions['fromTable'])) {
$records = $this->_makeRecordString($this->_getRecordsFromTable($model, $useTable)); $records = $this->_makeRecordString($this->_getRecordsFromTable($model, $useTable));
} }
$out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields')); $out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields'));