Example #1
0
 protected static function fromStdClass($obj)
 {
     $ret = new self($obj->eventid);
     $ret->setTitle($obj->title);
     $ret->setDescripion($obj->desc);
     $ret->setFrom(\DateTime::createFromFormat('Y-m-d H:i:s', $obj->from, new \DateTimeZone("UTC")));
     $ret->setTo(\DateTime::createFromFormat('Y-m-d H:i:s', $obj->to, new \DateTimeZone("UTC")));
     $ret->getFrom()->setTimezone(new \DateTimeZone(get_option('timezone_string')));
     $ret->getTo()->setTimezone(new \DateTimeZone(get_option('timezone_string')));
     $ret->setPlace(Place::findById($obj->placeid));
     $ret->setPostId($obj->postid);
     return $ret;
 }