public function testCamelize() { $this->assertEquals("foo", Utils::camelize("foo")); $this->assertEquals("fooBar", Utils::camelize("foo_bar")); $this->assertEquals("", Utils::camelize(null)); $this->assertEquals("", Utils::camelize("")); }
/** * Create an object representation of a model. * * @api public * * @param mixed[] $attrs The values to assign to the model. * @return AcceptOn\Base The model with assigned values. */ public function __construct($attrs = array()) { foreach ($attrs as $attrName => $attrValue) { $camelizedName = Utils::camelize($attrName); if (array_key_exists($camelizedName, $this::$allowedProperties)) { $this->{$camelizedName} = $this->coerceValue($attrValue, $this::$allowedProperties[$camelizedName]); } } }