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


PHP Review::create方法代码示例

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


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

示例1: store

 public function store(){
     $input=Input::get();
     unset($input['_token']);
     unset($input['submit']);
     Review::create($input);
     return Redirect::route('review_index');
 }
开发者ID:alur86,项目名称:PHP_Code_Samples,代码行数:7,代码来源:ReviewController.php

示例2: run

 public function run()
 {
     DB::table('reviews')->delete();
     Review::create(array('productId' => 1, 'stars' => 5, 'body' => 'I love this product!', 'author' => 'joe@thomas.com'));
     Review::create(array('productId' => 1, 'stars' => 3, 'body' => 'Not bad for the price.', 'author' => 'yolo1117@gmail.com'));
     Review::create(array('productId' => 2, 'stars' => 1, 'body' => 'Horrible product!', 'author' => 'derstan@gmail.com'));
     Review::create(array('productId' => 2, 'stars' => 2, 'body' => 'Needs more...', 'author' => 'wedemboyz@gmail.com'));
 }
开发者ID:frankt117,项目名称:Laravel-AngularJS-Example,代码行数:8,代码来源:ReviewTableSeeder.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     try {
         Review::create(array('productId' => Input::get('productId'), 'stars' => Input::get('stars'), 'body' => Input::get('body'), 'author' => Input::get('author')));
     } catch (Exception $e) {
         Log::error($e);
     }
     return Response::json(array('success' => true));
 }
开发者ID:frankt117,项目名称:Laravel-AngularJS-Example,代码行数:14,代码来源:ReviewController.php

示例4: create

 /**
  * Create an instance of Place by passing an array of properties.
  * This is mainly used by the GoogleAPI to convert it's raw
  * result data into a more usable collection of Places.
  *
  * @param string[] $args An array of properties to turn into a Place
  *
  * @return Place
  */
 public static function create(array $args)
 {
     $instance = new self();
     foreach ($args as $property => $value) {
         if (!in_array($property, self::$properties)) {
             continue;
         }
         if ($property == 'reviews') {
             foreach ($value as $review) {
                 $instance->reviews[] = Review::create($review);
             }
         } else {
             $instance->{$property} = $value;
         }
     }
     return $instance;
 }
开发者ID:Vicimus,项目名称:Gicimus,代码行数:26,代码来源:PlaceDetails.php

示例5: Review

<?php

require_once "../initialize.php";
$message = "";
if (isset($_POST['review']) && $_POST['review'] != "" && isset($_POST['rating']) && $_POST['rating'] != "" && isset($_POST['userid']) && $_POST['userid'] != "" && isset($_POST['itemid']) && $_POST['itemid'] != "" && isset($_POST['itemtype']) && $_POST['itemtype'] != "") {
    $review = new Review();
    $review->userid = $_POST['userid'];
    $review->itemid = $_POST['itemid'];
    $review->itemtype = $_POST['itemtype'];
    $review->review = $_POST['review'];
    $review->rating = $_POST['rating'];
    $review->pending = $_POST['pending'];
    $review->enabled = $_POST['enabled'];
    if (isset($_FILES['picture'])) {
        $file = new File($_FILES['picture']);
        $review->picture = $file->data;
    }
    $review->create();
    $log = new Log($session->userid, $clientip, "WEB", "CREATED REVIEW: " . $review->id);
    $log->create();
    $message .= "success";
} else {
    $message = "You have missed a required field.";
}
echo $message;
开发者ID:NemOry,项目名称:EpicueWebPanel,代码行数:25,代码来源:createreview.php

示例6: time

<?php

require_once '../core/init.php';
if (isset($_POST['comment'])) {
    $app_id = (int) $database->escape_value(htmlentities(trim($_POST['app_id'])));
    $name = $database->escape_value(htmlentities(trim($_POST['name'])));
    $rating = (int) $database->escape_value(htmlentities(trim($_POST['rating'])));
    $summary = $database->escape_value(htmlentities(trim($_POST['summary'])));
    $comment = $database->escape_value(htmlentities(trim($_POST['comment'])));
    $time_posted = time();
    $review = new Review();
    $review->app_id = $app_id;
    $review->user = $name;
    $review->summary = $summary;
    $review->message = $comment;
    $review->time_posted = $time_posted;
    if ($review->create()) {
        echo "success";
    } else {
        echo "failed";
    }
} else {
    echo "no request";
}
开发者ID:WebApps4u,项目名称:lwappstore,代码行数:24,代码来源:post_review.php

示例7: Review

