aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <s1lv10@uol.com.br>2010-09-16 18:01:52 -0300
committerSilvio <s1lv10@uol.com.br>2010-09-16 18:01:52 -0300
commit085c88c37d33cd19e9e77a1f9ef047f49f949d70 (patch)
tree666adb7d333c06fa8b104cfce5ba683a812cf672
parente94b02b44bab9c27503fd05836af3ab483d3c196 (diff)
downloadsf_isis_importer_plugin-085c88c37d33cd19e9e77a1f9ef047f49f949d70.tar.gz
sf_isis_importer_plugin-085c88c37d33cd19e9e77a1f9ef047f49f949d70.tar.bz2
Adding concept code for a sfIsisImporterWrapper class
-rw-r--r--lib/sfIsisImporterWrapper.class.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/sfIsisImporterWrapper.class.php b/lib/sfIsisImporterWrapper.class.php
new file mode 100644
index 0000000..6d0b195
--- /dev/null
+++ b/lib/sfIsisImporterWrapper.class.php
@@ -0,0 +1,39 @@
+<?php
+
+class sfIsisImporterWrapper {
+ /**
+ * Constructor.
+ */
+ public function __construct($isis)
+ {
+ $this->isis = $isis;
+ }
+
+ /**
+ * Make an association with a given model.
+ *
+ * @param object $model Model for the association
+ */
+ public function useModel($model)
+ {
+ $this->model = $model;
+ }
+
+ /**
+ * Get the current subfield from the current field and row.
+ *
+ * @param boolean $explode Whether to explode the result
+ * @return string Subfield value
+ */
+ public function currentSubfield($explode = false)
+ {
+ if ($explode)
+ {
+ return $this->isis->explodeSubfield($this->field, $this->subfield, $this->row);
+ }
+ else
+ {
+ return $this->isis->getSubfield($this->field, $this->subfield, $this->row);
+ }
+ }
+}