本文整理汇总了PHP中Location::getByNefubId方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::getByNefubId方法的具体用法?PHP Location::getByNefubId怎么用?PHP Location::getByNefubId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location
的用法示例。
在下文中一共展示了Location::getByNefubId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sortByDateAndLocation
protected static function sortByDateAndLocation($query)
{
$dates = array();
$locations = array();
$result = Database::query($query);
$rows = Database::convertResult($result);
foreach ($rows as $row) {
$oGame = new Game();
$oGame->setData($row);
if (!$locations[$oGame->location_nefub_id]) {
$locations[$oGame->location_nefub_id] = Location::getByNefubId($oGame->location_nefub_id);
}
$oLocation = $locations[$oGame->location_nefub_id];
// create array for locations per date
if (!is_array($dates[$oGame->date])) {
$dates[$oGame->date] = array();
}
// create array for times per location
if (!is_array($dates[$oGame->date][$oGame->location_nefub_id])) {
$dates[$oGame->date][$oGame->location_nefub_id] = array('location' => $oLocation, 'gameTimes' => array());
}
// create array for times per location
if (!is_array($dates[$oGame->date][$oGame->location_nefub_id]['gameTimes'][$oGame->time])) {
$dates[$oGame->date][$oGame->location_nefub_id]['gameTimes'][$oGame->time] = array();
}
$dates[$oGame->date][$oGame->location_nefub_id]['gameTimes'][$oGame->time][] = $oGame;
}
return $dates;
}
示例2: getLocation
/**
* Enter description here ...
* @return Location
*/
public function getLocation()
{
if (!$this->location) {
$this->location = Location::getByNefubId($this->location_nefub_id);
}
return $this->location;
}
示例3: runLocationSchedule
protected function runLocationSchedule($nefubId, $date)
{
if (is_numeric($nefubId) && $date) {
if ($oLocation = Location::getByNefubId($nefubId)) {
$formattedDate = strftime("%A %e %B %Y", strtotime($date));
$filename = 'agenda ' . $date . ' ' . $oLocation->name;
$oSeason = Season::getInstance();
$aGames = Game::getAll(array('date' => $date, 'location_nefub_id' => $oLocation->nefub_id), 'time` ASC, `field', 'asc');
if (count($aGames)) {
$title = 'Programma ' . $formattedDate;
$includeField = false;
$footer = $title . ' in ' . $oLocation->name . ', ' . $oLocation->city . '. Gedownload van http://' . $_SERVER['HTTP_HOST'] . '/locatie/' . $nefubId;
$this->renderGames($filename, $title, $aGames, $footer);
}
}
}
$this->redirect();
}
示例4: showLocation
/**
*
* @param int $nefubId
*/
public function showLocation($nefubId)
{
$this->subdirectory = '/locatie';
$this->path = '/' . $nefubId;
$this->template = '/locatie/locatie.tpl';
if ($this->getClearRender()) {
$oLocation = Location::getByNefubId($nefubId);
if ($oLocation && $oLocation->name != 'TBA') {
$this->assign('oLocation', $oLocation);
} else {
$this->redirect();
}
}
$this->showOutput();
}
示例5: retrieveLocation
/**
*
* @param ing $locationNefubId
* return Location
*/
protected function retrieveLocation($locationNefubId)
{
$oLocation = Location::getByNefubId($locationNefubId);
if (!$oLocation) {
$url = NEFUB_API . '/location.php?id=' . $locationNefubId;
$locationData = $this->getNefubContentsParsed($url, MAX_AGE_LOCATION_DETAILS);
$oLocation = new Location();
$oLocation->nefub_id = $locationNefubId;
$oLocation->name = $locationData->Name;
$oLocation->street = $locationData->Address;
$oLocation->postalcode = $locationData->PostalCode;
$oLocation->city = $locationData->Place;
$oLocation->telephone = $locationData->Phone;
$oLocation->website = $locationData->Url;
$oLocation->email = $locationData->{'E-mail'};
$oLocation->route = $locationData->Route;
$oLocation->save();
$this->addedNefubObject($oLocation);
self::put('Locatie ' . $locationNefubId . ' toegevoegd: ' . $oLocation->name . ' in ' . $oLocation->city);
}
return $oLocation;
}
示例6: showLocations
protected function showLocations()
{
switch ($this->mode) {
case 'bewerken':
$oLocation = Location::getByNefubId($this->editId);
$this->editObject($oLocation, '/bewerken.tpl');
break;
default:
$query = 'SELECT DISTINCT(`city`)
FROM `Location`
ORDER BY `city` ASC';
$cityRows = Database::select_rows_by_query($query);
$cities = array();
foreach ($cityRows as $cityRow) {
$name = $cityRow['city'];
if (!is_array($cities[$name])) {
$cities[$name] = array();
}
$cities[$name] = Location::getAll(array('city' => $name), 'name');
}
$this->assign('cities', $cities);
$this->template = '/locaties.tpl';
$this->showOutput();
}
}