_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q500
Client.getActionsByResource
train
public function getActionsByResource($resource) { if (!isset($this->resources[$resource])) { return null; // no resource found } $actions = array(); foreach ($this->resources[$resource] as $action => $path) { $actions[] = $action; } return $a...
php
{ "resource": "" }
q501
Client.getMethodByAction
train
public function getMethodByAction($action) { foreach ($this->methods as $method => $actions) { if (in_array($action, $actions)) { return $method; } } return 'get'; }
php
{ "resource": "" }
q502
Client.isMultiPartAction
train
public function isMultiPartAction($resource, $action) { return isset($this->multiPartActions[$resource]) && in_array($action, $this->multiPartActions[$resource]); }
php
{ "resource": "" }
q503
Client.getRequestPath
train
private function getRequestPath($resource, $action, &$params) { if (!isset($this->resources[$resource]) || !isset($this->resources[$resource][$action])) { throw new \UnexpectedValueException('Resource path not found'); } // get path $path = $this->resources[$resource][$a...
php
{ "resource": "" }
q504
Client.callApi
train
private function callApi($method, $path, $params, $isMultiPart) { // init session $ch = curl_init(); // request settings curl_setopt_array($ch, $this->curlSettings); // basic settings // url $url = $this->endpoint . $path; $url .= $method == 'get' ? $this->g...
php
{ "resource": "" }
q505
Data.getConfigData
train
public function getConfigData($field, $storeId = null) { if (null === $storeId) { $storeId = $this->_storeManager->getStore(null); } $path = 'installments/' . $field; return $this->_scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE, $storeId); }
php
{ "resource": "" }
q506
Data.getAllInstallmentPaymentMethodCodes
train
public function getAllInstallmentPaymentMethodCodes() { $return = []; $paymentMethods = (array) $this->_scopeConfig->getValue('installments/payment_methods'); foreach ($paymentMethods as $code => $null) { $return[] = $code; } return $return; }
php
{ "resource": "" }
q507
Data._getInstallmentsHelperFromPaymentMethod
train
protected function _getInstallmentsHelperFromPaymentMethod($methodCode) { $helperClassName = $this->_scopeConfig->getValue('installments/payment_methods/' . $methodCode . '/installments_helper'); $helper = $this->_helperFactory->get($helperClassName); if (false === $helper instan...
php
{ "resource": "" }
q508
Converter.convertLocalFile
train
public function convertLocalFile($inputPath, $outputFormat) { //check whether files are set or not if ($inputPath == '') throw new Exception('Input file not specified'); if ($outputFormat == '') throw new Exception('Format not specified'); //build URI ...
php
{ "resource": "" }
q509
ProductsServiceProvider.bindRepositories
train
protected function bindRepositories() { $bindings = [ AttributeRepositoryContract::class => AttributeRepository::class, AttributeValueRepositoryContract::class => AttributeValueRepository::class, ProductRepositoryContract::class => ProductRepository::class, ...
php
{ "resource": "" }
q510
InterestAmount.collect
train
public function collect( Quote $quote, ShippingAssignmentInterface $shippingAssignment, Total $total ) { parent::collect($quote, $shippingAssignment, $total); $baseInterest = (float) $quote->getBaseGabrielqsInstallmentsInterestAmount(); $interest = (float) $quote->ge...
php
{ "resource": "" }
q511
Method.checkPermission
train
public function checkPermission($method, $context) { if (!is_string($method)) { throw new \TypeError('The method parameter must be a string.'); } if (!$method) { throw new \InvalidArgumentException('The method parameter cannot be empty.'); } $currentR...
php
{ "resource": "" }
q512
Ip.checkPermission
train
public function checkPermission($ip, $context) { if (!is_string($ip)) { throw new \TypeError('The ip parameter must be a string.'); } if (!$ip) { throw new \InvalidArgumentException('The ip parameter cannot be empty.'); } $currentRequest = $this->requ...
php
{ "resource": "" }
q513
InterestAmount.initTotals
train
public function initTotals() { if ($value = $this->_getInterestAmount()) { $installmentInterest = new DataObject( [ 'code' => 'gabrielqs_installments_interest_amount', 'strong' => false, 'value' => $value, ...
php
{ "resource": "" }
q514
Host.checkPermission
train
public function checkPermission($host, $context) { if (!is_string($host)) { throw new \TypeError('The host parameter must be a string.'); } if (!$host) { throw new \InvalidArgumentException('The host parameter cannot be empty.'); } $currentRequest = $...
php
{ "resource": "" }
q515
ModuleContainer.loadConfig
train
public function loadConfig() { $path = $this->getConfigPath(); if (!is_dir($path)) { return []; } $configs = Cache::remember("moduleConfig::{$path}", Carbon::now()->addMinutes(10), function () use ($path) { $configs = []; foreach (new \DirectoryI...
php
{ "resource": "" }
q516
Folder.fileExists
train
public function fileExists($fileName, $storageName = '') { //check whether file is set or not if ($fileName == '') { AsposeApp::getLogger()->error(Exception::MSG_NO_FILENAME); throw new Exception(Exception::MSG_NO_FILENAME); } //build URI $strURI = $t...
php
{ "resource": "" }
q517
Folder.deleteFile
train
public function deleteFile($fileName, $storageName = '') { //check whether file is set or not if ($fileName == '') { AsposeApp::getLogger()->error(Exception::MSG_NO_FILENAME); throw new Exception(Exception::MSG_NO_FILENAME); } //build URI $strURI = $t...
php
{ "resource": "" }
q518
Folder.createFolder
train
public function createFolder($strFolder, $storageName = '') { //build URI $strURIRequest = $this->strURIFolder . $strFolder; if ($storageName != '') { $strURIRequest .= '?storage=' . $storageName; } //sign URI $signedURI = Utils::sign($strURIRequest); ...
php
{ "resource": "" }
q519
Folder.deleteFolder
train
public function deleteFolder($folderName, $recursive = false) { //check whether folder is set or not if ($folderName == '') throw new Exception('No folder name specified'); //build URI $strURI = $this->strURIFolder . $folderName; if ($recursive) { $st...
php
{ "resource": "" }
q520
Folder.getFilesList
train
public function getFilesList($strFolder, $storageName = '') { //build URI $strURI = $this->strURIFolder; //check whether file is set or not if (!$strFolder == '') { $strURI .= $strFolder; } if ($storageName != '') { $strURI .= '?storage=' . $st...
php
{ "resource": "" }
q521
Converter.convertByUrl
train
public function convertByUrl($url = '', $format = '', $outputFilename = '') { //check whether file is set or not if ($url == '') throw new Exception('Url not specified'); $strURI = Product::$baseProductUri . '/pdf/convert?url=' . $url . '&format=' . $format; $signedURI ...
php
{ "resource": "" }
q522
Converter.convertLocalFile
train
public function convertLocalFile($inputFile = '', $outputFilename = '', $outputFormat = '') { //check whether file is set or not if ($inputFile == '') throw new Exception('No file name specified'); if ($outputFormat == '') throw new Exception('output format not speci...
php
{ "resource": "" }
q523
Rule.compare
train
public static function compare(Rule $a, Rule $b, bool $checkTag = false): int { return Symbol::compare($a->subject, $b->subject) ?: Symbol::compareList($a->definition, $b->definition) ?: ($b->eof - $a->eof) ?: ($checkTag ? self::compareTag($a->tag, $b->tag) : ...
php
{ "resource": "" }
q524
UserCanBypassAccess.checkFlag
train
public function checkFlag(array $context): bool { if (!isset($context['user'])) { throw new \InvalidArgumentException(sprintf('The context parameter must contain a "user" key to be able to evaluate the %s flag.', $this->getName())); } $user = $context['user']; if (is_str...
php
{ "resource": "" }
q525
Cart.getMaximumInstallment
train
public function getMaximumInstallment() { if ($this->_maximumInstallment === null) { $grandTotal = $this->getCartGrandTotal(); $this->_maximumInstallment = $this->_installmentsHelper->getMaximumInstallment($grandTotal); } return $this->_maximumInstallment; }
php
{ "resource": "" }
q526
Import.read
train
public function read(string $filename): array { $lines = ['total' => 0, 'read' => 0]; // Open file as SPL object $file = new \SplFileObject($filename); // Read line by line while (!$file->eof()) { $line = $file->fgets(); // Save line only of not empt...
php
{ "resource": "" }
q527
Import.parse
train
public function parse(): ConfigInterface { $config = new Config(); array_map( function($line) use ($config) { if (preg_match('/^(\S+)\ (.*)/', $line, $matches)) { switch ($matches[1]) { case 'push': $...
php
{ "resource": "" }
q528
Document.getPageCount
train
public function getPageCount() { //build URI $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages'; //sign URI $signedURI = Utils::sign($strURI); //get response stream $responseStream = Utils::ProcessCommand($signedURI, 'GET', ''); ...
php
{ "resource": "" }
q529
Document.appendDocument
train
public function appendDocument($basePdf, $newPdf, $startPage = 0, $endPage = 0, $sourceFolder = '') { //check whether files are set or not if ($basePdf == '') throw new Exception('Base file not specified'); if ($newPdf == '') throw new Exception('File to merge is not ...
php
{ "resource": "" }
q530
Document.mergeDocuments
train
public function mergeDocuments(array $sourceFiles = array()) { $mergedFileName = $this->getFileName(); //check whether files are set or not if ($mergedFileName == '') throw new Exception('Output file not specified'); if (empty($sourceFiles)) throw new Exceptio...
php
{ "resource": "" }
q531
Document.getFormFieldCount
train
public function getFormFieldCount() { //build URI $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/fields'; //sign URI $signedURI = Utils::sign($strURI); //get response stream $responseStream = Utils::ProcessCommand($signedURI, 'GET', ''); ...
php
{ "resource": "" }
q532
Document.getFormField
train
public function getFormField($fieldName) { //build URI $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/fields/' . $fieldName; //sign URI $signedURI = Utils::sign($strURI); //get response stream $responseStream = Utils::ProcessCommand($signedU...
php
{ "resource": "" }
q533
Document.updateFormFields
train
public function updateFormFields(array $fieldArray, $documentFolder = '') { if (count($fieldArray) === 0) throw new Exception('Field array cannot be empty'); //build URI $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/fields?folder=' . $documentFolder; ...
php
{ "resource": "" }
q534
Document.updateFormField
train
public function updateFormField($fieldName, $fieldType, $fieldValue) { if ($fieldName == '') throw new Exception('Field name not specified'); if ($fieldType == '') throw new Exception('Field type not specified'); if ($fieldValue == '') t...
php
{ "resource": "" }
q535
Document.getDocumentProperties
train
public function getDocumentProperties() { //build URI to replace image $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/documentProperties'; //sign URI $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', '...
php
{ "resource": "" }
q536
Document.getDocumentProperty
train
public function getDocumentProperty($propertyName = '') { if ($propertyName == '') throw new Exception('Property name not specified'); //build URI to replace image $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/documentProperties/' . $propertyName; ...
php
{ "resource": "" }
q537
Document.setDocumentProperty
train
public function setDocumentProperty($propertyName = '', $propertyValue = '') { if ($propertyName == '') throw new Exception('Property name not specified'); //build URI to replace image $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/documentProperties/' ...
php
{ "resource": "" }
q538
Document.splitPages
train
public function splitPages($from, $to) { $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/split?from=' . $from . '&to=' . $to; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'POST', '', ''); $json = json_decode($response...
php
{ "resource": "" }
q539
Message.setClient
train
public function setClient($client) { if ($client instanceof Client && $this->client != $client) { $this->configureDefaults($client->getMessageDefaults(), true); } $this->client = $client; return $this; }
php
{ "resource": "" }
q540
Message.setChannel
train
public function setChannel($channel) { $this->removeTarget(); if ($channel) { $this->channel = (string) $channel; } return $this; }
php
{ "resource": "" }
q541
Message.setUser
train
public function setUser($user) { $this->removeTarget(); if ($user) { $this->user = (string) $user; } return $this; }
php
{ "resource": "" }
q542
Message.setAttachmentDefaults
train
public function setAttachmentDefaults($defaults) { if ($this->attachmentDefaults != ($defaults = (array) $defaults)) { $this->attachmentDefaults = $defaults; $this->setAttachments($this->attachments); } return $this; }
php
{ "resource": "" }
q543
Message.getAttachmentPayload
train
protected function getAttachmentPayload($text = null, $title = null, $images = null, $color = null) { $attachment = []; if ($text) { $attachment['text'] = $this->stringValue($text); } if ($title) { $attachment['title'] = $this->stringValue($title); }...
php
{ "resource": "" }
q544
Message.getImagesPayload
train
protected function getImagesPayload($value) { $images = []; foreach ((array) $value as $img) { if (! empty($img['url'])) { $img = $img['url']; } if (is_string($img) && ! empty($img)) { $images[] = ['url' => $img]; } ...
php
{ "resource": "" }
q545
Message.stringValue
train
protected function stringValue($value, $jsonOptions = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) { if (is_string($value)) { return $value; } if (method_exists($value, '__toString')) { return (string) $value; } if (method_exists($value, 'toArray...
php
{ "resource": "" }
q546
Message.addImage
train
public function addImage($image, $desc = null, $title = null) { return $this->addAttachment($desc, $title, $image); }
php
{ "resource": "" }
q547
Message.configureDefaults
train
public function configureDefaults(array $defaults, $force = false) { if ($force || empty($this->toArray())) { $attachmentDefaults = $this->attachmentDefaults; foreach (MessageDefaults::allKeys() as $key) { if (isset($defaults[$key]) && ! is_null($value = $defaults[$k...
php
{ "resource": "" }
q548
Message.fillDefaults
train
protected function fillDefaults($key, $value) { if ( ($key === MessageDefaults::USER || $key === MessageDefaults::CHANNEL) && (! is_null($this->getTarget())) ) { return; } if ($suffix = $this->studlyCase($key)) { $getMethod = 'get'.$su...
php
{ "resource": "" }
q549
Message.content
train
public function content() { $arguments = func_get_args(); $count = count($arguments); if ($count > 0) { $this->setText($arguments[0]); } if ($count > 1) { if (is_bool($arguments[1])) { $this->setMarkdown($arguments[1]); ...
php
{ "resource": "" }
q550
Message.toArray
train
public function toArray() { return array_filter( [ 'text' => $this->getText(), 'notification' => $this->getNotification(), 'markdown' => $this->getMarkdown(), 'channel' => $this->getChannel(), 'user' => $this->getUse...
php
{ "resource": "" }
q551
AttributeRepository.syncWithProductType
train
public function syncWithProductType(ProductTypeContract $productType, $attributeIds, array $requiredAttributes = []) { $attributeIds = is_array($attributeIds) ? $attributeIds : [$attributeIds]; $pivot = []; foreach ($attributeIds as $id) { $pivot[$id] = ['required' => in_array($...
php
{ "resource": "" }
q552
LeaderBoard.getData
train
public function getData($order = self::SORT_DESC) { return array( 'items' => array_map( function (Item $item) { /* * @var Item $item */ return $item->toArray(); }, ar...
php
{ "resource": "" }
q553
Config.generate
train
public function generate(): string { // Init the variable $config = ''; foreach ($this->getParams() as $key => $value) { $config .= $key . ((\strlen($value) > 0) ? ' ' . $value : '') . "\n"; } $certs = $this->getCerts(); if (\count($certs) > 0) { ...
php
{ "resource": "" }
q554
Config.addCert
train
public function addCert(string $type, string $pathOrContent, bool $isContent = false): ConfigInterface { $type = mb_strtolower($type); $this->throwIfNotInArray($type, self::CERTS); if (true === $isContent) { $this->_certs[$type]['content'] = $pathOrContent; } else { ...
php
{ "resource": "" }
q555
Config.delCert
train
public function delCert(string $type): ConfigInterface { $type = mb_strtolower($type); $this->throwIfNotInArray($type, self::CERTS); unset($this->_certs[$type]); return $this; }
php
{ "resource": "" }
q556
Config.getCert
train
public function getCert(string $type): array { $type = mb_strtolower($type); $this->throwIfNotInArray($type, self::CERTS); return $this->_certs[$type] ?? []; }
php
{ "resource": "" }
q557
Config.add
train
public function add(string $name, $value = null): ConfigInterface { $name = mb_strtolower($name); // Check if key is certificate or push, or classic parameter if (\in_array($name, self::CERTS, true)) { $this->addCert($name, $value); } elseif ($name === 'push') { ...
php
{ "resource": "" }
q558
Config.del
train
public function del(string $name): ConfigInterface { // Check if key is certificate or push, or classic parameter if (\in_array($name, self::CERTS, true)) { $this->delCert($name); } elseif ($name === 'push') { throw new \RuntimeException("Not possible to remove push, ...
php
{ "resource": "" }
q559
Document.getStats
train
public function getStats(array $options = array()) { $resolver = new OptionsResolver(); $resolver ->setDefaults(array( 'includeTextInShapes' => 'true', )) ->setDefined(array( 'includeFootnotes', 'includeComments', )) ...
php
{ "resource": "" }
q560
Document.appendDocument
train
public function appendDocument($appendDocs, $importFormatModes, $sourceFolder) { //check whether required information is complete if (count($appendDocs) != count($importFormatModes)) throw new Exception('Please specify complete documents and import format modes'); $post_array = ...
php
{ "resource": "" }
q561
Document.unprotectDocument
train
public function unprotectDocument(array $options) { $resolver = new OptionsResolver(); $resolver->setRequired('Password') ->setDefaults(array( 'ProtectionType' => 'AllowOnlyComments' )) ->setAllowedValues('ProtectionType', array( 'A...
php
{ "resource": "" }
q562
Document.updateProtection
train
public function updateProtection($oldPassword, $newPassword, $protectionType = 'AllowOnlyComments') { if ($oldPassword == '') { throw new Exception('Please Specify Old Password'); } if ($newPassword == '') { throw new Exception('Please Specify New Password'); ...
php
{ "resource": "" }
q563
Document.getPageSetup
train
public function getPageSetup($sectionid = '') { if ($sectionid == '') throw new Exception('No Section Id specified'); $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/sections/'.$sectionid.'/pageSetup'; $signedURI = Utils::sign($strURI); $respon...
php
{ "resource": "" }
q564
Document.getAllParagraphs
train
public function getAllParagraphs() { $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/paragraphs'; $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET',''); $json = json_decode($responseStream); if ($json->Co...
php
{ "resource": "" }
q565
Document.getParagraph
train
public function getParagraph($paragraphid = '') { if ($paragraphid == '') throw new Exception('No Paragraph Id specified'); $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/paragraphs/'.$paragraphid.''; $signedURI = Utils::sign($strURI); $respon...
php
{ "resource": "" }
q566
Document.updateParagraphRunFont
train
public function updateParagraphRunFont($options_xml = '', $paragraphid = '', $runid = '') { if ($options_xml == '') throw new Exception('Options not specified.'); if ($paragraphid == '') throw new Exception('No Paragraph Id specified'); if ($runid == '') ...
php
{ "resource": "" }
q567
Document.getHyperlinks
train
public function getHyperlinks() { //build URI $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/hyperlinks'; //sign URI $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = json_decod...
php
{ "resource": "" }
q568
Document.getHyperlink
train
public function getHyperlink($hyperlinkIndex) { if ($hyperlinkIndex == '') throw new Exception('Hyperlink index not specified'); //build URI $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/hyperlinks/' . $hyperlinkIndex; //sign URI ...
php
{ "resource": "" }
q569
Document.getBookmarks
train
public function getBookmarks() { //build URI $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/bookmarks'; //sign URI $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = json_decode(...
php
{ "resource": "" }
q570
Document.getBookmark
train
public function getBookmark($bookmarkName) { if ($bookmarkName == '') throw new Exception('Bookmark name not specified'); //build URI $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/bookmarks/' . $bookmarkName; //sign URI $signe...
php
{ "resource": "" }
q571
Document.updateBookmark
train
public function updateBookmark($bookmarkName, $bookmarkText) { if ($bookmarkName == '') throw new Exception('Bookmark name not specified'); if ($bookmarkText == '') throw new Exception('Bookmark text not specified'); //build URI $strURI = Pro...
php
{ "resource": "" }
q572
Extractor.getComments
train
public function getComments($slideNo = '', $storageName = '', $folder = '') { //check whether file is set or not if ($slideNo == '') throw new Exception('Missing required parameter slideNo'); $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $...
php
{ "resource": "" }
q573
Extractor.getImageCount
train
public function getImageCount($storageName = '', $folder = '') { $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/images'; if ($folder != '') { $strURI .= '?folder=' . $folder; } if ($storageName != '') { $strURI .= '&storage=' . $s...
php
{ "resource": "" }
q574
Extractor.getShapes
train
public function getShapes($slidenumber, $storageName = '', $folder = '') { $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slidenumber . '/shapes'; if ($folder != '') { $strURI .= '?folder=' . $folder; } if ($storageName != '') { ...
php
{ "resource": "" }
q575
Extractor.getShape
train
public function getShape($slideNumber, $shapeIndex, $storageName = '', $folderName = '') { $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/shapes/' . $shapeIndex; if ($folderName != '') { $strURI .= '?folder=' . $folderName; ...
php
{ "resource": "" }
q576
Extractor.getColorScheme
train
public function getColorScheme($slideNumber, $storageName = '') { //Build URI to get color scheme $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/colorScheme'; if ($storageName != '') { $strURI .= '?storage=' . $stora...
php
{ "resource": "" }
q577
Extractor.getFontScheme
train
public function getFontScheme($slideNumber, $storageName = '') { //Build URI to get font scheme $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/fontScheme'; if ($storageName != '') { $strURI .= '?storage=' . $storageN...
php
{ "resource": "" }
q578
Extractor.getFormatScheme
train
public function getFormatScheme($slideNumber, $storageName = '') { //Build URI to get format scheme $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/theme/formatScheme'; if ($storageName != '') { $strURI .= '?storage=' . $st...
php
{ "resource": "" }
q579
Extractor.getPlaceholderCount
train
public function getPlaceholderCount($slideNumber, $storageName = '', $folder = '') { $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/placeholders'; if ($folder != '') { $strURI .= '?folder=' . $folder; } if ($storag...
php
{ "resource": "" }
q580
Extractor.getPlaceholder
train
public function getPlaceholder($slideNumber, $placeholderIndex, $storageName = '', $folder = '') { $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber . '/placeholders/' . $placeholderIndex; if ($folder != '') { $strURI .= '?folder=' . $fo...
php
{ "resource": "" }
q581
Assignment.getAssignments
train
public function getAssignments() { //build URI $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/assignments/'; //sign URI $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = json_de...
php
{ "resource": "" }
q582
Assignment.getAssignment
train
public function getAssignment($assignmentId) { if ($assignmentId == '') throw new Exception('Assignment ID not specified'); //build URI $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/assignments/' . $assignmentId; //sign URI $signedURI...
php
{ "resource": "" }
q583
Assignment.addAssignment
train
public function addAssignment($taskUid, $resourceUid, $units, $changedFileName = '') { if ($taskUid == '') throw new Exception('Task Uid not specified'); if ($resourceUid == '') throw new Exception('Resource Uid not specified'); //build URI $strURI = Produc...
php
{ "resource": "" }
q584
Document.getTasks
train
public function getTasks() { //build URI $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/tasks'; //sign URI $signedURI = Utils::sign($strURI); $responseStream = Utils::processCommand($signedURI, 'GET', '', ''); $json = json_decode($respon...
php
{ "resource": "" }
q585
Document.getTask
train
public function getTask($taskId) { if ($taskId == '') throw new Exception('Task ID not specified'); //build URI $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/tasks/' . $taskId; //sign URI $signedURI = Utils::sign($strURI); ...
php
{ "resource": "" }
q586
Document.addLink
train
public function addLink($link, $index, $predecessorUid, $successorUid, $linkType, $lag, $lagFormat) { if ($link == '') throw new Exception('Link not specified'); if ($index == '') throw new Exception('Index not specified'); if ($predecessorUid == '')...
php
{ "resource": "" }
q587
Document.getOutlineCode
train
public function getOutlineCode($outlineCodeId) { if ($outlineCodeId == '') throw new Exception('Outline Code ID not specified'); //build URI $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/outlineCodes/' . $outlineCodeId; //sign URI $s...
php
{ "resource": "" }
q588
Document.getExtendedAttribute
train
public function getExtendedAttribute($extendedAttributeId) { if ($extendedAttributeId == '') throw new Exception('Extended Attribute ID not specified'); //build URI $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/extendedAttributes/' . $extendedAttribu...
php
{ "resource": "" }
q589
Document.deleteExtendedAttribute
train
public function deleteExtendedAttribute($extendedAttributeId, $changedFileName) { if ($extendedAttributeId == '') throw new Exception('Extended Attribute ID not specified'); //build URI $strURI = Product::$baseProductUri . '/tasks/' . $this->getFileName() . '/extendedAttributes...
php
{ "resource": "" }
q590
BaseRule.compareTag
train
public static function compareTag(?string $a, ?string $b): int { if (null === $a) { return null === $b ? 0 : -1; } return null === $b ? 1 : strcmp($a, $b); }
php
{ "resource": "" }
q591
Document.updateBMPPropertiesFromLocalFile
train
public function updateBMPPropertiesFromLocalFile($inputPath, $bitsPerPixel, $horizontalResolution, $verticalResolution, $outPath) { //check whether files are set or not if ($inputPath == '') throw new Exception('Input file not specified'); if ($bitsPerPixel == '') th...
php
{ "resource": "" }
q592
Document.updateGIFProperties
train
public function updateGIFProperties($backgroundColorIndex, $pixelAspectRatio, $interlaced, $outPath) { if ($backgroundColorIndex == '') throw new Exception('Background color index not specified'); if ($pixelAspectRatio == '') throw new Exception('Pixel aspect ratio not spec...
php
{ "resource": "" }
q593
Document.updateGIFPropertiesFromLocalFile
train
public function updateGIFPropertiesFromLocalFile($inputPath, $backgroundColorIndex, $pixelAspectRatio, $interlaced, $outPath) { //check whether files are set or not if ($inputPath == '') throw new Exception('Input file not specified'); if ($backgroundColorIndex == '') ...
php
{ "resource": "" }
q594
Document.updateJPGPropertiesFromLocalFile
train
public function updateJPGPropertiesFromLocalFile($inputPath, $quality, $compressionType, $outPath) { //check whether files are set or not if ($inputPath == '') throw new Exception('Input file not specified'); if ($quality == '') throw new Exception('Quality not speci...
php
{ "resource": "" }
q595
Document.updateTIFFPropertiesFromLocalFile
train
public function updateTIFFPropertiesFromLocalFile($inputPath, $compression, $resolutionUnit, $newWidth, $newHeight, $horizontalResolution, $verticalResolution, $outPath) { if ($inputPath == '') throw new Exception('Input file not specified'); if ($compression == '') ...
php
{ "resource": "" }
q596
Document.updatePSDPropertiesFromLocalFile
train
public function updatePSDPropertiesFromLocalFile($inputPath, $channelsCount, $compression, $outPath) { if ($channelsCount == '') throw new Exception('Channels count not specified'); if ($compression == '') throw new Exception('Compression method not specified'); if...
php
{ "resource": "" }
q597
LogicalAuthorizationExtension.checkRouteAccess
train
public function checkRouteAccess(string $routeName, $user = null): bool { return $this->laRoute->checkRouteAccess($routeName, $user); }
php
{ "resource": "" }
q598
LogicalAuthorizationExtension.checkModelAccess
train
public function checkModelAccess($model, string $action, $user = null): bool { return $this->laModel->checkModelAccess($model, $action, $user); }
php
{ "resource": "" }
q599
LogicalAuthorizationExtension.checkFieldAccess
train
public function checkFieldAccess($model, string $fieldName, string $action, $user = null): bool { return $this->laModel->checkFieldAccess($model, $fieldName, $action, $user); }
php
{ "resource": "" }