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


PHP Location::get方法代码示例

本文整理汇总了PHP中Location::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::get方法的具体用法?PHP Location::get怎么用?PHP Location::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Location的用法示例。


在下文中一共展示了Location::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generate_data_for_day

 private static function generate_data_for_day(SS_Datetime $date)
 {
     $data = array('timestamp' => time(), 'searchDate' => $date->Format("Y-m-d"), 'collections' => array('events' => array(), 'galleries' => array(), 'locations' => array()));
     $galleryIDs = array();
     $locationIDs = array();
     // Get events
     $where = sprintf("DATE(`StartDate`) = '%s'", $date->Format('Y-m-d'));
     $events = Event::get()->where($where)->exclude(array("GalleryID" => 0, "Gallery.LocationID" => 0));
     foreach ($events as $event) {
         $galleryIDs[] = $event->GalleryID;
         $data['collections']['events'][] = $event->forAPI();
     }
     // Get galleries
     $galleries = Gallery::get()->byIDs(array_unique($galleryIDs));
     foreach ($galleries as $gallery) {
         $locationIDs[] = $gallery->LocationID;
         $data['collections']['galleries'][] = $gallery->forAPI();
     }
     // Get locations
     $locations = Location::get()->byIDs(array_unique($locationIDs));
     foreach ($locations as $location) {
         $data['collections']['locations'][] = $location->forAPI();
     }
     return $data;
 }
开发者ID:ehyland,项目名称:some-painter-cms,代码行数:25,代码来源:EventsDataUtil.php

示例2: allPagesToCache

 public function allPagesToCache()
 {
     // Get each page type to define its sub-urls
     $urls = array();
     // memory intensive depending on number of pages
     $pages = SiteTree::get()->where("ClassName != 'BlogEntry'");
     //remove Blog pages from cache due to Form SecurityID issue
     foreach ($pages as $page) {
         array_push($urls, $page->Link());
         if ($page->ClassName == 'ProjectPage') {
             //add ajax pages for each projectpage
             array_push($urls, $page->Link() . 'ajax');
         }
     }
     //add tag pages
     $tags = Tag::get()->filter(array('HasTagPage' => 1));
     foreach ($tags as $tag) {
         array_push($urls, '/tag/' . $tag->Slug);
     }
     //add location pages
     $locations = Location::get();
     foreach ($locations as $location) {
         array_push($urls, '/location/' . $location->Slug);
     }
     return $urls;
 }
开发者ID:nttan,项目名称:silverstripe-portfolio,代码行数:26,代码来源:BasicPage.php

示例3: isTFTP

 public function isTFTP()
 {
     $Location = new Location($this->get('locationID'));
     if ($Location && $Location->isValid()) {
         return $Location->get('tftp');
     }
 }
开发者ID:bramverstraten,项目名称:fogproject,代码行数:7,代码来源:LocationAssociation.class.php

示例4: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($shortUrl, Request $request)
 {
     $url = ShortUrl::where('short_url', 'LIKE', '%' . $shortUrl)->first();
     $location = \Location::get();
     if ($url !== null) {
         ShortUrlClickInfo::create(['shorturl_id' => $url->id, 'country' => $location->countryName, 'ua' => $request->server->get("HTTP_USER_AGENT")]);
     }
     return redirect()->to($url->long_url);
 }
开发者ID:patopoc,项目名称:hotpms,代码行数:15,代码来源:ShortenerController.php

示例5: testLocationDeletion

 function testLocationDeletion()
 {
     $this->logInWithPermission('ADMIN');
     $location = $this->objFromFixture('Location', 'silverstripe');
     $locationID = $location->ID;
     $this->logOut();
     $this->logInWithPermission('Location_DELETE');
     $this->assertTrue($location->canDelete());
     $location->delete();
     $locations = Location::get()->column('ID');
     $this->assertFalse(in_array($locationID, $locations));
 }
开发者ID:helpfulrobot,项目名称:dynamic-silverstripe-locator,代码行数:12,代码来源:LocationTest.php

示例6: index

 public function index($arguments)
 {
     $slug = $arguments->param('Slug');
     $location = Location::get()->filter(array('Slug' => $slug))->First();
     if ($location) {
         $this->Lat = $location->Latitude;
         $this->Lng = $location->Longitude;
         $this->Location = $location->Title;
         $this->Subtitle = $location->Subtitle;
         $this->Key = $this->config()->key;
         return $this->renderWith(array('LocationPage', 'Page'));
     }
 }
开发者ID:nttan,项目名称:silverstripe-portfolio,代码行数:13,代码来源:LocationController.php

示例7: locationData

 public function locationData()
 {
     // Get the locations from the database, exclude any that don't have LatLng's defined
     $infoWindowList = Location::get()->exclude(array('lat' => null, 'lng' => null));
     if ($infoWindowList) {
         $InfoWindows = array();
         foreach ($infoWindowList as $obj) {
             $InfoWindows[] = array('lat' => $obj->lat, 'lng' => $obj->lng, 'info' => $obj->Name . "<br />" . $obj->InfoWindow);
         }
         $InfoWindows = Convert::array2json($InfoWindows);
         // Return a JSON object for GoogleMapConfig.js to use
         return $InfoWindows;
     }
 }
开发者ID:helpfulrobot,项目名称:joshkosmala-silverstripe-mappable,代码行数:14,代码来源:LocationMapPage.php

示例8: run

 public function run($request)
 {
     Config::inst()->update('DataObject', 'validation_enabled', false);
     $ct = 0;
     $updateEmail = function ($location) use(&$ct) {
         if (!$location->Email && $location->EmailAddress) {
             $location->Email = $location->EmailAddress;
             $location->write();
             ++$ct;
         }
     };
     Location::get()->each($updateEmail);
     Config::inst()->update('DataObject', 'validation_enabled', true);
     echo '<p>' . $ct . ' Locations updated</p>';
 }
