Represents the "get_reviews_csv" action.

@throws ShopgateLibraryException
@see http://wiki.shopgate.com/Shopgate_Plugin_API_get_reviews_csv
322806
protected function getReviewsCsv()
    {
        if (isset($this->params['limit']) && isset($this->params['offset'])) {
            $this->plugin->setExportLimit((int)$this->params['limit']);
            $this->plugin->setExportOffset((int)$this->params['offset']);
            $this->plugin->setSplittedExport(true);
        }

        // generate / update reviews csv file
        $this->plugin->startGetReviewsCsv();

        if (empty($this->response)) {
            $this->response = new ShopgatePluginApiResponseTextCsvExport($this->trace_id);
        }
        $this->responseData = $this->config->getReviewsCsvPath();
    }
774631
protected function getCategoriesCsv()
    {
        if (isset($this->params['limit']) && isset($this->params['offset'])) {
            $this->plugin->setExportLimit((int)$this->params['limit']);
            $this->plugin->setExportOffset((int)$this->params['offset']);
            $this->plugin->setSplittedExport(true);
        }

        // generate / update categories csv file
        $this->plugin->startGetCategoriesCsv();

        if (empty($this->response)) {
            $this->response = new ShopgatePluginApiResponseTextCsvExport($this->trace_id);
        }
        $this->responseData = $this->config->getCategoriesCsvPath();
    }
187407
def get_review_history(brain_or_object, rev=True):
    
    obj = get_object(brain_or_object)
    review_history = []
    try:
        workflow = get_tool("portal_workflow")
        review_history = workflow.getInfoFor(obj, 'review_history')
    except WorkflowException as e:
        message = str(e)
        logger.error("Cannot retrieve review_history on {}: {}".format(
            obj, message))
    if not isinstance(review_history, (list, tuple)):
        logger.error("get_review_history: expected list, recieved {}".format(
            review_history))
        review_history = []
    if rev is True:
        review_history.reverse()
    return review_history
257934
def get_required_pull_request_reviews(self):
        
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.protection_url + "/required_pull_request_reviews",
            headers={'Accept': Consts.mediaTypeRequireMultipleApprovingReviews}
        )
        return github.RequiredPullRequestReviews.RequiredPullRequestReviews(self._requester, headers, data, completed=True)
48012
protected function updateOrder()
    {
        if (!isset($this->params['order_number'])) {
            throw new ShopgateLibraryException(ShopgateLibraryException::PLUGIN_API_NO_ORDER_NUMBER);
        }
        /** @var ShopgateOrder[] $orders */
        $orders = $this->merchantApi->getOrders(
            array(
                'order_numbers[0]' => $this->params['order_number'],
                'with_items'       => 1,
            )
        )->getData();

        if (empty($orders)) {
            throw new ShopgateLibraryException(
                ShopgateLibraryException::MERCHANT_API_INVALID_RESPONSE,
                '"order" not set or empty. Response: ' . var_export($orders, true)
            );
        }

        if (count($orders) > 1) {
            throw new ShopgateLibraryException(
                ShopgateLibraryException::MERCHANT_API_INVALID_RESPONSE,
                'more than one order in response. Response: ' . var_export($orders, true)
            );
        }

        $payment  = 0;
        $shipping = 0;

        if (isset($this->params['payment'])) {
            $payment = (int)$this->params['payment'];
        }
        if (isset($this->params['shipping'])) {
            $shipping = (int)$this->params['shipping'];
        }

        $orders[0]->setUpdatePayment($payment);
        $orders[0]->setUpdateShipping($shipping);

        if (empty($this->response)) {
            $this->response = new ShopgatePluginApiResponseAppJson($this->trace_id);
        }

        $orderData = $this->plugin->updateOrder($orders[0]);
        if (is_array($orderData)) {
            $this->responseData = $orderData;
        } else {
            $this->responseData['external_order_id']     = $orderData;
            $this->responseData['external_order_number'] = null;
        }
    }
