/** * Convert the raw XML into an object * * @param \SimpleXMLElement $xml * @return Phone */ public static function createFromXML(\SimpleXMLElement $xml) { $day = new Day(); $attributes = $xml->attributes(); if (isset($attributes['opentype'])) { $day->setOpenType((string) $attributes['opentype']); } return $day; }