當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Service::find方法代碼示例

本文整理匯總了PHP中Service::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP Service::find方法的具體用法?PHP Service::find怎麽用?PHP Service::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Service的用法示例。


在下文中一共展示了Service::find方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: change_template

 public function change_template()
 {
     App::import('Model', 'Service');
     $mService = new Service();
     $service = $mService->find('first', array('conditions' => array('Service.id' => $this->request->data['idService'])));
     echo json_encode($service['Service']);
     die;
 }
開發者ID:manorms,項目名稱:MyHouse,代碼行數:8,代碼來源:ExpensesController.php

示例2: createModel

 public function createModel()
 {
     $model = new Service();
     $criteria = new CDbCriteria();
     $criteria->select = new CDbExpression('MAX(sort) as sort');
     $max = $model->find($criteria);
     $model->sort = $max->sort + 10;
     return $model;
 }
開發者ID:kuzmina-mariya,項目名稱:unizaro-stone,代碼行數:9,代碼來源:ServiceBackendController.php

示例3: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($encadrantId = null, $serviceId = null)
 {
     if (is_null($serviceId)) {
         return Encadrant_Service_Etudiant::join('Service', 'Service.id_Service', '=', 'Encadrant_Service_Etudiant.id_Stage')->select('Service.*')->where('Encadrant_Service_Etudiant.id_Enseignant', '=', $encadrantId)->distinct()->get();
     } else {
         $service = Service::find($serviceId);
         return is_null($stage) ? response()->json(['error' => 'stage Note not found'], HttpResponse::HTTP_NOT_FOUND) : $service;
     }
 }
開發者ID:S4M37,項目名稱:Project_GangOfThree,代碼行數:15,代碼來源:StageController.php

示例4: getInfos

 /**
  * Infos pop-up clic marqueur bus
  */
 public function getInfos()
 {
     $infoBus = Service::find(Input::get('service'));
     $ligne = $infoBus->ligne;
     $service = $infoBus->service;
     $heure = date('H:i:s');
     $arretSuivant = Horaire::getNextArret($heure, $service);
     return Response::json($arretSuivant);
 }
開發者ID:Adelinegen,項目名稱:Linea,代碼行數:12,代碼來源:PlanController.php

示例5: edit

 public static function edit($id)
 {
     $service = Service::find($id);
     //        $offeredServices = OfferedServices::findByService($id);
     $employees = Employee::all();
     //
     $employeeList = OfferedServicesController::getEmployees($id, $employees);
     View::make('service/edit.html', array('attributes' => $service, 'employeeList' => $employeeList, 'employees' => $employees));
 }
開發者ID:Zonsu,項目名稱:Tsoha-Bootstrap,代碼行數:9,代碼來源:service_controller.php

示例6: connectServiceWithLocation

 /**
  * Creates a relation between a specific Advisor and a specific Location
  *
  * @var array
  */
 public function connectServiceWithLocation($services, $advisor_id, $location_id)
 {
     foreach ($services as $service_id) {
         $advisor = Advisor::find($advisor_id);
         $advisor->services()->attach($service_id);
         $service = Service::find($service_id);
         $service->locationsWithAdvisor()->attach($location_id, ['advisor_id' => $advisor_id]);
     }
     return $services;
 }
開發者ID:hvent90,項目名稱:service-booker,代碼行數:15,代碼來源:Service.php

示例7: getInfo

 /**
  * 獲取服務信息
  *
  * @return object
  */
 public static function getInfo($id, $key = 'name')
 {
     if (!$id) {
         return '<font color="grey">無此服務</font>';
     }
     $service = Service::find($id);
     if (empty($service)) {
         return '<font color="grey">無此服務</font>';
     }
     return $service->{$key};
 }
開發者ID:astronautyan,項目名稱:O2OMobile_PHP,代碼行數:16,代碼來源:Service.php

示例8: myserviceToHtml

 /**
  * 我的服務轉換為html
  *
  * @return string
  */
 public function myserviceToHtml()
 {
     if (!$this->services_id) {
         return '<font color="grey">無</font>';
     }
     $services = Service::find($this->services_id);
     if (empty($services)) {
         return '<font color="grey">無此服務</font>';
     }
     $class = 'badge-default';
     $text = $services->name;
     return "<span class=\"badge {$class}\">{$text}</span>";
 }
開發者ID:astronautyan,項目名稱:O2OMobile_PHP,代碼行數:18,代碼來源:MyService.php

示例9: addToCart

 function addToCart()
 {
     if (!Input::get('option')) {
         return Redirect::to('order');
     }
     if (!Input::get('cycle')) {
         return Redirect::to('order');
     }
     $option = ServiceOption::find(Input::get('option'));
     $service = Service::find($option->service_id);
     $cycle = BillingCycle::find(Input::get('cycle'));
     Cart::insert(array('id' => $option->id, 'name' => $service->name . ' ' . $option->option_name, 'price' => $option->base_price, 'quantity' => $cycle->cycle));
     return Redirect::to('order');
 }
開發者ID:carriercomm,項目名稱:saaspanel,代碼行數:14,代碼來源:OrderController.php

