| @@ 55-57 (lines=3) @@ | ||
| 52 | } |
|
| 53 | } |
|
| 54 | } else { |
|
| 55 | if ($type == 'datetime' || $type == 'date' || $type == 'time') { |
|
| 56 | $value = new \DateTime($value); |
|
| 57 | } |
|
| 58 | if ($type == 'one') { |
|
| 59 | // EmbedOne |
|
| 60 | if ( |
|
| @@ 24-26 (lines=3) @@ | ||
| 21 | if (in_array($field, $mapping)) { |
|
| 22 | // Dates need to be converted to DateTime objects |
|
| 23 | $type = $metadata->fieldMappings[$field]['type']; |
|
| 24 | if ($type == 'datetime' || $type == 'date' || $type == 'time') { |
|
| 25 | $value = new \DateTime($value); |
|
| 26 | } |
|
| 27 | $object->$method($value); |
|
| 28 | } elseif (in_array($field, $associations)) { // This field is an association |
|
| 29 | if (is_array($value)) { // The field is an array of associations |
|