458542
private function getReviewDataWithRating(ArrayCollection $reviews, ArrayCollection $ratings)
    {
        $reviewList = [];

        foreach ($reviews as $review) {
            $ratingAndReview = [
                'reviewId'      => $review->getId(),
                'text'          => $review->getText(),
                'createdAt'     => $review->getCreatedAt(),
                'objectId'      => $review->getObjectId(),
                'objectType'    => $review->getType(),
                'rating'        => false,
                'ratingId'      => false,
            ];

            foreach ($ratings as $rating) {
                if ($this->isReviewRating($review, $rating)) {
                    $ratingAndReview['rating'] = $rating->getRating();
                    $ratingAndReview['ratingId'] = $rating->getId();

                    break;
                }
            }

            $reviewList[] = $ratingAndReview;
        }

        return $reviewList;
    }
72699
protected function getItems()
    {
        $limit        = isset($this->params['limit'])
            ? (int)$this->params['limit']
            : null;
        $offset       = isset($this->params['offset'])
            ? (int)$this->params['offset']
            : null;
        $uids         = isset($this->params['uids'])
            ? (array)$this->params['uids']
            : array();
        $responseType = isset($this->params['response_type'])
            ? $this->params['response_type']
            : false;

        $supportedResponseTypes = $this->config->getSupportedResponseTypes();
        if (!empty($responseType) && !in_array($responseType, $supportedResponseTypes['get_items'])) {
            throw new ShopgateLibraryException(
                ShopgateLibraryException::PLUGIN_API_UNSUPPORTED_RESPONSE_TYPE,
                'Requested type: "' . $responseType . '"'
            );
        }

        $this->plugin->startGetItems($limit, $offset, $uids, $responseType);

        switch ($responseType) {
            default:
            case 'xml':
                $response     = new ShopgatePluginApiResponseAppXmlExport($this->trace_id);
                $responseData = $this->config->getItemsXmlPath();
                break;

            case 'json':
                $response     = new ShopgatePluginApiResponseAppJsonExport($this->trace_id);
                $responseData = $this->config->getItemsJsonPath();
                break;
        }

        if (empty($this->response)) {
            $this->response = $response;
        }

        $this->responseData = $responseData;
    }
1278356
def getCSVForReport(dbid,query=nil,qid=nil,qname=nil)
      genResultsTable(dbid,query,nil,nil,nil,nil,"csv",qid,qname)
   end
25333
public function saveReview()
    {
        if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
            return;
        }

        if ($this->canAcceptFormData() &&
            ($oRecommList = $this->getActiveRecommList()) && ($oUser = $this->getUser())
        ) {
            //save rating
            $dRating = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recommlistrating');
            if ($dRating !== null) {
                $dRating = (int) $dRating;
            }

            if ($dRating !== null && $dRating >= 1 && $dRating <= 5) {
                $oRating = oxNew(\OxidEsales\Eshop\Application\Model\Rating::class);
                if ($oRating->allowRating($oUser->getId(), 'oxrecommlist', $oRecommList->getId())) {
                    $oRating->oxratings__oxuserid = new \OxidEsales\Eshop\Core\Field($oUser->getId());
                    $oRating->oxratings__oxtype = new \OxidEsales\Eshop\Core\Field('oxrecommlist');
                    $oRating->oxratings__oxobjectid = new \OxidEsales\Eshop\Core\Field($oRecommList->getId());
                    $oRating->oxratings__oxrating = new \OxidEsales\Eshop\Core\Field($dRating);
                    $oRating->save();
                    $oRecommList->addToRatingAverage($dRating);
                }
            }

            if (($sReviewText = trim(( string ) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('rvw_txt', true)))) {
                $oReview = oxNew(\OxidEsales\Eshop\Application\Model\Review::class);
                $oReview->oxreviews__oxobjectid = new \OxidEsales\Eshop\Core\Field($oRecommList->getId());
                $oReview->oxreviews__oxtype = new \OxidEsales\Eshop\Core\Field('oxrecommlist');
                $oReview->oxreviews__oxtext = new \OxidEsales\Eshop\Core\Field($sReviewText, \OxidEsales\Eshop\Core\Field::T_RAW);
                $oReview->oxreviews__oxlang = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage());
                $oReview->oxreviews__oxuserid = new \OxidEsales\Eshop\Core\Field($oUser->getId());
                $oReview->oxreviews__oxrating = new \OxidEsales\Eshop\Core\Field(($dRating !== null) ? $dRating : null);
                $oReview->save();
            }
        }
    }
