diff options
author | Silvio <silvio@devlet.com.br> | 2010-09-03 18:12:40 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2010-09-03 18:12:40 -0300 |
commit | f49ad3720c73f21562f6699d7c6c3f1fae89e35e (patch) | |
tree | 7daab84fc3d8096267448e4234bd89ee55b56433 /classes/IsisMap.php | |
parent | c234c4996b109eeede37b726d3d97d609ea20a5d (diff) | |
download | cinisis-f49ad3720c73f21562f6699d7c6c3f1fae89e35e.tar.gz cinisis-f49ad3720c73f21562f6699d7c6c3f1fae89e35e.tar.bz2 |
getSubfieldName supporting field passed by code or name
Diffstat (limited to 'classes/IsisMap.php')
-rw-r--r-- | classes/IsisMap.php | 11 |
1 files changed, 8 insertions, 3 deletions
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]; } |