public function fromDatabase(array $dbArr) { $this->id = $dbArr['SequenceID']; parent::fromDatabase($dbArr); $this->start = strtotime($dbArr['on_date'] . " " . $dbArr['starttime']); if (!empty($dbArr['endtime'])) { $this->end = strtotime($dbArr['on_date'] . " " . $dbArr['endtime']); } if (!empty($dbArr['newmemberstart'])) { $this->newMemberStart = strtotime($dbArr['on_date'] . " " . $dbArr['newmemberstart']); } if (!empty($dbArr['newmemberend'])) { $this->newMemberEnd = strtotime($dbArr['on_date'] . " " . $dbArr['newmemberend']); } // If end is the next day... if (!empty($this->end) && $this->end < $this->start) { $this->end += 86400; } if (!empty($dbArr['latitude']) && !empty($dbArr['longitude'])) { $this->latLng = new LatLng($dbArr['latitude'], $dbArr['longitude']); } else { if ($dbArr['latitude'] == "" && $dbArr['longitude'] == "") { $this->latLng = null; } } // Set up the alterations $this->alterations->setVersion($dbArr['version']); $this->alterations->setLastModified(strtotime($dbArr['lastmodified'])); $this->alterations->setDetails($dbArr['detailsaltered']); $this->alterations->setCancelled($dbArr['cancelled']); $this->alterations->setPlaceTime($dbArr['placetimealtered']); $this->alterations->setOrganiser($dbArr['organiseraltered']); $this->alterations->setDate($dbArr['datealtered']); }
public function fromDatabase(array $dbArr) { // Date format conversion $this->start = strtotime($dbArr['start']); unset($dbArr['start']); parent::fromDatabase($dbArr); }
public function fromDatabase(array $dbArr) { $this->id = $dbArr['ID']; parent::fromDatabase($dbArr); $this->__set("start", strtotime($dbArr['startdate'])); $this->endDate = strtotime($dbArr['enddate']); $this->noContactOfficeHours = (bool) $dbArr['nocontactofficehours']; $this->challenge = (bool) $dbArr['challenge']; $this->swg = (bool) $dbArr['swg']; $this->alterations->setVersion($dbArr['version']); $this->alterations->setLastModified(strtotime($dbArr['lastmodified'])); if (!empty($dbArr['latitude']) && !empty($dbArr['longitude'])) { $this->latLng = new LatLng($dbArr['latitude'], $dbArr['longitude']); } else { if ($dbArr['latitude'] == "" && $dbArr['longitude'] == "") { $this->latLng = null; } } // Set up the alterations $this->alterations->setVersion($dbArr['version']); $this->alterations->setLastModified(strtotime($dbArr['lastmodified'])); $this->alterations->setDetails($dbArr['detailsaltered']); $this->alterations->setCancelled($dbArr['cancelled']); $this->alterations->setOrganiser($dbArr['organiseraltered']); $this->alterations->setDate($dbArr['datealtered']); }
public function fromDatabase(array $dbArr) { $this->id = $dbArr['SequenceID']; parent::fromDatabase($dbArr); $this->start = strtotime($dbArr['WalkDate'] . " " . $dbArr['meettime']); // Set up the alterations $this->alterations->setVersion($dbArr['version']); $this->alterations->setLastModified(strtotime($dbArr['lastmodified'])); $this->alterations->setDetails($dbArr['detailsaltered']); $this->alterations->setCancelled($dbArr['cancelled']); $this->alterations->setPlaceTime($dbArr['meetplacetimedetailsaltered']); $this->alterations->setOrganiser($dbArr['walkleaderdetailsaltered']); $this->alterations->setDate($dbArr['datealtered']); // Also set the lat/lng $startOSRef = getOSRefFromSixFigureReference($this->startGridRef); $startLatLng = $startOSRef->toLatLng(); $startLatLng->OSGB36ToWGS84(); $this->startLatLng = $startLatLng; $endOSRef = getOSRefFromSixFigureReference($this->endGridRef); $endLatLng = $endOSRef->toLatLng(); $endLatLng->OSGB36ToWGS84(); $this->endLatLng = $endLatLng; }