diff options
-rw-r--r-- | classes/IsisConnector.php | 2 | ||||
-rw-r--r-- | classes/IsisMap.php | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/classes/IsisConnector.php b/classes/IsisConnector.php index 2ab2ee8..69eb36d 100644 --- a/classes/IsisConnector.php +++ b/classes/IsisConnector.php @@ -258,7 +258,7 @@ class IsisConnector extends IsisMap { $has = $this->hasMainItem($field, $row); } else { - $subfield = $this->getSubfieldName($this->getFieldKey($field), $item); + $subfield = $this->getSubfieldName($field, $item); $has = $this->hasSubfield($field, $subfield, $row); } diff --git a/classes/IsisMap.php b/classes/IsisMap.php index 05c7ae9..61df038 100644 --- a/classes/IsisMap.php +++ b/classes/IsisMap.php @@ -261,16 +261,21 @@ class IsisMap extends IsisReader { /** * Get a subfield name. * - * @param $field_key - * Field key. + * @param $field + * Field name or key. * * @param $subfield_key * Subfield key. * + * @param $by_key + * Set to true if you're passing the field key instead of it's name. + * * @return * Subfield name. */ - public function getSubfieldName($field_key, $subfield_key) { + public function getSubfieldName($field, $subfield_key, $by_key = FALSE) { + $field_key = (!$by_key) ? $this->getFieldKey($field) : $field; + if (isset($this->format['fields'][$field_key]['subfields'][$subfield_key])) { return $this->format['fields'][$field_key]['subfields'][$subfield_key]; } |