private function _load() { foreach ($this->_values as $k => $v) { $setVal = null; if ($this->isHash($v) && array_key_exists($k, $this->_subTypes)) { $setVal = new $this->_subTypes[$k]($v); } else { if (is_array($v) && array_key_exists($k, $this->_subTypes)) { $setVal = array(); foreach ($v as $stV) { array_push($setVal, new $this->_subTypes[$k]($stV)); } } } if (is_null($setVal)) { $setVal = $v; } $this->_data[ChargeBee_Util::toCamelCaseFromUnderscore($k)] = $setVal; } }
public function _initDependantList($obj, $type, $subTypes = array()) { if (!array_key_exists($type, $obj)) { return $this; } if (!is_array($obj[$type])) { return $this; } $class = $this->__getDependant($type); if (!is_null($class)) { $setVal = array(); foreach ($obj[$type] as $dt) { array_push($setVal, new $class($dt, $subTypes)); } $this->_data[ChargeBee_Util::toCamelCaseFromUnderscore($type)] = $setVal; } return $this; }
function testToCamelCaseFromUnderscore() { $before = "test_string"; $after = "testString"; $this->assertEqual($after, ChargeBee_Util::toCamelCaseFromUnderscore($before)); }