324235
public function actionRunaction() {
        $id       = $_POST['trash_id'];
        $criteria = null;
        $actions  = Yii::app()->getRequest()->getParam('action');

        if(count($id) > 0) {
			$criteria = new CDbCriteria;
			$criteria->addInCondition('id', $id);

			if($actions == 'publish') {
			    OmmuPages::model()->updateAll(array(
			        'published' => 1,
			    ),$criteria);
			} elseif($actions == 'unpublish') {
			    OmmuPages::model()->updateAll(array(
			        'published' => 0,
			    ),$criteria);
			} elseif($actions == 'trash') {
			    OmmuPages::model()->updateAll(array(
			        'published' => 2,
			    ),$criteria);
			} elseif($actions == 'delete') {
			    OmmuPages::model()->deleteAll($criteria);
			}
        }

        // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
        if(!Yii::app()->getRequest()->getParam('ajax')) {
			$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('manage'));
        }
    }
1045314
protected function AllowReportReviews()
    {
        $bAllowRateReviews = $this->AllowReadReview();
        if ($bAllowRateReviews) {
            $oModuleConfiguration = $this->GetModuleConfiguration();
            if (!$oModuleConfiguration->fieldAllowReportReviews) {
                $bAllowRateReviews = false;
            }
        }

        return $bAllowRateReviews;
    }
758358
public function export()
    {
        $products = $this->repository->all();
        $fileName = strtolower(str_random()) . '.csv';
        $dirPath = storage_path('app/public/catalog');
        $this->directory($dirPath);
       
        $file = fopen($dirPath . '/' . $fileName, 'w');
        foreach ($products as $product) {
            fputcsv($file, $product->toArray());
        }
        fclose($file);
        
        return response()->download($dirPath . '/' . $fileName);
    }
1056592
public static ReviewCollection list(Map<String, Object> params, RequestOptions options)
      throws StripeException {
    String url = String.format("%s%s", Stripe.getApiBase(), "/v1/reviews");
    return requestCollection(url, params, ReviewCollection.class, options);
  }
1045959
public Review getReview(String reviewId) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.ID, reviewId);

        URL url = new ApiUrl(apiKey, MethodBase.REVIEW).buildUrl(parameters);
        String webpage = httpTools.getRequest(url);

        try {
            return MAPPER.readValue(webpage, Review.class);
        } catch (IOException ex) {
            throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get review", url, ex);
        }
    }
36035
protected function process()
    {

        // prepare the store view code
        $this->getSubject()->prepareStoreViewCode();

        // set the entity ID for the product with the passed SKU
        if ($product = $this->loadProduct($this->getValue(ColumnKeys::SKU))) {
            $this->setIds($product);
        } else {
            $this->setIds(array());
        }

        // query whether or not the URL key column has a value
        if ($this->hasValue(ColumnKeys::URL_KEY)) {
            $this->setValue(ColumnKeys::URL_KEY, $this->makeUrlKeyUnique($this->getValue(ColumnKeys::URL_KEY)));
            return;
        }

        // query whether or not a product name is available
        if ($this->hasValue(ColumnKeys::NAME)) {
            $this->setValue(ColumnKeys::URL_KEY, $this->makeUrlKeyUnique($this->convertNameToUrlKey($this->getValue(ColumnKeys::NAME))));
            return;
        }

        // throw an exception, that the URL key can not be initialized and we're in admin store view
        if ($this->getSubject()->getStoreViewCode(StoreViewCodes::ADMIN) === StoreViewCodes::ADMIN) {
            throw new \Exception('Can\'t initialize the URL key because either columns "url_key" or "name" have a value set for default store view');
        }
    }
362211
public function exportAction()
    {
        $orders = $this->getRequest()->getPost('order_ids', array());

        try {
            // Build the CSV and retrieve its path
            $filePath = Mage::getModel('australia/shipping_carrier_clickandsend_export_csv')->exportOrders($orders);

            // Download the file
            $this->_prepareDownloadResponse(basename($filePath), file_get_contents($filePath));
        } catch (Exception $e) {
            Mage::getSingleton('core/session')->addError($e->getMessage());
            $this->_redirect('adminhtml/sales_order/index');
        }
    }
933805
public function getCsvFiles()
    {
        $childResults = [];
        foreach ($this->parsers as $type => $parser) {
            $childResults += $parser->getCsvFiles();
        }

        $results = array_merge(
            [
                $this->type => $this->result
            ],
            $childResults
        );

        return $results;
    }