public function deserialize(DOMNode $eventElement)
 {
     $documentname = $eventElement->getElementsByTagName('documentname')->item(0)->textContent;
     $documentdescription = $eventElement->getElementsByTagName('documentdescription')->item(0)->textContent;
     $eventenddate = $this->deserializeDate($eventElement->getElementsByTagName('eventenddate')->item(0)->textContent);
     $eventonline = $this->deserializeBoolean($eventElement->getElementsByTagName('eventonline')->item(0)->textContent);
     $eventregistrationenddate = $this->deserializeDate($eventElement->getElementsByTagName('eventregistrationenddate')->item(0)->textContent);
     $eventregistrationstartdate = $this->deserializeDate($eventElement->getElementsByTagName('eventregistrationstartdate')->item(0)->textContent);
     $eventstartdate = $this->deserializeDate($eventElement->getElementsByTagName('eventstartdate')->item(0)->textContent);
     $eventtype = $eventElement->getElementsByTagName('eventtype')->item(0)->textContent;
     $friendlyurl = $eventElement->getElementsByTagName('friendlyurl')->item(0)->textContent;
     $physicalurl = $eventElement->getElementsByTagName('physicalurl')->item(0)->textContent;
     $dataxml = $eventElement->getElementsByTagName('dataxml')->item(0)->textContent;
     $metadataxml = $eventElement->getElementsByTagName('metadataxml')->item(0)->textContent;
     $e = new Event();
     $e->setDocumentname($documentname);
     $e->setDocumentdescription($documentdescription);
     $e->setEventenddate($eventenddate);
     $e->setEventonline($eventonline);
     $e->setEventregistrationenddate($eventregistrationenddate);
     $e->setEventregistrationstartdate($eventregistrationstartdate);
     $e->setEventstartdate($eventstartdate);
     $e->setEventtype($eventtype);
     $e->setFriendlyurl($friendlyurl);
     $e->setPhysicalurl($physicalurl);
     $e->setDataxml($dataxml);
     $e->setMetadataxml($metadataxml);
     return $e;
 }
 protected function createDemoEvent()
 {
     $event = new Event();
     $event->setDocumentname('Demo event');
     $event->setDocumentdescription('');
     $event->setEventenddate(new \DateTime('2016-12-27'));
     $event->setEventonline(true);
     $event->setEventregistrationenddate(new \DateTime('2015-11-25'));
     $event->setEventregistrationstartdate(new \DateTime('2015-11-24'));
     $event->setEventstartdate(new \DateTime('2016-12-27'));
     $event->setEventtype('012');
     $event->setFriendlyurl('http://opendata.euskadi.eus/catalogo/-/evento/20151117142228/-faboo-/kulturklik/es/');
     $event->setPhysicalurl('http://opendata.euskadi.eus/catalogo/-/contenidos/evento/20151117142228/es_def/index.shtml');
     $event->setDataxml('http://opendata.euskadi.eus/contenidos/evento/20151117142228/es_def/data/es_r01dtpd151159c5ffe1a48b14ba55eb3c450a81360');
     $event->setMetadataxml('http://opendata.euskadi.eus/contenidos/evento/20151117142228/r01Index/20151117142228-idxContent.xml');
     return $event;
 }