示例10: sandbox

 public static function sandbox()
 {
     $service = Service::find(1);
     $services = Service::all();
     $employees = Employee::all();
     $employee = Employee::find(1);
     $service2 = new Service(array('name' => 'aasdd', 'price' => "2", 'description' => "asfafaf"));
     $errors = $service2->errors();
     Kint::dump($employee);
     Kint::dump($employees);
     Kint::dump($service);
     Kint::dump($services);
     Kint::dump($errors);
     //        View::make('helloworld.html');
 }
開發者ID:Zonsu,項目名稱:Tsoha-Bootstrap,代碼行數:15,代碼來源:hello_world_controller.php

示例11: update

 private function update($tabla)
 {
     switch ($tabla) {
         case 'Service':
             $service = Service::update($service_id, array('driver_id' => $driver_id, 'status_id' => "2", 'car_id' => $driver_tmp->car_id));
             $this->servicio = Service::find($this->servicio_id);
             $this->validar($service);
             break;
         case 'Driver':
             $driver = Driver::update($this->driver_id, array("available" => "0"));
             $this->conductor = Driver::find($this->conductor_id);
             $this->validar($driver);
             break;
     }
 }
開發者ID:hammer92,項目名稱:Gravility.local,代碼行數:15,代碼來源:CodingController.php

示例12: saveModel

 /**
  * [saveModel - saves ou model info to the DB]
  * @param  boolean $service [description]
  * @return [Eloquent model] [service eloquent model]
  */
 protected function saveModel($service = false)
 {
     if (Input::get('id')) {
         $service = Service::find(Input::get('id'));
     }
     if (!$service) {
         $service = new Service();
     }
     $load_company_model = $service->companies;
     $service->name = Input::get('name');
     $service->category_id = Input::get('category_id');
     $service->status_id = Input::get('status_id');
     $service->invoice_periods_id = Input::get('invoice_periods_id');
     $service->default_monthly_costs = Input::get('default_monthly_costs');
     $service->comment = Input::get('comment');
     $service->save();
     return $service;
 }
開發者ID:strikles,項目名稱:php,代碼行數:23,代碼來源:AdminServiceController.php

示例13: delete

 public function delete()
 {
     if (Request::ajax()) {
         $data['response'] = 'error';
         $data['content'] = "Item cannot be deleted.";
         $id = Input::get('service_id');
         $package = Package::where('service_id', '=', $id)->count();
         if ($package == 0) {
             $service = Service::find($id);
             $service->delete();
             $data['response'] = 'ok';
             $data['content'] = "Item was successfully deleted.";
         }
         $response = Response::make(json_encode($data), 200);
         $response->header('Content-Type', 'text/json');
         return $response;
     }
 }
開發者ID:jacobDaeHyung,項目名稱:PHPLaravelGymManagementSystem,代碼行數:18,代碼來源:ServicesController.php

示例14: generalAction

 /**
  *
  */
 public function generalAction()
 {
     $dataRequest = $this->request->getJsonPost();
     $fields = array("key", "platform");
     if ($this->_checkFields($dataRequest, $fields)) {
         if ($this->_validKey()) {
             $services = Service::find();
             $return = array();
             $categories = array();
             foreach ($services as $item) {
                 $categories = array();
                 foreach ($item->ServiceCategory as $item2) {
                     $categories[] = array("id" => $item->getId(), "name" => utf8_encode($item2->getName()), "description" => utf8_encode($item2->getDescription()), "image" => $item2->getImage(), "video" => $item2->getVideo());
                 }
                 $return[] = array("id" => $item->getId(), "name" => utf8_encode($item->getName()), "description" => utf8_encode($item->getDescription()), "image" => $item->getImage(), "categories" => $categories);
             }
             $this->setJsonResponse(ControllerBase::SUCCESS, ControllerBase::FAILED_MESSAGE, array("status" => $this->strings->getString("http", "success"), "message" => $this->strings->getString("platform", "success"), "data" => $return));
         }
     }
 }
開發者ID:phalcondroid,項目名稱:spapp_phalcon,代碼行數:23,代碼來源:ApiController.php

示例15: getTimeSlot

 public function getTimeSlot($service_id)
 {
     Activity::log(['contentId' => $service_id, 'contentType' => 'Outlet', 'action' => 'getTimeSlot', 'description' => 'getTimeSlot of Service', 'details' => 'Service Id: ' . $service_id, 'updated' => false]);
     $service = Service::find($service_id);
     $outlet = Outlet::find($service->outlet_id);
     $startTime = explode(':', $outlet->startTime);
     $endTime = explode(':', $outlet->endTime);
     if (count($startTime) < 2 || count($endTime) < 2) {
         return array();
     }
     $start = mktime($startTime[0], $startTime[1], 0, 8, 12, 2014);
     $end = mktime($endTime[0], $endTime[1], 0, 8, 12, 2014);
     $hourArray = array();
     $count = 1;
     $hourArray[] = $start;
     while ($start < $end && $count < 1000) {
         $date = $start + $service->time_operate * 60;
         $hourArray[] = $date;
         $start = $date;
         $count++;
     }
     return $hourArray;
 }
開發者ID:EricBui0512,項目名稱:FYP,代碼行數:23,代碼來源:OutletRepository.php


注:本文中的Service::find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。