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


PHP Area::find方法代码示例

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


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

示例1: convert

 public static function convert($row)
 {
     $subarea = new Area();
     $subarea->id = $row['id'];
     $subarea->nome = $row['nome'];
     $subarea->area = Area::find($row['area_id']);
     return $subarea;
 }
开发者ID:jalerson,项目名称:expotec,代码行数:8,代码来源:Subarea.class.php

示例2: put_area

 public static function put_area($codarea, $recibido)
 {
     $area = Area::find($codarea);
     $area->add_data($recibido);
     $respuesta = new stdClass();
     $respuesta->result = $area->save();
     if ($respuesta->result) {
         $respuesta->mensaje = "Actualizado correctamente.";
         $respuesta->area = $area;
     } else {
         $respuesta->mensaje = "Error al momento de actualizar.";
     }
     return $respuesta;
 }
开发者ID:andreshg112,项目名称:ar-sac,代码行数:14,代码来源:AreaController.php

示例3: update

 /**
  * Update the specified resource in storage.
  * PUT /area/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $Area = Area::find($id);
     if (!$Area) {
         return Response::json(['id' => $id], 404);
     }
     $V = Validator::make(Input::all(), ['name' => 'required|string', 'last_updated' => 'integer']);
     if ($V->fails()) {
         return Response::json($V->messages()->all(), 400);
     }
     $Area->name = Input::get('name');
     if (Input::has('last_updated')) {
         $Area->updated_at = new DateTime(date('c', round(Input::get('last_updated') / 1000)));
     } else {
         $Area->touch();
     }
     if ($Area->save()) {
         return Response::json($Area->toArray(), 200);
     }
 }
开发者ID:mymedialab,项目名称:listenings,代码行数:27,代码来源:AreaController.php

示例4: sendSibelForm

 protected function sendSibelForm()
 {
     // fixme:
     $city = City::find($this->getPreparedItem('id_city'));
     if ($city) {
         $region = Region::find($city->id_region);
         $area = Area::find($region->id_area);
     }
     $client = new SibelClient();
     $client->setLastName($this->preparedData['last_name']);
     $client->setFirstName($this->preparedData['first_name']);
     $client->setMiddleName($this->preparedData['patronymic_name']);
     $client->setPhone($this->preparedData['phone_number']);
     $client->setProject($this->getSibelProject());
     $client->setCreatedDate(date('Y-m-d H:i:s'));
     if (isset($area) && $area && $city) {
         $client->setDescription($area->title_ru);
         $client->setComment($city->title_ru);
     }
     $orderCode = $client->registerShortApplication();
     $this->preparedData['sibel_request'] = $client->getXml();
     $this->preparedData['sibel_response'] = $orderCode;
 }
开发者ID:OlesKashchenko,项目名称:SkillsProject1,代码行数:23,代码来源:ApplyFormSmallBusinessDeposit.php

示例5: destroy

 /**
  * Remove the specified resource from storage.
  * DELETE /area/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $area = Area::find($id)->delete();
     if (is_null($area)) {
         $class = 'error';
         $message = 'Record does not exist.';
     } else {
         $class = 'success';
         $message = 'Record successfully deleted.';
     }
     return Redirect::route('area.index')->with('class', $class)->with('message', $message);
 }
开发者ID:jcyanga28,项目名称:project-reference,代码行数:19,代码来源:AreaController.php

示例6: submit_disable_area

 public function submit_disable_area()
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1) {
             $area_id = Input::get("area_id");
             $url = "areas/edit_area" . "/" . $area_id;
             $area = Area::find($area_id);
             $usuarios_activos = User::searchPersonalActivoByIdArea($area_id)->get();
             if (count($usuarios_activos) == 0) {
                 $area->delete();
                 Session::flash('message', 'Se inhabilitó correctamente el área.');
                 return Redirect::to('areas/list_areas');
             } else {
                 Session::flash('error', 'El área cuenta con personal activo. Acción no realizada.');
             }
             return Redirect::to($url);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
开发者ID:ktakayama91,项目名称:GTSlaravel,代码行数:26,代码来源:AreasController.php

示例7: postAreaEdit

 public function postAreaEdit($AreaId)
 {
     $rules = array('name' => 'required|min:2|unique:area,name,' . $AreaId, 'code' => 'required|unique:area,code,' . $AreaId);
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::to('branch/area-edit/' . $AreaId)->withErrors($validator)->withInput();
     }
     $area = Area::find($AreaId);
     $area->name = Input::get('name');
     $area->code = Input::get('code');
     $area->save();
     return Redirect::to('branch/area')->with('success', '区域更新成功!');
 }
开发者ID:huanghua581,项目名称:erp,代码行数:13,代码来源:BranchController.php

示例8: postCambiarestado

 /**
  * Changed the specified resource from storage.
  * POST /area/cambiarestado
  *
  * @return Response
  */
 public function postCambiarestado()
 {
     if (Request::ajax()) {
         $area = Area::find(Input::get('id'));
         $area->estado = Input::get('estado');
         $area->save();
         return Response::json(array('rst' => 1, 'msj' => 'Registro actualizado correctamente'));
     }
 }
开发者ID:lcalderonc,项目名称:hdc2016,代码行数:15,代码来源:AreaController.php

示例9: edit

 /**
  * Show the form for editing the specified area.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $area = Area::find($id);
     return View::make('areas.edit', compact('area'));
 }
开发者ID:koenhendriks,项目名称:Gora,代码行数:11,代码来源:AreasController.php

示例10: destroy

 /**
  * Remove the specified resource from storage.
  * DELETE /areas/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $area = Area::find($id);
     $area->delete();
     return Redirect::to('allAreas');
 }
开发者ID:shankargiri,项目名称:taylor_latest,代码行数:13,代码来源:AreasController.php

示例11: getValorReporte

 public function getValorReporte($columna)
 {
     if (str_contains($columna, '.')) {
         $columna = explode('.', $columna)[1];
     }
     $valor = $this->{$columna};
     switch ($columna) {
         case "estado_id":
             return Estado::find($valor)->nombre;
         case "tipo_ayuda_id":
             return TipoAyuda::find($valor)->nombre;
         case "area_id":
             return Area::find($valor)->nombre;
         case "beneficiario_id":
             $benef = \Oracle\Beneficiario::find($valor);
             if (is_null($benef)) {
                 return $valor;
             }
             return $benef->nombre;
         case "requerimiento_id":
             return Requerimiento::find($valor)->nombre;
         case "estatus":
             return static::$estatusArray[$valor];
         case "recepcion_id":
             return Recepcion::find($valor)->nombre;
         case "especial_mes":
             return Solicitud::$array_meses[$valor];
         case "especial_edad":
             //                $persona_edad = Persona::find($valor);
             //                if (is_null($persona_edad)) {
             return $valor;
             //                }
             //                return $persona->nombre;
         //                }
         //                return $persona->nombre;
         case "sexo":
             if ($valor == '') {
                 return "No Seleccionado";
             }
             return Solicitud::$cmbsexo[$valor];
     }
 }
开发者ID:armandolazarte,项目名称:sasyc,代码行数:42,代码来源:Solicitud.php


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