require_once "../../includes/initialize.php";
global $session;
if (!$session->is_logged_in()) {
    redirect_to("../../index.php");
}
if ($_POST['oper'] == 'add') {
    $object = new Review();
    $object->userid = $_POST['userid'];
    $object->itemid = $_POST['itemid'];
    $object->itemtype = $_POST['itemtype'];
    $object->review = $_POST['review'];
    $object->rating = $_POST['rating'];
    $object->pending = $_POST['pending'];
    $object->enabled = $_POST['enabled'];
    $object->create();
    $log = new Log($session->userid, $clientip, "WEB", "CREATED REVIEW: " . $_POST['id']);
    $log->create();
} else {
    if ($_POST['oper'] == 'edit') {
        $object = Review::get_by_id($_POST['id']);
        $object->userid = $_POST['userid'];
        $object->itemid = $_POST['itemid'];
        $object->itemtype = $_POST['itemtype'];
        $object->review = $_POST['review'];
        $object->rating = $_POST['rating'];
        $object->pending = $_POST['pending'];
        $object->enabled = $_POST['enabled'];
        $object->update();
        $log = new Log($session->userid, $clientip, "WEB", "UPDATED REVIEW: " . $_POST['id']);
        $log->create();
开发者ID:NemOry,项目名称:DroidStoreWebPanel,代码行数:30,代码来源:reviews_manipulate.php

示例8: Review

 try {
     $new_review = new Review();
     $restaurant = new Restaurant();
     if ($restaurant->find($restaurant_id)) {
         $original_rating = $restaurant->get_rating();
         $new_rating = $rate;
         $all_reviews = Review::get_all_reviews_by_restaurant($restaurant_id);
         // var_dump($all_reviews);
         if ($all_reviews) {
             $overall_rate = 0;
             while ($a_review = $all_reviews->fetch_row()) {
                 $overall_rate += $a_review[4];
             }
             $new_rating = ($overall_rate + $rate) / ($all_reviews->num_rows + 1);
         }
         $new_review->create($fields);
         $restaurant->update_rating($new_rating);
         $success = true;
         $message = 'Adding review complete! Your review will be attached to the restaurant page shortly.';
     }
 } catch (Exception $e) {
     $success = false;
     $message = $e->getMessage();
 }
 $return_result = array('success' => $success, 'message' => $message);
 echo json_encode($return_result);
 // //add review
 // $title = $POST['title'];
 // $content = $_POST['content'];
 // $rating = $_POST['rating'];
 // $date = date('Y-m-d');
开发者ID:HuiSF,项目名称:FineTable-Class-Project,代码行数:31,代码来源:review.logic.php

示例9: time

 function post_review()
 {
     if (isset($_POST['comment'])) {
         $app_id = (int) $this->input->post('app_id', TRUE);
         $name = $this->input->post('name', TRUE);
         $rating = (int) $this->input->post('rating', TRUE);
         $summary = $this->input->post('summary', TRUE);
         $comment = $this->input->post('comment', TRUE);
         $time_posted = time();
         $review = new Review();
         $review->app_id = $app_id;
         $review->user = $name;
         $review->rating = $rating;
         $review->summary = $summary;
         $review->message = $comment;
         $review->time_posted = $time_posted;
         if ($review->create()) {
             echo "success";
         } else {
             echo "failed";
         }
     } else {
         echo "no request sent";
     }
 }
开发者ID:WebApps4u,项目名称:lwappstore,代码行数:25,代码来源:apis.php

示例10: create

 public function create()
 {
     return Review::create($this->params);
 }
开发者ID:ncowan15,项目名称:FoodApp3,代码行数:4,代码来源:reviews.php

示例11: sendreview

 public static function sendreview($input)
 {
     // var_dump(Request::segment(2)); die();
     if (Sentry::check()) {
         if ($input['to'] == Sentry::getUser()->email) {
             return Redirect::back()->with('info', 'You cannot send an inquiry to yourself!');
         } elseif ($input['subject'] == "") {
             return Redirect::back()->with('info', 'You have to fill in the body!');
         } else {
             $input['from'] = Sentry::getUser()->email;
             $input['score'] = 5;
             $review = Review::create($input);
             return Redirect::route('reviews.show', $review->id)->with('success', 'Review Successfully Sent!');
             // $reviews = Review::where('to', '=', $input['from']);
             // return Redirect::route('users.show', $review->id, compact('reviews')); //return Redirect::route('signin')
         }
     } else {
         //from the modal
         // if($input['subject'] == ""):
         // 	return Redirect::back()->with('info', 'You have to fill in the body!');
         // else:
         // 	$input['from'] = session_id();
         // 	$input['from'] = Sentry::getUser()->email;
         // 	$input['status'] = 'pending';
         // 	$review = Review::create($input);
         // endif;
         $message = 'You have to sign In to Submit a Review';
         // return Redirect::back()->with('success', $message);
         return Redirect::route('signin');
     }
 }
开发者ID:chris27tina,项目名称:TODO,代码行数:31,代码来源:All.php

示例12: Create

 public static function Create($review)
 {
     Review::create(array('value' => $review->value, 'product_id' => $review->product_id, 'account_id' => $review->account_id));
 }
开发者ID:krasaler,项目名称:FamilyStore,代码行数:4,代码来源:ReviewService.php

示例13: catch

    print_r($rsv->get_reservation_info());
    echo "<br>";
    echo $rsv->get_reservation_info_json();
    echo "<br>";
} catch (Exception $e) {
    $success = false;
    $message = $e->getMessage();
    echo "Find reservation Error: " . $message . "<br>";
}
echo ($success == true ? "SUCCESS" : "FAILURE") . "<br>";
$fields = array('user_id' => '1', 'restaurant_id' => '3', 'title' => 'Review Title', 'content' => 'Review content ABCD', 'rating' => '5');
echo "<br>Testing for creating a review: <br>";
$review_id = 0;
$review = new Review();
try {
    $review_id = $review->create($fields);
    $success = true;
    $message = 'New review creation is complete.<br>';
    echo $message;
} catch (Exception $e) {
    $success = false;
    $message = $e->getMessage();
    echo "Creating a new review Error: " . $message . "<br>";
}
echo ($success == true ? "SUCCESS" : "FAILURE") . "<br>";
try {
    echo "<br>Testing find review:<br>";
    print_r("If found review:" . $review->find($review_id) . "<br>");
    print_r($review->get_review_info());
    echo "<br>";
    echo $review->get_review_info_json();
开发者ID:HuiSF,项目名称:FineTable-Class-Project,代码行数:31,代码来源:test-rsv-and-review.php


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