45 parent::__construct($this->
castItems($data));
62 foreach ($data
as $k => $v) {
68 } elseif ($k ===
'birthday') {
88 return array_map(
function ($v) {
89 if ($v instanceof \DateTime) {
90 return $v->format(\DateTime::ISO8601);
106 return json_encode($this->
uncastItems(), $options);
126 $crazyInsaneRegexThatSomehowDetectsIso8601 =
'/^([\+-]?\d{4}(?!\d{2}\b))'
127 .
'((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?'
128 .
'|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d'
129 .
'|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])'
130 .
'((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d'
131 .
'([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/';
133 return preg_match($crazyInsaneRegexThatSomehowDetectsIso8601, $string) === 1;
145 return in_array($key, [
166 if (is_int($value)) {
167 $dt = new \DateTime();
168 $dt->setTimestamp($value);
170 $dt = new \DateTime($value);
195 return static::$graphObjectMap;