function it_decodes_datetime() { $mapper = $this; $node = Node::ofData(json_decode('{"value": "2015-01-15"}')); $d = $mapper->map($node, '\\Commercetools\\Commons\\Test\\DateTimeObject'); $d->getValue()->shouldHaveType('\\DateTime'); }
/** * @param string $data * @return Node */ public function map($data, $class = null) { $node = $data; if (!$data instanceof Node) { $node = Node::ofData(json_decode($data)); } if (is_null($class)) { $class = '\\Commercetools\\Commons\\JsonObject'; } return forward_static_call([$class, 'ofNode'], $node); }
/** * (PHP 5 >= 5.0.0)<br/> * Offset to unset * @link http://php.net/manual/en/arrayaccess.offsetunset.php * @param mixed $offset <p> * The offset to unset. * </p> * @return void */ public function offsetUnset($offset) { $this->data->offsetUnset($offset); }