diff options
author | Silvio <s1lv10@uol.com.br> | 2010-09-02 12:18:33 -0300 |
---|---|---|
committer | Silvio <s1lv10@uol.com.br> | 2010-09-02 12:18:33 -0300 |
commit | 9cc7a3afe96e525934f710907f5d96f18de40b1f (patch) | |
tree | 52b1db8d95406e707b9925f224476cc471758183 /lib/sfIsisImporterEntities.class.php | |
parent | 58c0c37b33fc4521065ad06b4222fde3e71468e2 (diff) | |
download | sf_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/sfIsisImporterEntities.class.php')
-rw-r--r-- | lib/sfIsisImporterEntities.class.php | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/sfIsisImporterEntities.class.php b/lib/sfIsisImporterEntities.class.php index cd66afd..73fe3af 100644 --- a/lib/sfIsisImporterEntities.class.php +++ b/lib/sfIsisImporterEntities.class.php @@ -4,7 +4,14 @@ * IsisImporterEntities: provides ISIS import methods for importing data * into model entities. */ -class sfIsisImporterEntities extends IsisConnector { +class sfIsisImporterEntities { + /** + * Constructor. + */ + public function __construct($isis) { + $this->isis = $isis; + } + /** * Get the entity name from a subfield. * @@ -25,11 +32,11 @@ class sfIsisImporterEntities extends IsisConnector { */ public function addMain(&$model, $field, $row = 0) { - $value = $this->filterBrackets($this->getMainItem($field, $row)); + $value = $this->isis->filterBrackets($this->isis->getMainItem($field, $row)); if ($value != null) { - $map = $this->getMap($field); + $map = $this->isis->getMap($field); $model->{$map}($value); } } @@ -44,11 +51,11 @@ class sfIsisImporterEntities extends IsisConnector { */ public function addSubfield(&$model, $field, $subfield, $row = 0) { - $value = $this->filterBrackets($this->getSubfield($field, $subfield, $row)); + $value = $this->isis->filterBrackets($this->isis->getSubfield($field, $subfield, $row)); if ($value != null) { - $map = $this->getMap($field, $subfield); + $map = $this->isis->getMap($field, $subfield); $model->{$map}($value); } } @@ -62,7 +69,7 @@ class sfIsisImporterEntities extends IsisConnector { */ public function addSubfields(&$model, $field, $row = 0) { - foreach ($this->getSubfieldList($field) as $subfield) + foreach ($this->isis->getSubfieldList($field) as $subfield) { $this->addSubfield($model, $field, $subfield, $row); } @@ -85,14 +92,14 @@ class sfIsisImporterEntities extends IsisConnector { */ public function importValues(&$model, array $field) { - if ($this->fieldHasMap($field)) + if ($this->isis->fieldHasMap($field)) { $this->addMain($model, $field); } - foreach ($this->getSubfieldList($field) as $subfield) + foreach ($this->isis->getSubfieldList($field) as $subfield) { - if ($this->subfieldHasMap($field, $subfield)) + if ($this->isis->subfieldHasMap($field, $subfield)) { $this->addSubfield($model, $field, $subfield); } |