aboutsummaryrefslogtreecommitdiff
path: root/lib/sfIsisImporter.class.php
diff options
context:
space:
mode:
authorSilvio <s1lv10@uol.com.br>2010-09-02 12:18:33 -0300
committerSilvio <s1lv10@uol.com.br>2010-09-02 12:18:33 -0300
commit9cc7a3afe96e525934f710907f5d96f18de40b1f (patch)
tree52b1db8d95406e707b9925f224476cc471758183 /lib/sfIsisImporter.class.php
parent58c0c37b33fc4521065ad06b4222fde3e71468e2 (diff)
downloadsf_isis_importer_plugin-9cc7a3afe96e525934f710907f5d96f18de40b1f.tar.gz
sf_isis_importer_plugin-9cc7a3afe96e525934f710907f5d96f18de40b1f.tar.bz2
Changing the way we deal with the isis object
Diffstat (limited to 'lib/sfIsisImporter.class.php')
-rw-r--r--lib/sfIsisImporter.class.php17
1 files changed, 9 insertions, 8 deletions
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)
{