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


PHP Property::get方法代码示例

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


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

示例1: index

 public function index(SS_HTTPRequest $request)
 {
     $properties = Property::get();
     if ($search = $request->getVar('Keywords')) {
         $properties = $properties->filter(array('Title:PartialMatch' => $search));
     }
     if ($arrival = $request->getVar('ArrivalDate')) {
         $arrivalStamp = strtotime($arrival);
         $nightAdder = '+' . $request->getVar('Nights') . ' days';
         $startDate = date('Y-m-d', $arrivalStamp);
         $endDate = date('Y-m-d', strtotime($nightAdder, $arrivalStamp));
         $properties = $properties->filter(array('AvailableStart:LessThanOrEqual' => $startDate, 'AvailableEnd:GreaterThanOrEqual' => $endDate));
     }
     if ($bedrooms = $request->getVar('Bedrooms')) {
         $properties = $properties->filter(array('Bedrooms:GreaterThanOrEqual' => $bedrooms));
     }
     if ($bathrooms = $request->getVar('Bathrooms')) {
         $properties = $properties->filter(array('Bathrooms:GreaterThanOrEqual' => $bathrooms));
     }
     if ($minPrice = $request->getVar('MinPrice')) {
         $properties = $properties->filter(array('PricePerNight:GreaterThanOrEqual' => $minPrice));
     }
     if ($maxPrice = $request->getVar('MaxPrice')) {
         $properties = $properties->filter(array('PricePerNight:LessThanOrEqual' => $maxPrice));
     }
     $paginatedProperties = PaginatedList::create($properties, $request)->setPageLength(15)->setPaginationGetVar('s');
     $data = array('Results' => $paginatedProperties);
     if ($request->isAjax()) {
         return $this->customise($data)->renderWith('PropertySearchResults');
     }
     return $data;
 }
开发者ID:sachithranuwan,项目名称:one-ring-rentals,代码行数:32,代码来源:PropertySearchPage.php

示例2: index

 public function index(SS_HTTPRequest $request)
 {
     $properties = Property::get();
     $filters = ArrayList::create();
     if ($search = $request->getVar('Keywords')) {
         $filters->push(ArrayData::create(array('Label' => "Keywords: '{$search}'", 'RemoveLink' => HTTP::setGetVar('Keywords', null))));
         $properties = $properties->filter(array('Title:PartialMatch' => $search));
     }
     if ($arrival = $request->getVar('ArrivalDate')) {
         $arrivalStamp = strtotime($arrival);
         $nightAdder = '+' . $request->getVar('Nights') . ' days';
         $startDate = date('Y-m-d', $arrivalStamp);
         $endDate = date('Y-m-d', strtotime($nightAdder, $arrivalStamp));
         $properties = $properties->filter(array('AvailableStart:GreaterThanOrEqual' => $startDate, 'AvailableEnd:LessThanOrEqual' => $endDate));
     }
     if ($bedrooms = $request->getVar('Bedrooms')) {
         $filters->push(ArrayData::create(array('Label' => "{$bedrooms} bedrooms", 'RemoveLink' => HTTP::setGetVar('Bedrooms', null))));
         $properties = $properties->filter(array('Bedrooms:GreaterThanOrEqual' => $bedrooms));
     }
     if ($bathrooms = $request->getVar('Bathrooms')) {
         $filters->push(ArrayData::create(array('Label' => "{$bathrooms} bathrooms", 'RemoveLink' => HTTP::setGetVar('Bathrooms', null))));
         $properties = $properties->filter(array('Bathrooms:GreaterThanOrEqual' => $bathrooms));
     }
     if ($minPrice = $request->getVar('MinPrice')) {
         $filters->push(ArrayData::create(array('Label' => "Min. \${$minPrice}", 'RemoveLink' => HTTP::setGetVar('MinPrice', null))));
         $properties = $properties->filter(array('PricePerNight:GreaterThanOrEqual' => $minPrice));
     }
     if ($maxPrice = $request->getVar('MaxPrice')) {
         $filters->push(ArrayData::create(array('Label' => "Max. \${$maxPrice}", 'RemoveLink' => HTTP::setGetVar('MaxPrice', null))));
         $properties = $properties->filter(array('PricePerNight:LessThanOrEqual' => $maxPrice));
     }
     $paginatedProperties = PaginatedList::create($properties, $request)->setPageLength(15)->setPaginationGetVar('s');
     return array('Results' => $paginatedProperties, 'ActiveFilters' => $filters);
 }
开发者ID:roopamjain01,项目名称:one_ring,代码行数:34,代码来源:PropertySearchPage.php

示例3: function

Route::get('regenerate', function () {
    $property = new Property();
    $props = $property->get()->toArray();
    $seq = new Sequence();
    foreach ($props as $p) {
        $_id = new MongoId($p['_id']);
        $nseq = $seq->getNewId('property');
        $sdata = array('sequence' => $nseq, 'propertyId' => Config::get('ia.property_id_prefix') . $nseq);
        if ($property->where('_id', '=', $_id)->update($sdata)) {
            print $p['_id'] . '->' . $sdata['propertyId'] . '<br />';
        }
    }
});
Route::get('tonumber', function () {
    $property = new Property();
    $props = $property->get()->toArray();
    $seq = new Sequence();
    foreach ($props as $p) {
        $_id = new MongoId($p['_id']);
        $price = new MongoInt32($p['listingPrice']);
        $fmv = new MongoInt32($p['FMV']);
        $sdata = array('listingPrice' => $price, 'FMV' => $fmv);
        if ($property->where('_id', '=', $_id)->update($sdata)) {
            print $p['_id'] . '->' . $sdata['listingPrice'] . '<br />';
        }
    }
});
Route::get('regeneratepic/{obj?}', function ($obj = null) {
    set_time_limit(0);
    if (is_null($obj)) {
        $product = new Product();
开发者ID:awidarto,项目名称:tmadminflat,代码行数:31,代码来源:routes.php

示例4: FeaturedProperties

 public function FeaturedProperties()
 {
     return Property::get()->filter(array('FeaturedOnHomepage' => true))->limit(6);
 }
开发者ID:qteo94,项目名称:Silverstripe_tutorial,代码行数:4,代码来源:HomePage.php

示例5: FeaturedProperty

 public function FeaturedProperty()
 {
     return Property::get()->filter(array('FeaturedOnHomepage' => true))->limit(6)->sort('Created', 'DESC');
 }
开发者ID:lestercomia,项目名称:onering,代码行数:4,代码来源:HomePage.php

示例6: removeprop

 public function removeprop($propertyId)
 {
     if (!Owner::isAuthenticated()) {
         $this->redirect('/');
     } else {
         if ($property = Property::get(['id' => $propertyId])[0]) {
             $property->delete();
             Flash::set('message', 'You removed a property!');
             $this->redirect('/propertyowner/manage');
         } else {
             Flash::set('message', 'This property does not exist!');
             $this->redirect('/propertyowner/manage');
         }
     }
 }
开发者ID:superflyz,项目名称:wallfly-mvc,代码行数:15,代码来源:PropertyOwner.php


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