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


PHP Status::find方法代码示例

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


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

示例1: updateIsClosed

 /**
  * Update the `is_closed` property.
  */
 public function updateIsClosed()
 {
     $this->isClosing = false;
     $this->isReopening = false;
     // Don't do anything unless the status has changed
     if ($this->originalStatusId != $this['status_id']) {
         $status = Status::find($this['status_id']);
         // Did the status change to open/started or closed?
         if ($status->status >= 1) {
             // Reopen ticket
             if ($this['is_closed']) {
                 $this->isClosing = false;
                 $this->isReopening = true;
             }
             $this['is_closed'] = false;
             $this->isClosing = false;
         } elseif ($status->status == 0) {
             // Close ticket
             if (!$this['is_closed']) {
                 $this->isClosing = true;
             }
             $this['is_closed'] = true;
         }
     }
 }
开发者ID:nirix,项目名称:traq,代码行数:28,代码来源:Ticket.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $status = Status::find($id);
     $status->delete();
     Flash::message('Your status has been removed.');
     return Redirect::back();
 }
开发者ID:jamalots,项目名称:jamalot.dev,代码行数:13,代码来源:StatusController.php

示例3: save

 /**
  * Save ticket
  */
 public function save()
 {
     // Set is_closed value based off status
     if ($status = Status::find($this->status_id)) {
         $this->is_closed = $status->is_closed;
     }
     return parent::save();
 }
开发者ID:nirix-old,项目名称:ticketer,代码行数:11,代码来源:Ticket.php

示例4: borrar_status

 public function borrar_status()
 {
     $id = Input::get('idedit');
     $status = Status::find($id);
     if ($status->delete()) {
         Session::flash('message', 'Eliminado correctamente');
         Session::flash('class', 'success');
     } else {
         Session::flash('message', 'Ha ocurrido un error, intentelo nuevamente');
         Session::flash('class', 'danger');
     }
     return Redirect::to('status');
 }
开发者ID:bmrpas,项目名称:SHREDDER,代码行数:13,代码来源:StatusController.php

示例5: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $status = Status::find($id);
     if ($status) {
         try {
             // Delete breed, if not possible, catch error.
             $status->delete();
         } catch (Exception $e) {
             // If breed to be deleted is in use, send nice error back to admin.
             return Redirect::back()->with('message', FlashMessage::DisplayAlert('Status can NOT be deleted because it\'s in use.', 'alert'));
         }
         return Redirect::back()->with('message', FlashMessage::DisplayAlert('Status Deleted Successfully!', 'success'));
     }
     return Redirect::back()->with('message', FlashMessage::DisplayAlert('Record Not Found.', 'alert'));
 }
开发者ID:2dan-devs,项目名称:animalshelter,代码行数:21,代码来源:StatusController.php

示例6: postEdit

 public function postEdit()
 {
     $validator = Validator::make(Input::all(), Status::$rules);
     $data = Input::all();
     $status = Status::find(Input::get('id_status'));
     if (is_null($status)) {
         App::abort(404);
     }
     if ($validator->passes()) {
         $status->fill($data);
         $status->date = date("Y-m-d", strtotime(Input::get('date')));
         $status->save();
         return Redirect::to(Input::get('url') . '#' . $status->id)->with('confirmation', '¡Los datos fueron actualizados!');
     } else {
         // validation has failed, display error messages
         return Redirect::to(Input::get('url') . '#formStatusEdit')->with('message-box', 'Debes corregir los siguientes campos:')->withErrors($validator)->withInput();
     }
 }
开发者ID:josemujicap,项目名称:AveFenix-CRM,代码行数:18,代码来源:StatusController.php

示例7: destroy

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

示例8: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $this->status->find($id)->delete();
     return Redirect::route('admin.tech_statuses.index');
 }
开发者ID:alexjberry,项目名称:rakkoII,代码行数:11,代码来源:TechStatusesController.php

示例9: update

 /**
  * Update the specified resource in storage.
  *
  * @param  [int]  $id
  * @return [Response]
  */
 public function update($id)
 {
     // Check if is_staff
     if (!$this->is_staff()) {
         Session::flash('alert_danger', 'Access denied.');
         return Redirect::to('dashboard');
     } else {
         try {
             // Organize Data
             $status_id = Input::get('status');
             $status_arr = Status::find($status_id);
             $status = $status_arr["attributes"]["status"];
             // Save Loan
             $loan = Loan::find($id);
             $loan->status_id = $status_id;
             $loan->save();
             // Save Transaction
             $transaction = new Transaction();
             $transaction->loan_id = $id;
             $transaction->user_id = $this->user->id;
             $transaction->transaction_type_id = "2";
             $transaction->updated_item_id = $id;
             $transaction->transaction_description = "Loan Status updated to " . $status;
             $transaction->save();
         } catch (\RuntimeException $e) {
             Session::flash('alert_danger', 'Failed to update loan.');
             return Redirect::to('loan/' . $id);
         }
         Session::flash('alert_success', 'Updated loan successfully.');
         return Redirect::to('loan/' . $id);
     }
 }
开发者ID:julianfresco,项目名称:documentHub,代码行数:38,代码来源:LoanController.php

示例10: postUpdate

 public function postUpdate()
 {
     $ruta = Status::find(Input::get('id'));
     $ruta->estado = Input::get('status');
     $ruta->save();
 }
开发者ID:Rubenazo,项目名称:transporte,代码行数:6,代码来源:AdminController.php


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