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


PHP Update::save方法代码示例

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


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

示例1: postNewsPost

 public function postNewsPost()
 {
     $posted = Input::get();
     $update = new Update();
     $update->message = $posted['message'];
     $update->date = $posted['date'];
     $update->save();
     return Redirect::to('admin/news')->with('success', 'New update has been posted');
 }
开发者ID:bernardowiredu,项目名称:unlocking-site,代码行数:9,代码来源:UpdateController.php

示例2: run

 public function run()
 {
     // $faker = Faker::create();
     // foreach(range(1, 10) as $index)
     // {
     // 	Update::create([
     // 	]);
     // }
     $updates = new Update();
     $updates->pitch_id = 1;
     $updates->update = "We are half way to our sales goal!  We are so proud of everyone's involvement.  Tell your friends.  More is on the way.";
     $updates->user_id = 1;
     $updates->save();
     $updates = new Update();
     $updates->pitch_id = 1;
     $updates->update = "We will be showing a new video this week showing our brewery facility.  Get excited.";
     $updates->user_id = 1;
     $updates->save();
 }
开发者ID:hopshoppub,项目名称:hopshop.dev,代码行数:19,代码来源:UpdatesTableSeeder.php

示例3: array

        $json = array('error' => 'Your update title cannot be empty.');
        exit(json_encode($json));
    }
    // update can't be empty
    if ($message == '') {
        $json = array('error' => 'Your update message cannot be empty.');
        exit(json_encode($json));
    }
    // get acceptedID
    $accepted = Accepted::getByUserID(Session::getUserID(), $task->getID());
    // update status
    $accepted->setStatus($status);
    $accepted->save();
    // create the update
    $update = new Update(array('creator_id' => Session::getUserID(), 'accepted_id' => $accepted->getID(), 'project_id' => $project->getID(), 'title' => $title, 'message' => $message));
    $update->save();
    // save uploaded files to database
    foreach ($_POST['file'] as $stored => $orig) {
        $stored = Filter::text($stored);
        $orig = Filter::text($orig);
        Upload::saveToDatabase($orig, $stored, Upload::TYPE_UPDATE, $update->getID(), $project->getID());
    }
    // log it
    $logEvent = new Event(array('event_type_id' => 'create_update', 'user_1_id' => Session::getUserID(), 'project_id' => $project->getID(), 'item_1_id' => $update->getID(), 'item_2_id' => $accepted->getID(), 'item_3_id' => $task->getID(), 'data_1' => $update->getTitle(), 'data_2' => $update->getMessage()));
    $logEvent->save();
    // we're done here
    Session::setMessage('You created a new update for this task.');
    $json = array('success' => '1', 'successUrl' => Url::update($update->getID()));
    echo json_encode($json);
} elseif ($action == 'edit-update') {
    // validate update
开发者ID:malimu,项目名称:Pipeline,代码行数:31,代码来源:update.process.php

示例4: postupdate

 public function postupdate($id)
 {
     $update = new Update();
     $update->user_id = Auth::user()->user_id;
     $update->pitch_id = $id;
     $update->update = Input::get('updateText');
     $update->save();
     return Redirect::action('PitchesController@show', [$id]);
 }
开发者ID:hopshoppub,项目名称:hopshop.dev,代码行数:9,代码来源:PitchesController.php

示例5: checkUpdate

 /**
  * Checks if the timestamp of this update has already been
  * processed, if yes then we will exit, otherwise we will add
  * it to the database.
  *
  * @return void
  */
 protected function checkUpdate()
 {
     // If the next update is expected at another timestamp then
     // we will exit the program and wait for a valid timestamp.
     if (Cache::has('vatsim.nextupdate') && Carbon::now()->lt(Cache::get('vatsim.nextupdate'))) {
         Log::info('Exit before next update ' . Cache::get('vatsim.nextupdate'));
         exit(0);
     }
     // If the update already exists with the current timestamp
     // then we would want to exit the program as we do not want
     // any duplicate position reports
     if (!is_null(Update::whereTimestamp($this->updateDate)->first())) {
         Log::info('Exit already exists ' . $this->updateDate);
         exit(0);
     }
     // Otherwise the new update time will be added to the database
     $update = new Update();
     $update->timestamp = $this->updateDate;
     $update->save();
     // Store the update ID in a class variable for position reports
     $this->updateId = $update->id;
     // Store the next update timestamp in the database
     Cache::forever('vatsim.nextupdate', $this->nextUpdate);
 }
开发者ID:T-SummerStudent,项目名称:new,代码行数:31,代码来源:VatawareUpdateCommand.php


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