本文整理汇总了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;
}
}
}
示例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();
}
示例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();
}
示例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');
}
示例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'));
}
示例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();
}
}
示例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);
}
示例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');
}
示例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);
}
}
示例10: postUpdate
public function postUpdate()
{
$ruta = Status::find(Input::get('id'));
$ruta->estado = Input::get('status');
$ruta->save();
}