Exemplo n.º 1
0
 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');
 }
Exemplo n.º 2
0
 /**
  * @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);
 }
Exemplo n.º 3
0
 /**
  * (PHP 5 &gt;= 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);
 }