开发者ID:jeffwhitfield,项目名称:silverstripe-locator,代码行数:15,代码来源:EmailAddressTask.php

示例9: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // galleries field
     $locations = function () {
         return Location::get()->map('ID', 'Title');
     };
     $locationField = DropdownField::create('LocationID', 'Location', $locations());
     $locationField->useAddNew('Location', $locations);
     if ($this->LocationID) {
         $locationField->setDescription($this->Location()->getDataAdminEditAnchorTag());
     }
     // add fields to tab
     $fields->addFieldsToTab('Root.Main', array($locationField));
     return $fields;
 }
开发者ID:ehyland,项目名称:some-painter-cms,代码行数:16,代码来源:Gallery.php

示例10: getLocations

 public static function getLocations($filter = array(), $exclude = array())
 {
     $filter['ShowInLocator'] = true;
     return Location::get()->exclude($exclude)->exclude('Lat', 0)->filter($filter);
 }
开发者ID:jeffwhitfield,项目名称:silverstripe-locator,代码行数:5,代码来源:Locator.php

示例11: count

?>
">Add a location</a></h3>
<?php 
if (isset($_SESSION['formmessage'])) {
    $formmessage = $_SESSION['formmessage'];
    $formmessageclass = $_SESSION['formmessageclass'];
    echo '  <p class="message ' . $formmessageclass . '">' . $formmessage . '</p>';
    include "common/clearsessionmessage.php";
}
$locationcount = count($locations);
if ($locationcount > 0) {
    echo '      <ol class="contentlist">';
    foreach ($locations as $locationrow) {
        $locationid = $locationrow['id'];
        $locationname = $locationrow['name'];
        $location = Location::get($locationid, $userid);
        $entity = $location;
        include "hbardata.php";
        ?>
        <li><?php 
        echo $locationname;
        ?>
          <ul class="list-inline contentlistactionlinks">
            <li><a href="editlocation?id=<?php 
        echo $locationid;
        ?>
">Edit</a></li>
<?php 
        if ($menucount == 0 && $categorycount == 0 && $subcategorycount == 0 && $itemcount == 0 && $dealcount == 0 && $imagecount == 0) {
            ?>
            <li>
开发者ID:auimendoza,项目名称:appfoodsyadmin,代码行数:31,代码来源:locations.php

示例12: getLocationDetails

 public function getLocationDetails()
 {
     $locations = Location::get();
     $result = View::make('reports.locationslist', ['locations' => $locations]);
     return $result;
 }
开发者ID:alexixim,项目名称:blood-bank,代码行数:6,代码来源:ReportController.php

示例13: session_start

<?php

session_start();
include "header.php";
include "common/sessionuser.inc";
require_once "class/Restaurant.inc";
require_once "class/Location.inc";
require_once "class/Deal.inc";
if (REQMETHOD == 'GET') {
    $locationid = $_GET['l'];
    $location = Location::get($locationid);
    $locationname = $location->getProperty('name');
    $restaurantrow = $location->getRestaurant();
    $restaurantid = $restaurantrow[0]['id'];
    $restaurantname = $restaurantrow[0]['name'];
    $deals = $location->getDeals();
}
?>
    <body>
<?php 
include "topnavbar.php";
include "dealhierarchy.php";
?>
    <div class="container content">
<?php 
include "breadcrumb.php";
?>
      <h1>Deals</h1>
      <h3><a href="adddeal?l=<?php 
echo $locationid;
?>
开发者ID:auimendoza,项目名称:appfoodsyadmin,代码行数:31,代码来源:deals.php

示例14: getLocationDetails

 public function getLocationDetails()
 {
     $locations = Location::get();
     $result = View::make('reports.locationslist', ['locations' => $locations]);
     return PDF::load($result, 'A4', 'portrait')->download();
 }
开发者ID:alexixim,项目名称:blood-bank,代码行数:6,代码来源:DownloadController.php

示例15: add_post

 public function add_post()
 {
     try {
         $name = trim($_REQUEST['name']);
         if ($this->getClass('LocationManager')->exists(trim($_REQUEST['name']))) {
             throw new Exception('Location already Exists, please try again.');
         }
         if (!$name) {
             throw new Exception('Please enter a name for this location.');
         }
         if (empty($_REQUEST['storagegroup'])) {
             throw new Exception('Please select the storage group this location relates to.');
         }
         $Location = new Location(array('name' => trim($_REQUEST['name']), 'storageGroupID' => $_REQUEST['storagegroup'], 'storageNodeID' => $_REQUEST['storagenode'], 'tftp' => $_REQUEST['tftp']));
         if ($_REQUEST['storagenode'] && $Location->get('storageGroupID') != $this->getClass('StorageNode', $_REQUEST['storagenode'])->get('storageGroupID')) {
             $Location->set('storageGroupID', $this->getClass('StorageNode', $_REQUEST['storagenode'])->get('storageGroupID'));
         }
         if ($Location->save()) {
             $this->FOGCore->setMessage('Location Added, editing!');
             $this->FOGCore->redirect('?node=location&sub=edit&id=' . $Location->get('id'));
         }
     } catch (Exception $e) {
         $this->FOGCore->setMessage($e->getMessage());
         $this->FOGCore->redirect($this->formAction);
     }
 }
开发者ID:bramverstraten,项目名称:fogproject,代码行数:26,代码来源:LocationManagementPage.class.php


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