Beispiel #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;
             }
         }
     }
 }
 public function testHydratationWithNullDatetimeArgument()
 {
     $this->assertNull(DateTimeConverter::convert(null));
 }