本文整理汇总了PHP中Location::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::orderBy方法的具体用法?PHP Location::orderBy怎么用?PHP Location::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location
的用法示例。
在下文中一共展示了Location::orderBy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getObjectStructure
static function getObjectStructure()
{
global $user;
//Load Libraries for lookup values
$location = new Location();
$location->orderBy('displayName');
if ($user->hasRole('libraryAdmin')) {
$homeLibrary = Library::getPatronHomeLibrary();
$location->libraryId = $homeLibrary->libraryId;
}
$location->find();
$locationList = array();
while ($location->fetch()) {
$locationList[$location->locationId] = $location->displayName;
}
require_once ROOT_DIR . '/sys/Browse/BrowseCategory.php';
$browseCategories = new BrowseCategory();
$browseCategories->orderBy('label');
$browseCategories->find();
$browseCategoryList = array();
while ($browseCategories->fetch()) {
$browseCategoryList[$browseCategories->textId] = $browseCategories->label . " ({$browseCategories->textId})";
}
$structure = array('id' => array('property' => 'id', 'type' => 'label', 'label' => 'Id', 'description' => 'The unique id of the hours within the database'), 'locationId' => array('property' => 'locationId', 'type' => 'enum', 'values' => $locationList, 'label' => 'Location', 'description' => 'A link to the location which the browse category belongs to'), 'browseCategoryTextId' => array('property' => 'browseCategoryTextId', 'type' => 'enum', 'values' => $browseCategoryList, 'label' => 'Browse Category', 'description' => 'The browse category to display '), 'weight' => array('property' => 'weight', 'type' => 'numeric', 'label' => 'Weight', 'weight' => 'Defines how lists are sorted within the widget. Lower weights are displayed to the left of the screen.', 'required' => true));
foreach ($structure as $fieldName => $field) {
$field['propertyOld'] = $field['property'] . 'Old';
$structure[$fieldName] = $field;
}
return $structure;
}
示例2: __construct
public function __construct(Reservation $reservation)
{
$this->reservation = $reservation;
View::share('locations', Location::orderBy('name', 'asc')->get());
View::share('types', Type::orderBy('name', 'asc')->get());
View::share('news', Post::where('post_type', 'news')->orderBy('created_at', 'desc')->limit(4)->get());
}
示例3: __construct
public function __construct()
{
View::share('page_title', 'Client');
View::share('locations', Location::orderBy('name', 'asc')->get());
View::share('types', Type::orderBy('name', 'asc')->get());
View::share('news', Post::where('post_type', 'news')->orderBy('created_at', 'desc')->limit(4)->get());
if (Sentry::check()) {
View::share('user', Sentry::getUser());
$this->user = Sentry::getUser();
}
}
示例4: store
/**
* Store a newly created resource in storage.
* POST /location
*
* @return Response
*/
public function store()
{
$location = new Location();
$location->address = Input::get('address');
$location->city = Input::get('city');
$location->state = Input::get('state');
$location->zip = Input::get('zip');
$location->save();
$locations = Location::orderBy('created_at', 'desc')->paginate(6);
return Redirect::action('LocationController@index');
}
示例5: dropdown
public static function dropdown($novalue = null)
{
$locations = Location::orderBy('name')->get();
$array = array();
if ($novalue) {
$array = array('' => 'Any');
}
foreach ($locations as $l) {
$key = $l->id;
$array[$key] = ucwords($l->name);
}
return $array;
}
示例6: run
public function run()
{
// Uncomment the below to wipe the table clean before populating
DB::table('events')->truncate();
$faker = Faker\Factory::create();
$dt = Carbon::now();
$dateNow = $dt->toDateTimeString();
for ($i = 0; $i < 1; $i++) {
$startDate = $dt->addYear(2)->toDateTimeString();
$endDate = $dt->addYear(3)->toDateTimeString();
$category = App::make('\\Acme\\Category\\CategoryRepository')->getEventCategories()->orderBY(DB::raw('RAND()'))->first()->id;
$user = User::orderBy(DB::raw('RAND()'))->first()->id;
$location = Location::orderBy(DB::raw('RAND()'))->first()->id;
$events = array(['category_id' => $category, 'user_id' => $user, 'location_id' => $location, 'title_en' => 'Kaizen Events', 'title_ar' => 'كايزن ', 'description_en' => $faker->sentence(20), 'description_ar' => $faker->sentence(20), 'slug' => $faker->sentence(10), 'date_start' => $startDate, 'date_end' => $endDate, 'phone' => '0096597978805', 'email' => $faker->email, 'address_en' => $faker->address, 'address_ar' => $faker->address, 'street_en' => $faker->streetAddress, 'street_ar' => $faker->streetAddress, 'latitude' => $faker->latitude, 'longitude' => $faker->longitude, 'featured' => (bool) rand(0, 1), 'free' => '0', 'created_at' => $dateNow, 'updated_at' => $dateNow, 'button_en' => 'Subscribe', 'button_ar' => 'سجل']);
DB::table('events')->insert($events);
}
// Uncomment the below to run the seeder
}
示例7: getAllObjects
function getAllObjects()
{
//Look lookup information for display in the user interface
global $user;
$location = new Location();
$location->orderBy('displayName');
if (!$user->hasRole('opacAdmin')) {
//Scope to just locations for the user based on home library
$patronLibrary = Library::getLibraryForLocation($user->homeLocationId);
$location->libraryId = $patronLibrary->libraryId;
}
$location->find();
$locationList = array();
while ($location->fetch()) {
$locationList[$location->locationId] = clone $location;
}
return $locationList;
}
示例8: getObjectStructure
function getObjectStructure()
{
global $user;
//Load Libraries for lookup values
$library = new Library();
$library->orderBy('displayName');
if ($user->hasRole('libraryAdmin')) {
$homeLibrary = Library::getPatronHomeLibrary();
$library->libraryId = $homeLibrary->libraryId;
}
$library->find();
$libraryList = array();
while ($library->fetch()) {
$libraryList[$library->libraryId] = $library->displayName;
}
//Look lookup information for display in the user interface
$location = new Location();
$location->orderBy('displayName');
$location->find();
$locationList = array();
$locationLookupList = array();
$locationLookupList[-1] = '<No Nearby Location>';
while ($location->fetch()) {
$locationLookupList[$location->locationId] = $location->displayName;
$locationList[$location->locationId] = clone $location;
}
// get the structure for the location's hours
$hoursStructure = LocationHours::getObjectStructure();
// we don't want to make the locationId property editable
// because it is associated with this location only
unset($hoursStructure['locationId']);
$facetSettingStructure = LocationFacetSetting::getObjectStructure();
unset($facetSettingStructure['weight']);
unset($facetSettingStructure['locationId']);
unset($facetSettingStructure['numEntriesToShowByDefault']);
unset($facetSettingStructure['showAsDropDown']);
//unset($facetSettingStructure['sortMode']);
$structure = array(array('property' => 'code', 'type' => 'text', 'label' => 'Code', 'description' => 'The code for use when communicating with Millennium'), array('property' => 'displayName', 'type' => 'text', 'label' => 'Display Name', 'description' => 'The full name of the location for display to the user', 'size' => '40'), array('property' => 'libraryId', 'type' => 'enum', 'values' => $libraryList, 'label' => 'Library', 'description' => 'A link to the library which the location belongs to'), array('property' => 'extraLocationCodesToInclude', 'type' => 'text', 'label' => 'Extra Locations To Include', 'description' => 'A list of other location codes to include in this location for indexing special collections, juvenile collections, etc.', 'size' => '40', 'hideInLists' => true), array('property' => 'nearbyLocation1', 'type' => 'enum', 'values' => $locationLookupList, 'label' => 'Nearby Location 1', 'description' => 'A secondary location which is nearby and could be used for pickup of materials.', 'hideInLists' => true), array('property' => 'nearbyLocation2', 'type' => 'enum', 'values' => $locationLookupList, 'label' => 'Nearby Location 2', 'description' => 'A tertiary location which is nearby and could be used for pickup of materials.', 'hideInLists' => true), array('property' => 'automaticTimeoutLength', 'type' => 'integer', 'label' => 'Automatic Timeout Length (logged in)', 'description' => 'The length of time before the user is automatically logged out in seconds.', 'size' => '8', 'hideInLists' => true), array('property' => 'automaticTimeoutLengthLoggedOut', 'type' => 'integer', 'label' => 'Automatic Timeout Length (logged out)', 'description' => 'The length of time before the catalog resets to the home page set to 0 to disable.', 'size' => '8', 'hideInLists' => true), array('property' => 'displaySection', 'type' => 'section', 'label' => 'Basic Display', 'hideInLists' => true, 'properties' => array(array('property' => 'homeLink', 'type' => 'text', 'label' => 'Home Link', 'description' => 'The location to send the user when they click on the home button or logo. Use default or blank to go back to the vufind home location.', 'hideInLists' => true, 'size' => '40'), array('property' => 'homePageWidgetId', 'type' => 'integer', 'label' => 'Home Page Widget Id', 'description' => 'An id for the list widget to display on the home page', 'hideInLists' => true), array('property' => 'footerTemplate', 'type' => 'text', 'label' => 'Footer Template', 'description' => 'The name of the footer file to display in the regular interface when scoped to a single school. Use default to display the default footer', 'hideInLists' => true, 'default' => 'default'))), array('property' => 'ilsSection', 'type' => 'section', 'label' => 'ILS/Account Integration', 'hideInLists' => true, 'properties' => array(array('property' => 'holdingBranchLabel', 'type' => 'text', 'label' => 'Holding Branch Label', 'description' => 'The label used within the holdings table in Millennium'), array('property' => 'scope', 'type' => 'text', 'label' => 'Scope', 'description' => 'The scope for the system in Millennium to refine holdings to the branch. If there is no scope defined for the branch, this can be set to 0.'), array('property' => 'useScope', 'type' => 'checkbox', 'label' => 'Use Scope?', 'description' => 'Whether or not the scope should be used when displaying holdings.', 'hideInLists' => true), array('property' => 'defaultPType', 'type' => 'text', 'label' => 'Default P-Type', 'description' => 'The P-Type to use when accessing a subdomain if the patron is not logged in. Use -1 to use the library default PType.'), array('property' => 'validHoldPickupBranch', 'type' => 'checkbox', 'label' => 'Valid Hold Pickup Branch?', 'description' => 'Determines if the location can be used as a pickup location if it is not the patrons home location or the location they are in.', 'hideInLists' => true), array('property' => 'showHoldButton', 'type' => 'checkbox', 'label' => 'Show Hold Button', 'description' => 'Whether or not the hold button is displayed so patrons can place holds on items', 'hideInLists' => true), array('property' => 'ptypesToAllowRenewals', 'type' => 'text', 'label' => 'PTypes that can renew', 'description' => 'A list of P-Types that can renew items or * to allow all P-Types to renew items.', 'hideInLists' => true), array('property' => 'suppressHoldings', 'type' => 'checkbox', 'label' => 'Suppress Holdings', 'description' => 'Whether or not all items for the title should be suppressed', 'hideInLists' => true))), array('property' => 'searchingSection', 'type' => 'section', 'label' => 'Searching', 'hideInLists' => true, 'properties' => array(array('property' => 'facetLabel', 'type' => 'text', 'label' => 'Facet Label', 'description' => 'The label of the facet that identifies this location.', 'hideInLists' => true, 'size' => '40'), array('property' => 'restrictSearchByLocation', 'type' => 'checkbox', 'label' => 'Restrict Search By Location', 'description' => 'Whether or not search results should only include titles from this location', 'hideInLists' => true), array('property' => 'includeDigitalCollection', 'type' => 'checkbox', 'label' => 'Include Digital Collection', 'description' => 'Whether or not titles from the digital collection should be included in searches', 'hideInLists' => true), array('property' => 'boostByLocation', 'type' => 'checkbox', 'label' => 'Boost By Location', 'description' => 'Whether or not boosting of titles owned by this location should be applied', 'hideInLists' => true), array('property' => 'recordsToBlackList', 'type' => 'textarea', 'label' => 'Records to deaccession', 'description' => 'A list of records to deaccession (hide) in search results. Enter one record per line.', 'hideInLists' => true), array('property' => 'repeatSearchOption', 'type' => 'enum', 'values' => array('none' => 'None', 'librarySystem' => 'Library System', 'marmot' => 'Marmot'), 'label' => 'Repeat Search Options', 'description' => 'Where to allow repeating search. Valid options are: none, librarySystem, marmot, all'), array('property' => 'repeatInProspector', 'type' => 'checkbox', 'label' => 'Repeat In Prospector', 'description' => 'Turn on to allow repeat search in Prospector functionality.', 'hideInLists' => true), array('property' => 'repeatInWorldCat', 'type' => 'checkbox', 'label' => 'Repeat In WorldCat', 'description' => 'Turn on to allow repeat search in WorldCat functionality.', 'hideInLists' => true), array('property' => 'repeatInOverdrive', 'type' => 'checkbox', 'label' => 'Repeat In Overdrive', 'description' => 'Turn on to allow repeat search in Overdrive functionality.', 'hideInLists' => true), array('property' => 'systemsToRepeatIn', 'type' => 'text', 'label' => 'Systems To Repeat In', 'description' => 'A list of library codes that you would like to repeat search in separated by pipes |.', 'hideInLists' => true))), array('property' => 'enrichmentSection', 'type' => 'section', 'label' => 'Catalog Enrichment', 'hideInLists' => true, 'properties' => array(array('property' => 'showAmazonReviews', 'type' => 'checkbox', 'label' => 'Show Amazon Reviews', 'description' => 'Whether or not reviews from Amazon are displayed on the full record page.', 'hideInLists' => true), array('property' => 'showStandardReviews', 'type' => 'checkbox', 'label' => 'Show Standard Reviews', 'description' => 'Whether or not reviews from Content Cafe/Syndetics are displayed on the full record page.', 'hideInLists' => true))), array('property' => 'hours', 'type' => 'oneToMany', 'keyThis' => 'locationId', 'keyOther' => 'locationId', 'subObjectType' => 'LocationHours', 'structure' => $hoursStructure, 'label' => 'Hours', 'description' => 'Library Hours', 'sortable' => false, 'storeDb' => true), 'facets' => array('property' => 'facets', 'type' => 'oneToMany', 'label' => 'Facets', 'description' => 'A list of facets to display in search results', 'keyThis' => 'locationId', 'keyOther' => 'locationId', 'subObjectType' => 'LocationFacetSetting', 'structure' => $facetSettingStructure, 'sortable' => true, 'storeDb' => true, 'allowEdit' => true, 'canEdit' => true));
foreach ($structure as $fieldName => $field) {
$field['propertyOld'] = $field['property'] . 'Old';
$structure[$fieldName] = $field;
}
return $structure;
}
示例9: store
/**
* Store a newly created resource in storage.
* POST /location
*
* @return Response
*/
public function store()
{
$event = new CalendarEvent();
$event->start = Input::get('start');
$event->end = Input::get('end');
$event->title = Input::get('title');
$event->description = Input::get('description');
if (Input::hasFile('img')) {
$event->img = Input::file('img')->move("images/uploaded/");
}
if (Input::has('price')) {
$event->price = Input::get('price');
}
$event->user_id = Auth::id();
$event->location_id = Input::get('locationID');
$event->save();
Log::info('Log Message', Input::all());
$locations = Location::orderBy('created_at', 'desc')->paginate(6);
return Redirect::action('LocationController@index');
}
示例10: getObjectStructure
function getObjectStructure()
{
//Look lookup information for display in the user interface
$location = new Location();
$location->orderBy('displayName');
$location->find();
$locationList = array();
$locationLookupList = array();
$locationLookupList[-1] = '<No Nearby Location>';
while ($location->fetch()) {
$locationLookupList[$location->locationId] = $location->displayName;
$locationList[$location->locationId] = clone $location;
}
$structure = array('ip' => array('property' => 'ip', 'type' => 'text', 'label' => 'IP Address', 'description' => 'The IP Address to map to a location formatted as xxx.xxx.xxx.xxx/mask'), 'location' => array('property' => 'location', 'type' => 'text', 'label' => 'Display Name', 'description' => 'Descriptive information for the IP Address for internal use'), 'locationid' => array('property' => 'locationid', 'type' => 'enum', 'values' => $locationLookupList, 'label' => 'Location', 'description' => 'The Location which this IP address maps to'));
foreach ($structure as $fieldName => $field) {
$field['propertyOld'] = $field['property'] . 'Old';
$structure[$fieldName] = $field;
}
return $structure;
}
示例11: getObjectStructure
static function getObjectStructure()
{
global $user;
$location = new Location();
$location->orderBy('displayName');
if ($user->hasRole('libraryAdmin')) {
$homeLibrary = Library::getPatronHomeLibrary();
$location->libraryId = $homeLibrary->libraryId;
}
$location->find();
while ($location->fetch()) {
$locationList[$location->locationId] = $location->displayName;
}
$structure = parent::getObjectStructure();
$structure['locationId'] = array('property' => 'locationId', 'type' => 'enum', 'values' => $locationList, 'label' => 'Location', 'description' => 'The id of a location');
foreach ($structure as $fieldName => $field) {
$field['propertyOld'] = $field['property'] . 'Old';
$structure[$fieldName] = $field;
}
return $structure;
}
示例12: getObjectStructure
static function getObjectStructure()
{
$location = new Location();
$location->orderBy('displayName');
$location->find();
$locationList = array();
while ($location->fetch()) {
$locationList[$location->locationId] = $location->displayName;
}
$days = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
$time = array('01:00', '01:30', '02:00', '02:30', '03:00', '03:30', '04:00', '04:30', '05:00', '05:30', '06:00', '06:30', '07:00', '07:30', '08:00', '08:30', '09:00', '09:30', '10:00', '10:30', '11:00', '11:30', '12:00', '12:30', '13:00', '13:30', '14:00', '14:30', '15:00', '15:30', '16:00', '16:30', '17:00', '17:30', '18:00', '18:30', '19:00', '19:30', '20:00', '20:30', '21:00', '21:30', '22:00', '22:30', '23:00', '23:30');
$timeList = array();
foreach ($time as $t) {
$timeList[$t] = $t;
}
$structure = array('id' => array('property' => 'id', 'type' => 'label', 'label' => 'Id', 'description' => 'The unique id of the hours within the database'), 'locationId' => array('property' => 'locationId', 'type' => 'enum', 'values' => $locationList, 'label' => 'Location', 'description' => 'The library location.'), 'day' => array('property' => 'day', 'type' => 'enum', 'values' => $days, 'label' => 'Day of Week', 'description' => 'The day of the week 0 to 6 (0 = Sunday to 6 = Saturday)'), 'closed' => array('property' => 'closed', 'type' => 'checkbox', 'label' => 'Closed', 'description' => 'Check to indicate that the library is closed on this day.'), 'open' => array('property' => 'open', 'type' => 'enum', 'values' => $timeList, 'label' => 'Opening Hour', 'description' => 'The opening hour. Use 24 hour format HH:MM, eg: 08:30'), 'close' => array('property' => 'close', 'type' => 'enum', 'values' => $timeList, 'label' => 'Closing Hour', 'description' => 'The closing hour. Use 24 hour format HH:MM, eg: 16:30'));
foreach ($structure as $fieldName => $field) {
$field['propertyOld'] = $field['property'] . 'Old';
$structure[$fieldName] = $field;
}
return $structure;
}
示例13: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return View::make('locations.index')->with('title', 'Locations')->with('locations', Location::orderBy('id', 'desc')->paginate(10));
}
示例14: getHoursAndLocations
function getHoursAndLocations()
{
//Get a list of locations for the current library
global $library;
$tmpLocation = new Location();
$tmpLocation->libraryId = $library->libraryId;
$tmpLocation->showInLocationsAndHoursList = 1;
$tmpLocation->orderBy('displayName');
$libraryLocations = array();
$tmpLocation->find();
if ($tmpLocation->N == 0) {
//Get all locations
$tmpLocation = new Location();
$tmpLocation->showInLocationsAndHoursList = 1;
$tmpLocation->orderBy('displayName');
$tmpLocation->find();
}
while ($tmpLocation->fetch()) {
$mapAddress = urlencode(preg_replace('/\\r\\n|\\r|\\n/', '+', $tmpLocation->address));
$clonedLocation = clone $tmpLocation;
$hours = $clonedLocation->getHours();
foreach ($hours as $key => $hourObj) {
if (!$hourObj->closed) {
$hourString = $hourObj->open;
list($hour, $minutes) = explode(':', $hourString);
if ($hour < 12) {
$hourObj->open .= ' AM';
} elseif ($hour == 12) {
$hourObj->open = 'Noon';
} elseif ($hour == 24) {
$hourObj->open = 'Midnight';
} else {
$hour -= 12;
$hourObj->open = "{$hour}:{$minutes} PM";
}
$hourString = $hourObj->close;
list($hour, $minutes) = explode(':', $hourString);
if ($hour < 12) {
$hourObj->close .= ' AM';
} elseif ($hour == 12) {
$hourObj->close = 'Noon';
} elseif ($hour == 24) {
$hourObj->close = 'Midnight';
} else {
$hour -= 12;
$hourObj->close = "{$hour}:{$minutes} PM";
}
}
$hours[$key] = $hourObj;
}
$libraryLocations[] = array('id' => $tmpLocation->locationId, 'name' => $tmpLocation->displayName, 'address' => preg_replace('/\\r\\n|\\r|\\n/', '<br/>', $tmpLocation->address), 'phone' => $tmpLocation->phone, 'map_image' => "http://maps.googleapis.com/maps/api/staticmap?center={$mapAddress}&zoom=15&size=200x200&sensor=false&markers=color:red%7C{$mapAddress}", 'map_link' => "http://maps.google.com/maps?f=q&hl=en&geocode=&q={$mapAddress}&ie=UTF8&z=15&iwloc=addr&om=1&t=m", 'hours' => $hours);
}
global $interface;
$interface->assign('libraryLocations', $libraryLocations);
return $interface->fetch('AJAX/libraryHoursAndLocations.tpl');
}
示例15: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
$location_lists = Location::orderBy('name')->lists('name', 'id');
return View::make('hotel.create')->with('location_lists', $location_lists);
}