_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q700
Worksheet.getPicturesCount
train
public function getPicturesCount() { //check whether workshett name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->works...
php
{ "resource": "" }
q701
Worksheet.getOleObjectsCount
train
public function getOleObjectsCount() { //check whether workshett name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->wor...
php
{ "resource": "" }
q702
Worksheet.getCommentsCount
train
public function getCommentsCount() { //check whether workshett name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->works...
php
{ "resource": "" }
q703
Worksheet.freezePanes
train
public function freezePanes($row = 1, $col = 1, $freezedRows = 1, $freezedCols = 1) { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFile...
php
{ "resource": "" }
q704
Worksheet.updateProperties
train
public function updateProperties($properties = array()) { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/workb...
php
{ "resource": "" }
q705
Worksheet.moveWorksheet
train
public function moveWorksheet($worksheetName, $position) { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $fieldsArray['DestinationWorsheet'] = $worksheetName; $fieldsArray['Position'] = $p...
php
{ "resource": "" }
q706
Worksheet.calculateFormula
train
public function calculateFormula($formula) { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $thi...
php
{ "resource": "" }
q707
Worksheet.setCellValue
train
public function setCellValue($cellName, $valueType, $value) { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/wo...
php
{ "resource": "" }
q708
Worksheet.getRowsCount
train
public function getRowsCount($offset, $count) { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $...
php
{ "resource": "" }
q709
Worksheet.copyRows
train
public function copyRows($sourceRowIndex = 1, $destRowIndex = 1, $rowNumber = 1) { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName...
php
{ "resource": "" }
q710
Worksheet.getRow
train
public function getRow($rowIndex) { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksh...
php
{ "resource": "" }
q711
Worksheet.getColumn
train
public function getColumn($columnIndex) { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->...
php
{ "resource": "" }
q712
Worksheet.sortData
train
public function sortData(array $dataSort, $cellArea = '') { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/work...
php
{ "resource": "" }
q713
Worksheet.setCellStyle
train
public function setCellStyle($cellName, array $style) { //check whether worksheet name is set or not if ($this->worksheetName == '') throw new Exception('Worksheet name not specified'); $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/workshee...
php
{ "resource": "" }
q714
Worksheet.getCell
train
public function getCell($cellName) { if ($this->worksheetName == '') { throw new Exception('No Worksheet Specified'); } $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/cells/' . $cellName; $signedURI = Util...
php
{ "resource": "" }
q715
Worksheet.addPicture
train
public function addPicture($picturePath, $pictureLocation, $upperLeftRow = 0, $upperLeftColumn = 0, $lowerRightRow = 0, $lowerRightColumn = 0) { if ($this->worksheetName == '') { throw new Exception('No Worksheet Specified'); } if ($pictureLocation == 'Server' || $pictureLocation...
php
{ "resource": "" }
q716
Worksheet.addOleObject
train
public function addOleObject($oleFile = '', $imageFile = '', $upperLeftRow = 0, $upperLeftColumn = 0, $height = 0, $width = 0) { if ($this->worksheetName == '') { throw new Exception('No Worksheet Specified'); } $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName(...
php
{ "resource": "" }
q717
Worksheet.updateOleObject
train
public function updateOleObject($objectIndex, $object_data) { //Build URI $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/oleobjects/' . $objectIndex; //Sign URI $signedURI = Utils::sign($strURI); //Send reques...
php
{ "resource": "" }
q718
Worksheet.updatePicture
train
public function updatePicture($pictureIndex, $picture_data) { //Build URI $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/pictures/' . $pictureIndex; //Sign URI $signedURI = Utils::sign($strURI); //Send request...
php
{ "resource": "" }
q719
Worksheet.addEmptyRow
train
public function addEmptyRow($rowId) { if ($rowId == '') throw new Exception('Row ID not specified'); //Build URI $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/cells/rows/' . $rowId; //Sign URI ...
php
{ "resource": "" }
q720
Worksheet.setFormula
train
public function setFormula($cellName, $formula) { if ($cellName == '') throw new Exception('Cell Name not specified'); if ($formula == '') throw new Exception('Formula not specified'); //Build URI $strURI = Product::$baseProductUri . '/cells/...
php
{ "resource": "" }
q721
Worksheet.clearCellsContents
train
public function clearCellsContents($range) { if ($range == '') throw new Exception('Range not specified'); //Build URI $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/worksheets/' . $this->worksheetName . '/cells/clearcontents...
php
{ "resource": "" }
q722
Worksheet.mergeCells
train
public function mergeCells($startRow, $startColumn, $totalRows, $totalColumns) { if ($startRow == '') throw new Exception('Start Row not specified'); if ($startColumn == '') throw new Exception('Start Column not specified'); if ($totalRows == '') ...
php
{ "resource": "" }
q723
Worksheet.setRangeValue
train
public function setRangeValue($cellarea, $value, $type) { if ($cellarea == '') throw new Exception('Cellarea not specified'); if ($value == '') throw new Exception('Value not specified'); if ($type == '') throw new Exception('Type not spe...
php
{ "resource": "" }
q724
Worksheet.clearCellsFormatting
train
public function clearCellsFormatting($startRow, $startColumn, $endRow, $endColumn) { if ($startRow == '') throw new Exception('Start Row not specified'); if ($startColumn == '') throw new Exception('Start Column not specified'); if ($endRow == '') ...
php
{ "resource": "" }
q725
TableRow.isReduceOnly
train
public function isReduceOnly(): bool { return !$this->eofAction && !$this->terminalActions && !$this->gotoSwitches && $this->reduceRule; }
php
{ "resource": "" }
q726
WeChatLocationDriver.getLocation
train
private function getLocation() { return new Location($this->event->get('Location_X'), $this->event->get('Location_Y'), $this->event); }
php
{ "resource": "" }
q727
TextEditor.getText
train
public function getText() { $parameters = func_get_args(); //set parameter values if (count($parameters) > 0) { $pageNumber = $parameters[0]; } $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . ((isset($parameters[0])) ? '/pages/...
php
{ "resource": "" }
q728
TextEditor.getTextItems
train
public function getTextItems() { $parameters = func_get_args(); //set parameter values if (count($parameters) == 1) { $pageNumber = $parameters[0]; } else if (count($parameters) == 2) { $pageNumber = $parameters[0]; $fragmentNumber = $parameters[1...
php
{ "resource": "" }
q729
TextEditor.getPagesWordCount
train
public function getPagesWordCount() { try { $strURI = Product::$baseProductUri . "/pdf/" . $this->getFileName() . "/pages/wordCount"; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, "GET", "", ""); $json = json_decode(...
php
{ "resource": "" }
q730
TextEditor.getSegmentCount
train
public function getSegmentCount($pageNumber = '', $fragmentNumber = '') { if ($pageNumber == '') throw new Exception('page number not specified'); if ($fragmentNumber == '') throw new Exception('fragment number not specified'); $strURI = Product::$baseProductUri ...
php
{ "resource": "" }
q731
TextEditor.getTextFormat
train
public function getTextFormat() { $args = func_get_args(); if (count($args) == 2) { $pageNumber = $args[0]; $fragmentNumber = $args[1]; } if (count($args) == 3) { $pageNumber = $args[0]; $fragmentNumber = $args[1]; $segament...
php
{ "resource": "" }
q732
Client.getMessageDefaults
train
public function getMessageDefaults($key = null) { if (is_null($key)) { return $this->messageDefaults; } if (isset($this->messageDefaults[$key])) { return $this->messageDefaults[$key]; } }
php
{ "resource": "" }
q733
Client.sendMessage
train
public function sendMessage($message) { if ($payload = $this->getJsonPayload($message)) { $response = $this->getHttpClient() ->post($this->getWebhook(), [ 'headers' => ['Content-Type' => 'application/json'], 'body' => $payload, ...
php
{ "resource": "" }
q734
Client.getJsonPayload
train
protected function getJsonPayload($message) { if (is_array($message) || $message instanceof JsonSerializable) { return json_encode($message); } elseif (method_exists($message, 'toJson')) { return $message->toJson(); } elseif (method_exists($message, 'toArray')) { ...
php
{ "resource": "" }
q735
Document.changeSlidePosition
train
public function changeSlidePosition($old_position = '', $new_position = '', $storageName = '', $folder = '') { if ($old_position == '' || $new_position == '') throw new Exception('Missing Required Params'); $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slid...
php
{ "resource": "" }
q736
Document.cloneSlide
train
public function cloneSlide($slideno = '', $position = '', $storageName = '', $folder = '') { if ($position == '') throw new Exception('Position not speciefied.'); if ($slideno == '') throw new Exception('Slide not speciefied.'); $strURI = Product::$baseProductUri ....
php
{ "resource": "" }
q737
Document.splitPresentation
train
public function splitPresentation($from = '', $to = '', $destination = '', $format = '', $storageName = '', $folder = '') { $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/split?'; if ($folder != '') { $strURI .= '&folder=' . $folder; } if ($st...
php
{ "resource": "" }
q738
Document.mergePresentations
train
public function mergePresentations($presentationsList = array(), $storageName = '', $folder = '') { if (!is_array($presentationsList) || empty($presentationsList)) throw new Exception('Presentation list not speciefied'); $strURI = Product::$baseProductUri . '/slides/' . $this->getFileN...
php
{ "resource": "" }
q739
Document.createEmptyPresentation
train
public function createEmptyPresentation($storageName = '', $folder = '') { //Build URI to get a list of slides $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName(); if ($folder != '') { $strURI .= '?folder=' . $folder; } if ($storageName != '') ...
php
{ "resource": "" }
q740
Document.getSlideCount
train
public function getSlideCount($storageName = '', $folder = '') { //Build URI to get a list of slides $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides'; if ($folder != '') { $strURI .= '?folder=' . $folder; } if ($storageName != ...
php
{ "resource": "" }
q741
Document.getAllTextItems
train
public function getAllTextItems() { $parameters = func_get_args(); //set parameter values if (count($parameters) == 2) { $slideNumber = $parameters[0]; $withEmpty = $parameters[1]; } //Build URI to get all text items $strURI = Product::$ba...
php
{ "resource": "" }
q742
Document.addCustomProperty
train
public function addCustomProperty($propertiesList) { if ($propertiesList == '') throw new Exception('Properties not specified'); //build URI to merge Docs $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/documentProperties'; $put_data = json_...
php
{ "resource": "" }
q743
Document.saveAs
train
public function saveAs($outputPath, $saveFormat, $jpegQuality = '', $storageName = '', $folder = '') { if ($outputPath == '') throw new Exception('Output path not specified'); if ($saveFormat == '') throw new Exception('Save format not specified'); $strURI = Prod...
php
{ "resource": "" }
q744
Document.saveSlideAs
train
public function saveSlideAs($slideNumber, $outputPath, $saveFormat) { if ($outputPath == '') throw new Exception('Output path not specified'); if ($saveFormat == '') throw new Exception('Save format not specified'); if ($slideNumber == '') throw new Ex...
php
{ "resource": "" }
q745
Document.aspectRatio
train
public function aspectRatio($slideNumber) { if ($slideNumber == '') throw new Exception('Slide number not specified'); //build URI $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber; //sign URI $signedURI = Utils::...
php
{ "resource": "" }
q746
TextLoader.wantSymbol
train
private function wantSymbol(string $name, bool $isHidden = false, bool $isInline = false): Symbol { if ($isInline) { if (!isset($this->inline[$name]) && isset($this->symbols[$name])) { throw new GrammarException( "Inline '$name' conflicts with token <$name> de...
php
{ "resource": "" }
q747
Calendar.getCalendars
train
public function getCalendars() { //build URI $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/calendars/'; //sign URI $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = json_decode...
php
{ "resource": "" }
q748
Calendar.getCalendar
train
public function getCalendar($calendarUid) { if ($calendarUid == '') throw new Exception('Calendar Uid not specified'); //build URI $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/calendars/' . $calendarUid; //sign URI $signedURI = Uti...
php
{ "resource": "" }
q749
Calendar.addCalendar
train
public function addCalendar($jsonData) { if ($jsonData == '') throw new Exception('Data not specified'); //build URI $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/calendars/'; //sign URI $signedURI = Utils::sign($strURI); $re...
php
{ "resource": "" }
q750
Lexer.defines
train
public function defines(array $defines): self { if (!$defines) { return $this; } $dup_keys = array_intersect_key($this->defines, $defines); if ($dup_keys) { throw new \InvalidArgumentException( "Cannot redefine defines: " . join(', ', array_ke...
php
{ "resource": "" }
q751
Lexer.whitespaces
train
public function whitespaces(array $whitespaces): self { if (!$whitespaces) { return $this; } $copy = clone $this; $copy->whitespaces = array_merge($copy->whitespaces, $whitespaces); return $copy; }
php
{ "resource": "" }
q752
Lexer.fixed
train
public function fixed(array $fixed): self { if (!$fixed) { return $this; } $new_fixed = $this->addNamedTokens($this->fixed, $fixed, 'fixed'); $copy = clone $this; $copy->fixed = $new_fixed; return $copy; }
php
{ "resource": "" }
q753
Lexer.inline
train
public function inline(array $inline): self { if (!$inline) { return $this; } $copy = clone $this; $copy->inlines = array_merge($this->inlines, $inline); return $copy; }
php
{ "resource": "" }
q754
Lexer.terminals
train
public function terminals(array $terminals): self { if (!$terminals) { return $this; } $new_terminals = $this->addNamedTokens($this->regexpMap, $terminals, 'terminal'); $copy = clone $this; $copy->regexpMap = $new_terminals; return $copy; }
php
{ "resource": "" }
q755
Lexer.modifiers
train
public function modifiers(string $modifiers): self { if ('' === $modifiers) { return $this; } $copy = clone $this; $copy->modifiers .= $modifiers; return $copy; }
php
{ "resource": "" }
q756
Lexer.addNamedTokens
train
private function addNamedTokens(array $oldTokens, array $addTokens, string $errorType): array { $dup_keys = array_intersect_key($oldTokens, $addTokens); if ($dup_keys) { throw new \InvalidArgumentException( "Cannot redefine $errorType: " . join(', ', array_keys($dup_keys)...
php
{ "resource": "" }
q757
AnnotationEditor.getAllAnnotations
train
public function getAllAnnotations($pageNumber) { $iTotalAnnotation = $this->GetAnnotationsCount($pageNumber); $listAnnotations = array(); for ($index = 1; $index <= $iTotalAnnotation; $index++) { array_push($listAnnotations, $this->GetAnnotation($pageNumber, $index)); } ...
php
{ "resource": "" }
q758
AnnotationEditor.getAnnotationsCount
train
public function getAnnotationsCount($pageNumber) { $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/annotations'; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = json_deco...
php
{ "resource": "" }
q759
AnnotationEditor.getAnnotation
train
public function getAnnotation($pageNumber, $annotationIndex) { $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/annotations/' . $annotationIndex; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', ''...
php
{ "resource": "" }
q760
AnnotationEditor.getChildBookmarksCount
train
public function getChildBookmarksCount($parent) { $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/bookmarks/' . $parent . '/bookmarks'; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = json_decode(...
php
{ "resource": "" }
q761
AnnotationEditor.getChildBookmark
train
public function getChildBookmark($parentIndex, $childIndex) { $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/bookmarks/' . $parentIndex . '/bookmarks/' . $childIndex; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', '...
php
{ "resource": "" }
q762
AnnotationEditor.isChildBookmark
train
public function isChildBookmark($bookmarkIndex) { if ($bookmarkIndex === '') throw new Exception('bookmark index not specified'); $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/bookmarks/' . $bookmarkIndex; $signedURI = Utils::sign($strURI); $res...
php
{ "resource": "" }
q763
AnnotationEditor.getAllBookmarks
train
public function getAllBookmarks() { $iTotalBookmarks = $this->GetBookmarksCount(); $listBookmarks = array(); for ($index = 1; $index <= $iTotalBookmarks; $index++) { array_push($listBookmarks, $this->GetBookmark($index)); } return $listBookmarks; }
php
{ "resource": "" }
q764
AnnotationEditor.getAllAttachments
train
public function getAllAttachments() { $iTotalAttachments = $this->GetAttachmentsCount(); $listAttachments = array(); for ($index = 1; $index <= $iTotalAttachments; $index++) { array_push($listAttachments, $this->GetAttachment($index)); } return $listAttachments; ...
php
{ "resource": "" }
q765
AnnotationEditor.getAttachmentsCount
train
public function getAttachmentsCount() { $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/attachments'; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = json_decode($responseStream); return co...
php
{ "resource": "" }
q766
AnnotationEditor.getAttachment
train
public function getAttachment($attachmentIndex) { $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/attachments/' . $attachmentIndex; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = json_decode($res...
php
{ "resource": "" }
q767
AnnotationEditor.downloadAttachment
train
public function downloadAttachment($attachmentIndex) { $fileInformation = $this->GetAttachment($attachmentIndex); //build URI to download attachment $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/attachments/' . $attachmentIndex . '/download'; //sign URI ...
php
{ "resource": "" }
q768
AnnotationEditor.getAllLinks
train
public function getAllLinks($pageNumber) { $iTotalLinks = $this->GetLinksCount($pageNumber); $listLinks = array(); for ($index = 1; $index <= $iTotalLinks; $index++) { array_push($listLinks, $this->GetLink($pageNumber, $index)); } return $listLinks; }
php
{ "resource": "" }
q769
AnnotationEditor.getLinksCount
train
public function getLinksCount($pageNumber) { $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/links'; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = json_decode($response...
php
{ "resource": "" }
q770
AnnotationEditor.getLink
train
public function getLink($pageNumber, $linkIndex) { $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/links/' . $linkIndex; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = j...
php
{ "resource": "" }
q771
Role.checkPermission
train
public function checkPermission($role, $context) { if (!is_string($role)) { throw new \TypeError('The role parameter must be a string.'); } if (!$role) { throw new \InvalidArgumentException('The role parameter cannot be empty.'); } if (!is_array($conte...
php
{ "resource": "" }
q772
Connect2PayClient.getAccountInformation
train
public function getAccountInformation() { $url = $this->url . self::$API_ROUTES['ACCOUNT_INFO']; $url .= '?apiVersion=' . $this->apiVersion; $result = $this->doGet($url, array(), false); if ($result !== null && is_object($result)) { $accountInfo = AccountInformation::getFromJson($result); ...
php
{ "resource": "" }
q773
Connect2PayClient.preparePayment
train
public function preparePayment() { if ($this->validate()) { $trans = array(); foreach ($this->fieldsJSON as $fieldName) { if (is_array($this->{$fieldName}) || !C2PValidate::isEmpty($this->{$fieldName})) { $trans[$fieldName] = $this->{"get" . ucfirst($fieldName)}(); } } ...
php
{ "resource": "" }
q774
Connect2PayClient.getPaymentStatus
train
public function getPaymentStatus($merchantToken) { if ($merchantToken != null && strlen(trim($merchantToken)) > 0) { $url = $this->url . str_replace(":merchantToken", $merchantToken, Connect2PayClient::$API_ROUTES['PAYMENT_STATUS']); $url .= '?apiVersion=' . $this->apiVersion; $result = $this->do...
php
{ "resource": "" }
q775
Connect2PayClient.refundTransaction
train
public function refundTransaction($transactionID, $amount) { if ($transactionID !== null && $amount !== null && (is_int($amount) || ctype_digit($amount))) { $url = $this->url . str_replace(":transactionID", $transactionID, Connect2PayClient::$API_ROUTES['TRANS_REFUND']); $trans = array(); $trans['...
php
{ "resource": "" }
q776
Connect2PayClient.cancelSubscription
train
public function cancelSubscription($subscriptionID, $cancelReason) { if ($subscriptionID != null && is_numeric($subscriptionID) && isset($cancelReason) && is_numeric($cancelReason)) { $url = $this->url . str_replace(":subscriptionID", $subscriptionID, Connect2PayClient::$API_ROUTES['SUB_CANCEL']); $tran...
php
{ "resource": "" }
q777
Connect2PayClient.directAliPayProcess
train
public function directAliPayProcess($customerToken, $request) { if ($customerToken !== null && $request !== null) { $url = $this->url . str_replace(":customerToken", $customerToken, Connect2PayClient::$API_ROUTES['ALIPAY_DIRECT_PROCESS']); $request->setApiVersion($this->getApiVersion()); $result...
php
{ "resource": "" }
q778
Connect2PayClient.validate
train
public function validate() { $arrErrors = array(); $arrErrors = $this->validateFields(); if (sizeof($arrErrors) > 0) { foreach ($arrErrors as $error) { $this->clientErrorMessage .= $error . " * "; } return false; } return true; }
php
{ "resource": "" }
q779
Connect2PayClient.addCartProduct
train
public function addCartProduct($cartProduct) { if ($this->orderCartContent == null || !is_array($this->orderCartContent)) { $this->orderCartContent = array(); } if ($cartProduct instanceof CartProduct) { $this->orderCartContent[] = $cartProduct; } return $this; }
php
{ "resource": "" }
q780
Connect2PayClient.setDefaultOrderCartContent
train
public function setDefaultOrderCartContent() { $this->orderCartContent = array(); $product = new CartProduct(); $product->setCartProductId(0)->setCartProductName("NA"); $product->setCartProductUnitPrice(0)->setCartProductQuantity(1); $product->setCartProductBrand("NA")->setCartProductMPN("NA"); ...
php
{ "resource": "" }
q781
Connect2PayClient.validateFields
train
private function validateFields() { $fieldsRequired = $this->fieldsRequired; $returnError = array(); foreach ($fieldsRequired as $field) { if (C2PValidate::isEmpty($this->{$field}) && (!is_numeric($this->{$field}))) $returnError[] = $field . ' is empty'; } foreach ($this->fieldsSize ...
php
{ "resource": "" }
q782
PaymentStatus.getLastInitialTransactionAttempt
train
public function getLastInitialTransactionAttempt() { $lastAttempt = null; if (isset($this->transactions) && is_array($this->transactions) && count($this->transactions) > 0) { // Return the entry with the highest timestamp with type sale, authorize, // or submission foreach ($this->transaction...
php
{ "resource": "" }
q783
PaymentStatus.getReferringTransactionAttempt
train
public function getReferringTransactionAttempt($refTransactionId, $transactionOperation) { $attempts = $this->getReferringTransactionAttempts($refTransactionId, $transactionOperation); if (is_array($attempts) && count($attempts) > 0) { return $attempts[0]; } return null; }
php
{ "resource": "" }
q784
PaymentStatus.getReferringTransactionAttempts
train
public function getReferringTransactionAttempts($refTransactionId, $transactionOperation = null) { $attempts = array(); if ($refTransactionId !== null && isset($this->transactions) && is_array($this->transactions) && count($this->transactions) > 0) { foreach ($this->transactions as $transaction) { ...
php
{ "resource": "" }
q785
Connect2PayCurrencyHelper.getISO4217CurrencyFromCode
train
public static function getISO4217CurrencyFromCode($code) { foreach (Connect2PayCurrencyHelper::$currencies as $currency => $data) { if ($data["code"] == $code) { return $currency; } } return null; }
php
{ "resource": "" }
q786
Connect2PayCurrencyHelper.getISO4217CurrencyCode
train
public static function getISO4217CurrencyCode($currency) { return (array_key_exists($currency, Connect2PayCurrencyHelper::$currencies)) ? Connect2PayCurrencyHelper::$currencies[$currency]["code"] : null; }
php
{ "resource": "" }
q787
Connect2PayCurrencyHelper.getCurrencySymbol
train
public static function getCurrencySymbol($currency) { return (array_key_exists($currency, Connect2PayCurrencyHelper::$currencies)) ? Connect2PayCurrencyHelper::$currencies[$currency]["symbol"] : null; }
php
{ "resource": "" }
q788
Connect2PayCurrencyHelper.getCurrencyName
train
public static function getCurrencyName($currency) { return (array_key_exists($currency, Connect2PayCurrencyHelper::$currencies)) ? Connect2PayCurrencyHelper::$currencies[$currency]["currency"] : null; }
php
{ "resource": "" }
q789
Connect2PayCurrencyHelper.getRate
train
public static function getRate($from, $to) { // Check if currencies exists if (!Connect2PayCurrencyHelper::currencyIsAvailable($from) || !Connect2PayCurrencyHelper::currencyIsAvailable($to)) { return null; } // Build the request URL $url = Connect2PayCurrencyHelper::$APIIO_SERVICE_URL . date(...
php
{ "resource": "" }
q790
Connect2PayCurrencyHelper.convert
train
public static function convert($amount, $from, $to, $cent = true) { // Get the conversion rate $rate = Connect2PayCurrencyHelper::getRate($from, $to); if ($rate != null) { $convert = $amount * $rate; // If the amount was in cent, truncate the digit after the comma // else round the resul...
php
{ "resource": "" }
q791
C2PValidate.isPaymentMethod
train
static public function isPaymentMethod($paymentMethod) { return ((string) $paymentMethod == Connect2PayClient::PAYMENT_METHOD_CREDITCARD || (string) $paymentMethod == Connect2PayClient::PAYMENT_METHOD_TODITOCASH || (string) $paymentMethod == Connect2PayClient::PAYMENT_METHOD_BANKTRANSFER || ...
php
{ "resource": "" }
q792
C2PValidate.isPaymentNetwork
train
static public function isPaymentNetwork($paymentNetwork) { return ((string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_SOFORT || (string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_PRZELEWY24 || (string) $paymentNetwork == Connect2PayClient::PAYMENT_NETWORK_IDEAL || (st...
php
{ "resource": "" }
q793
C2PValidate.isPaymentMode
train
static public function isPaymentMode($paymentMode) { return ((string) $paymentMode == Connect2PayClient::PAYMENT_MODE_SINGLE || (string) $paymentMode == Connect2PayClient::PAYMENT_MODE_ONSHIPPING || (string) $paymentMode == Connect2PayClient::PAYMENT_MODE_RECURRENT || (string) $paymentMode =...
php
{ "resource": "" }
q794
C2PValidate.isSubscriptionType
train
static public function isSubscriptionType($subscriptionType) { return ((string) $subscriptionType == Connect2PayClient::SUBSCRIPTION_TYPE_NORMAL || (string) $subscriptionType == Connect2PayClient::SUBSCRIPTION_TYPE_INFINITE || (string) $subscriptionType == Connect2PayClient::SUBSCRIPTION_TYPE_ONETIM...
php
{ "resource": "" }
q795
C2PValidate.strlen
train
public static function strlen($str) { if (is_array($str)) return false; if (function_exists('mb_strlen')) return mb_strlen($str, 'UTF-8'); return strlen($str); }
php
{ "resource": "" }
q796
ModulesInstaller.migrateModule
train
public function migrateModule(ModuleContainerInterface $module) { $path = $module->getPath(['database', 'migrations']); $files = $this->migrator->getMigrationFiles($path); // Once we grab all of the migration files for the path, we will compare them // against the migrations that ha...
php
{ "resource": "" }
q797
ModulesInstaller.addModuleToReset
train
public function addModuleToReset(ModuleContainerInterface $module) { $path = $module->getPath(['database', 'migrations']); $this->migrator->requireFiles($path, $this->migrator->getMigrationFiles($path)); return $this; }
php
{ "resource": "" }
q798
ModulesInstaller.seedModule
train
public function seedModule(ModuleContainerInterface $module, array $data = []) { $className = $module->getNamespace().'\\database\\seeds\\DatabaseSeeder'; if (!class_exists($className)) { return false; } $seeder = app($className, $data); $seeder->run(); ...
php
{ "resource": "" }
q799
Workbook.removeAllProperties
train
public function removeAllProperties() { //build URI to merge Docs $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/documentProperties'; //sign URI $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'DELETE'); ...
php
{ "resource": "" }