Ejemplo n.º 1
0
 protected function setProperties($properties)
 {
     $datetimeFields = $this->getDatetimeFields();
     foreach ($properties as $key => $value) {
         if (property_exists($this, $key)) {
             if (in_array($key, $datetimeFields)) {
                 $this->{$key} = DateTimeConverter::convert($value);
             } else {
                 $this->{$key} = $value;
             }
         }
     }
 }
Ejemplo n.º 2
0
 public function testHydratationWithNullDatetimeArgument()
 {
     $this->assertNull(DateTimeConverter::convert(null));
 }