From 9cc7a3afe96e525934f710907f5d96f18de40b1f Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 2 Sep 2010 12:18:33 -0300 Subject: Changing the way we deal with the isis object --- lib/sfIsisImporter.class.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lib/sfIsisImporter.class.php') diff --git a/lib/sfIsisImporter.class.php b/lib/sfIsisImporter.class.php index 6119d35..acdf137 100644 --- a/lib/sfIsisImporter.class.php +++ b/lib/sfIsisImporter.class.php @@ -21,8 +21,9 @@ class sfIsisImporter extends sfIsisImporterRelations * Constructor. */ public function __construct($config = null) { - parent::__construct($config); - $this->stats = sfIsisImporterStats::getInstance(); + $this->stats = sfIsisImporterStats::getInstance(); + $this->isis = new IsisConnector($config); + $this->relations = new sfIsisImporterRelations($this->isis); // Get a logger instance. $this->logger = sfIsisImporterLog::getInstance(); @@ -92,7 +93,7 @@ class sfIsisImporter extends sfIsisImporterRelations public function addEntry($base_model, $entry) { // Get data and setup the model. - $this->read($entry); + $this->isis->read($entry); $model = $this->newModel($base_model, $entry); if ($model) @@ -100,7 +101,7 @@ class sfIsisImporter extends sfIsisImporterRelations $this->log("Importing $base_model $entry..."); // Dispatch to custom import procedures. - foreach (new IsisMethodIterator($this) as $method => $field) + foreach (new IsisMethodIterator($this->isis, $this) as $method => $field) { if (!$this->hasDeniedCombinations($base_model, $field)) { @@ -159,9 +160,9 @@ class sfIsisImporter extends sfIsisImporterRelations */ public function skipExisting() { - if (isset($this->format['import']['skip_existing'])) + if (isset($this->isis->format['import']['skip_existing'])) { - return $this->format['import']['skip_existing']; + return $this->isis->format['import']['skip_existing']; } return true; @@ -212,7 +213,7 @@ class sfIsisImporter extends sfIsisImporterRelations foreach ($combination as $item) { - foreach (new IsisRowIterator($this, $field) as $row) + foreach (new IsisRowIterator($this->isis, $field) as $row) { if (!$this->hasDeniedItem($field, $item, $row)) { @@ -266,7 +267,7 @@ class sfIsisImporter extends sfIsisImporterRelations } // Check if the item exists. - $has = $this->hasItem($field, $item, $row); + $has = $this->isis->hasItem($field, $item, $row); if ($condition == true) { -- cgit v1.2.3