当前位置: 首页>>代码示例>>PHP>>正文


PHP Location::getByNefubId方法代码示例

本文整理汇总了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;
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:29,代码来源:Calendar.php

示例2: getLocation

 /**
  * Enter description here ...
  * @return Location
  */
 public function getLocation()
 {
     if (!$this->location) {
         $this->location = Location::getByNefubId($this->location_nefub_id);
     }
     return $this->location;
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:11,代码来源:Game.php

示例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();
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:18,代码来源:DownloadRenderer.php

示例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();
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:19,代码来源:FrontRenderer.php

示例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;
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:27,代码来源:APIRetriever.php

示例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();
        }
    }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:25,代码来源:AdminRenderer.php


注:本文中的Location::getByNefubId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。