diff options
Diffstat (limited to 'lib/sfIsisImporter.class.php')
-rw-r--r-- | lib/sfIsisImporter.class.php | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/sfIsisImporter.class.php b/lib/sfIsisImporter.class.php index 9233f64..d3866bf 100644 --- a/lib/sfIsisImporter.class.php +++ b/lib/sfIsisImporter.class.php @@ -72,22 +72,14 @@ class sfIsisImporter extends sfIsisImporterBase } /** - * Set the primary key for the model by getting it or saving the model. + * Set the primary key for the model by getting it or just saving it. * * @param object $model Base model */ public function setBaseModelId(&$model) { - $id = $this->getBaseModelId($model); - - if ($id) - { - $model->id = $id; - } - else - { - $model->save(); - } + $model->id = $this->getBaseModelId($model); + $model->save(); } /** @@ -95,11 +87,14 @@ class sfIsisImporter extends sfIsisImporterBase * * @param object $model Base model * @return int Base model id - * @todo Write and test */ public function getBaseModelId(&$model) { - return false; + $method = get . $this->getModelName($model) .'PrimaryKey'; + if (method_exists($this, $method)) + { + return $this->{$method}($model); + } } /** |