Add a new review
824
protected function addReview()
    {
        if (!$this->isError()) {
            $id = $this->review->add($this->getSubmitted());
            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($id);
        }
    }
160539
def add_check(self, check_item):
        """"""
        self.checks.append(check_item)
        for other in self.others:
            other.add_check(check_item)
699081
def publish_if_new(cls):
    """"""
    message = cls.make_message()
    if message != cls.last_message:
      super(DashboardPubSub, cls).publish(message)
      cls.last_message = message
938972
def add_or_update(uid, post_data):
        '''
        
        '''
        catinfo = MCategory.get_by_uid(uid)
        if catinfo:
            MCategory.update(uid, post_data)
        else:
            TabTag.create(
                uid=uid,
                name=post_data['name'],
                slug=post_data['slug'],
                order=post_data['order'],
                kind=post_data['kind'] if 'kind' in post_data else '1',
                pid=post_data['pid'],
            )
        return uid
750582
function reviewsById(state = {}, action) {
  switch (action.type) {
    case RECEIVE_PRODUCT_REVIEWS:
    case RECEIVE_REVIEWS: {
      const nextReviews = action.reviews || [];
      return nextReviews.reduce((currentReviews, review) => ({
        ...currentReviews,
        [review.id]: review,
      }), state);
    }
    case RECEIVE_SUBMIT_REVIEW:
    case RECEIVE_USER_REVIEW:
      return {
        ...state,
        [action.review.id]: action.review,
      };
    default:
      return state;
  }
}
790196
public function add($review)
    {
        if (is_array($review)) {
            $this->collection[] = new Review($review);
        } elseif (is_object($review) && $review instanceof Review) {
            $this->collection[] = $review;
        }

        return $this;
    }
757708
def add(self, submission, archive, _):
        
        self.queue.put((submission, submission["result"], submission["grade"], submission["problems"], submission["tests"], submission["custom"], archive))
608040
private function registerReview($review)
    {
        try {
            $reviewModel = $this->reviewFactory->create();
            $reviewModel->setReviewId($review->getReviewId())
                ->setCustomerId($review->getCustomerId())
                ->setStoreId($review->getStoreId());
            $this->reviewResource->save($reviewModel);
        } catch (\Exception $e) {
            $this->helper->debug((string)$e, []);
        }
    }
1073962
protected function updateReview()
    {
        $submitted = $this->getSubmitted();

        if ($this->review->update($this->data_review['review_id'], $submitted)) {

            $message = $this->text('Review has been updated');

            if (empty($submitted['status'])) {
                $message = $this->text('Review has been updated and will be published after approval');
            }

            $this->redirect("product/{$this->data_product['product_id']}", $message, 'success');
        }

        $this->redirect("product/{$this->data_product['product_id']}");
    }
913809
public function UpdateStatsReviews()
    {
        $sArticleId = $this->id;
        if ($this->IsVariant()) {
            $sArticleId = $this->fieldVariantParentId;
        }
        $iCount = $this->GetReviewCount(true);
        $dAvrg = $this->GetReviewAverageScore(true);
        $this->getProductStatsService()->set($this->id, ProductStatisticsServiceInterface::TYPE_REVIEW_AVERAGE, $dAvrg);
        $this->getProductStatsService()->set($this->id, ProductStatisticsServiceInterface::TYPE_REVIEW_COUNT, $iCount);
        TCacheManager::PerformeTableChange($this->table, $sArticleId);
    }
398836
protected function addReview()
    {
        $this->controlAccess('review_add');

        if ($this->review->add($this->getSubmitted())) {
            $this->redirect('admin/content/review', $this->text('Review has been added'), 'success');
        }

        $this->redirect('', $this->text('Review has not been added'), 'warning');
    }
554998
public function reviews()
    {
        if (is_null($this->reviewRequests)) {
            $this->reviewRequests = new ReviewRequests($this->client);
        }

        return $this->reviewRequests;
    }
781489
protected function setDataUserEditReview()
    {
        $user = $this->user->get($this->getData('review.user_id'));

        if (isset($user['email'])) {
            $this->setData('review.email', $user['email']);
        }
    }
374492
def add_new(self, command):
        """"""
        self.queue[self.next_key] = command
        self.queue[self.next_key]['status'] = 'queued'
        self.queue[self.next_key]['returncode'] = ''
        self.queue[self.next_key]['stdout'] = ''
        self.queue[self.next_key]['stderr'] = ''
        self.queue[self.next_key]['start'] = ''
        self.queue[self.next_key]['end'] = ''

        self.next_key += 1
        self.write()
170559
def reviews(params = {})
      data = request("/review/list", params.merge(v: "2"))
      reviews = data["reviews"]["review"]
      if reviews.present?
        reviews.map { |review| Hashie::Mash.new(review) }
      else
        []
      end
    end
1030566
def add_content_ratings(self, app_id, submission_id, security_code):
        
        url = self.url('content_ratings') % app_id
        return self.conn.fetch('POST', url,
                               {'submission_id': '%s' % submission_id,
                                'security_code': '%s' % security_code
                                })
451285
def create
      @app_review = MnoEnterprise::AppComment.new(app_comment_params)

      if @app_review.save
        render :show
      else
        render json: @app_review.errors, status: :bad_request
      end
    end