_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q251200
Worksheet.unprotectCellsByColumnAndRow
validation
public function unprotectCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2) { $cellRange = Coordinate::stringFromColumnIndex($columnIndex1) . $row1 . ':' . Coordinate::stringFromColumnIndex($columnIndex2) . $row2; return $this->unprotectCells($cellRange); }
php
{ "resource": "" }
q251201
Worksheet.setAutoFilterByColumnAndRow
validation
public function setAutoFilterByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2) { return $this->setAutoFilter( Coordinate::stringFromColumnIndex($columnIndex1) . $row1 . ':' . Coordinate::stringFromColumnIndex($columnIndex2) . $row2 ); }
php
{ "resource": "" }
q251202
Worksheet.freezePane
validation
public function freezePane($cell, $topLeftCell = null) { if (is_string($cell) && Coordinate::coordinateIsRange($cell)) { throw new Exception('Freeze pane can not be set on a range of cells.'); } if ($cell !== null && $topLeftCell === null) { $coordinate = Coordinate:...
php
{ "resource": "" }
q251203
Worksheet.insertNewRowBefore
validation
public function insertNewRowBefore($pBefore, $pNumRows = 1) { if ($pBefore >= 1) { $objReferenceHelper = ReferenceHelper::getInstance(); $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this); } else { throw new Exception('Rows can only be inser...
php
{ "resource": "" }
q251204
Worksheet.removeRow
validation
public function removeRow($pRow, $pNumRows = 1) { if ($pRow >= 1) { $highestRow = $this->getHighestDataRow(); $objReferenceHelper = ReferenceHelper::getInstance(); $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this); for ($r =...
php
{ "resource": "" }
q251205
Worksheet.getComment
validation
public function getComment($pCellCoordinate) { // Uppercase coordinate $pCellCoordinate = strtoupper($pCellCoordinate); if (Coordinate::coordinateIsRange($pCellCoordinate)) { throw new Exception('Cell coordinate string can not be a range of cells.'); } elseif (strpos($pC...
php
{ "resource": "" }
q251206
Worksheet.setSelectedCells
validation
public function setSelectedCells($pCoordinate) { // Uppercase coordinate $pCoordinate = strtoupper($pCoordinate); // Convert 'A' to 'A:A' $pCoordinate = preg_replace('/^([A-Z]+)$/', '${1}:${1}', $pCoordinate); // Convert '1' to '1:1' $pCoordinate = preg_replace('/^(...
php
{ "resource": "" }
q251207
Worksheet.fromArray
validation
public function fromArray(array $source, $nullValue = null, $startCell = 'A1', $strictNullComparison = false) { // Convert a 1-D array to 2-D (for ease of looping) if (!is_array(end($source))) { $source = [$source]; } // start coordinate list($startColumn, $st...
php
{ "resource": "" }
q251208
Worksheet.getHyperlink
validation
public function getHyperlink($pCellCoordinate) { // return hyperlink if we already have one if (isset($this->hyperlinkCollection[$pCellCoordinate])) { return $this->hyperlinkCollection[$pCellCoordinate]; } // else create hyperlink $this->hyperlinkCollection[$pCel...
php
{ "resource": "" }
q251209
Worksheet.setHyperlink
validation
public function setHyperlink($pCellCoordinate, Hyperlink $pHyperlink = null) { if ($pHyperlink === null) { unset($this->hyperlinkCollection[$pCellCoordinate]); } else { $this->hyperlinkCollection[$pCellCoordinate] = $pHyperlink; } return $this; }
php
{ "resource": "" }
q251210
Worksheet.getDataValidation
validation
public function getDataValidation($pCellCoordinate) { // return data validation if we already have one if (isset($this->dataValidationCollection[$pCellCoordinate])) { return $this->dataValidationCollection[$pCellCoordinate]; } // else create data validation $this...
php
{ "resource": "" }
q251211
Worksheet.setDataValidation
validation
public function setDataValidation($pCellCoordinate, DataValidation $pDataValidation = null) { if ($pDataValidation === null) { unset($this->dataValidationCollection[$pCellCoordinate]); } else { $this->dataValidationCollection[$pCellCoordinate] = $pDataValidation; } ...
php
{ "resource": "" }
q251212
Worksheet.shrinkRangeToFit
validation
public function shrinkRangeToFit($range) { $maxCol = $this->getHighestColumn(); $maxRow = $this->getHighestRow(); $maxCol = Coordinate::columnIndexFromString($maxCol); $rangeBlocks = explode(' ', $range); foreach ($rangeBlocks as &$rangeSet) { $rangeBoundaries = ...
php
{ "resource": "" }
q251213
Worksheet.setCodeName
validation
public function setCodeName($pValue, $validate = true) { // Is this a 'rename' or not? if ($this->getCodeName() == $pValue) { return $this; } if ($validate) { $pValue = str_replace(' ', '_', $pValue); //Excel does this automatically without flinching, we are ...
php
{ "resource": "" }
q251214
NumberFormat.setFormatCode
validation
public function setFormatCode($pValue) { if ($pValue == '') { $pValue = self::FORMAT_GENERAL; } if ($this->isSupervisor) { $styleArray = $this->getStyleArray(['formatCode' => $pValue]); $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFro...
php
{ "resource": "" }
q251215
NumberFormat.setBuiltInFormatCode
validation
public function setBuiltInFormatCode($pValue) { if ($this->isSupervisor) { $styleArray = $this->getStyleArray(['formatCode' => self::builtInFormatCode($pValue)]); $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); } else { $...
php
{ "resource": "" }
q251216
NumberFormat.fillBuiltInFormatCodes
validation
private static function fillBuiltInFormatCodes() { // [MS-OI29500: Microsoft Office Implementation Information for ISO/IEC-29500 Standard Compliance] // 18.8.30. numFmt (Number Format) // // The ECMA standard defines built-in format IDs // 14: "mm-dd-yy" // ...
php
{ "resource": "" }
q251217
NumberFormat.builtInFormatCode
validation
public static function builtInFormatCode($pIndex) { // Clean parameter $pIndex = (int) $pIndex; // Ensure built-in format codes are available self::fillBuiltInFormatCodes(); // Lookup format code if (isset(self::$builtInFormats[$pIndex])) { return self::...
php
{ "resource": "" }
q251218
Pdf.prepareForSave
validation
protected function prepareForSave($pFilename) { // garbage collect $this->spreadsheet->garbageCollect(); $this->saveArrayReturnType = Calculation::getArrayReturnType(); Calculation::setArrayReturnType(Calculation::RETURN_ARRAY_AS_VALUE); // Open file $fileHandle =...
php
{ "resource": "" }
q251219
CurlAdapter.request
validation
public function request($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout); $response = curl_exec($ch); curl_close($ch); if ($response ===...
php
{ "resource": "" }
q251220
Comments.writeComments
validation
public function writeComments(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDire...
php
{ "resource": "" }
q251221
Comments.writeComment
validation
private function writeComment(XMLWriter $objWriter, $pCellReference, Comment $pComment, array $pAuthors) { // comment $objWriter->startElement('comment'); $objWriter->writeAttribute('ref', $pCellReference); $objWriter->writeAttribute('authorId', $pAuthors[$pComment->getAuthor()]); ...
php
{ "resource": "" }
q251222
Comments.writeVMLComments
validation
public function writeVMLComments(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingD...
php
{ "resource": "" }
q251223
Comments.writeVMLComment
validation
private function writeVMLComment(XMLWriter $objWriter, $pCellReference, Comment $pComment) { // Metadata list($column, $row) = Coordinate::coordinateFromString($pCellReference); $column = Coordinate::columnIndexFromString($column); $id = 1024 + $column + $row; $id = substr($i...
php
{ "resource": "" }
q251224
DefaultValueBinder.dataTypeForValue
validation
public static function dataTypeForValue($pValue) { // Match the value against a few data types if ($pValue === null) { return DataType::TYPE_NULL; } elseif ($pValue === '') { return DataType::TYPE_STRING; } elseif ($pValue instanceof RichText) { re...
php
{ "resource": "" }
q251225
Blacklist.fromXML
validation
function fromXML($xmlElement) { if (isset($xmlElement->id)) $this->id = $xmlElement->id; if (isset($xmlElement->name)) $this->name = $xmlElement->name; if (isset($xmlElement->entries)) { $this->entries = array(); foreach ($xmlElement->entries->children() as $entry) {...
php
{ "resource": "" }
q251226
Html.mapVAlign
validation
private function mapVAlign($vAlign) { switch ($vAlign) { case Alignment::VERTICAL_BOTTOM: return 'bottom'; case Alignment::VERTICAL_TOP: return 'top'; case Alignment::VERTICAL_CENTER: case Alignment::VERTICAL_JUSTIFY: ...
php
{ "resource": "" }
q251227
Html.mapHAlign
validation
private function mapHAlign($hAlign) { switch ($hAlign) { case Alignment::HORIZONTAL_GENERAL: return false; case Alignment::HORIZONTAL_LEFT: return 'left'; case Alignment::HORIZONTAL_RIGHT: return 'right'; case Al...
php
{ "resource": "" }
q251228
Html.mapBorderStyle
validation
private function mapBorderStyle($borderStyle) { switch ($borderStyle) { case Border::BORDER_NONE: return 'none'; case Border::BORDER_DASHDOT: return '1px dashed'; case Border::BORDER_DASHDOTDOT: return '1px dotted'; ...
php
{ "resource": "" }
q251229
Html.generateHTMLHeader
validation
public function generateHTMLHeader($pIncludeStyles = false) { // Spreadsheet object known? if ($this->spreadsheet === null) { throw new WriterException('Internal Spreadsheet object not set to an instance of an object.'); } // Construct HTML $properties = $this->s...
php
{ "resource": "" }
q251230
Html.generateNavigation
validation
public function generateNavigation() { // Spreadsheet object known? if ($this->spreadsheet === null) { throw new WriterException('Internal Spreadsheet object not set to an instance of an object.'); } // Fetch sheets $sheets = []; if ($this->sheetIndex ===...
php
{ "resource": "" }
q251231
Html.writeImageInCell
validation
private function writeImageInCell(Worksheet $pSheet, $coordinates) { // Construct HTML $html = ''; // Write images foreach ($pSheet->getDrawingCollection() as $drawing) { if ($drawing instanceof Drawing) { if ($drawing->getCoordinates() == $coordinates) {...
php
{ "resource": "" }
q251232
Html.writeChartInCell
validation
private function writeChartInCell(Worksheet $pSheet, $coordinates) { // Construct HTML $html = ''; // Write charts foreach ($pSheet->getChartCollection() as $chart) { if ($chart instanceof Chart) { $chartCoordinates = $chart->getTopLeftPosition(); ...
php
{ "resource": "" }
q251233
Html.generateStyles
validation
public function generateStyles($generateSurroundingHTML = true) { // Spreadsheet object known? if ($this->spreadsheet === null) { throw new WriterException('Internal Spreadsheet object not set to an instance of an object.'); } // Build CSS $css = $this->buildCSS(...
php
{ "resource": "" }
q251234
Html.createCSSStyle
validation
private function createCSSStyle(Style $pStyle) { // Create CSS $css = array_merge( $this->createCSSStyleAlignment($pStyle->getAlignment()), $this->createCSSStyleBorders($pStyle->getBorders()), $this->createCSSStyleFont($pStyle->getFont()), $this->creat...
php
{ "resource": "" }
q251235
Html.formatColor
validation
public function formatColor($pValue, $pFormat) { // Color information, e.g. [Red] is always at the beginning $color = null; // initialize $matches = []; $color_regex = '/^\\[[a-zA-Z]+\\]/'; if (preg_match($color_regex, $pFormat, $matches)) { $color = str_replace(...
php
{ "resource": "" }
q251236
Html.writeComment
validation
private function writeComment(Worksheet $pSheet, $coordinate) { $result = ''; if (!$this->isPdf && isset($pSheet->getComments()[$coordinate])) { $result .= '<a class="comment-indicator"></a>'; $result .= '<div class="comment">' . nl2br($pSheet->getComment($coordinate)->getTex...
php
{ "resource": "" }
q251237
Csv.checkSeparator
validation
protected function checkSeparator() { $line = fgets($this->fileHandle); if ($line === false) { return; } if ((strlen(trim($line, "\r\n")) == 5) && (stripos($line, 'sep=') === 0)) { $this->delimiter = substr($line, 4, 1); return; } ...
php
{ "resource": "" }
q251238
Csv.inferSeparator
validation
protected function inferSeparator() { if ($this->delimiter !== null) { return; } $potentialDelimiters = [',', ';', "\t", '|', ':', ' ']; $counts = []; foreach ($potentialDelimiters as $delimiter) { $counts[$delimiter] = []; } // Count...
php
{ "resource": "" }
q251239
GridLines.setShadowProperties
validation
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null) { $this->activateObject() ->setShadowPresetsProperties((int) $sh_presets) ->setShadowColor( ...
php
{ "resource": "" }
q251240
GridLines.setShadowColor
validation
private function setShadowColor($color, $alpha, $type) { if ($color !== null) { $this->shadowProperties['color']['value'] = (string) $color; } if ($alpha !== null) { $this->shadowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); } if ($...
php
{ "resource": "" }
q251241
GridLines.setSoftEdgesSize
validation
public function setSoftEdgesSize($size) { if ($size !== null) { $this->activateObject(); $softEdges['size'] = (string) $this->getExcelPointsWidth($size); } }
php
{ "resource": "" }
q251242
DecoratorStack.add
validation
public function add(callable $decorator, $priority = 0) { $this->stack[] = array( 'decorator' => $decorator, 'priority' => $priority, 'index' => $this->index ); $this->index--; uasort($this->stack, array($this, 'compareStackItems')); retur...
php
{ "resource": "" }
q251243
DecoratorStack.apply
validation
public function apply(Tag $tag, Renderer $renderer) { foreach ($this->stack as $item) { $result = $item['decorator']($tag, $renderer); // in case a decorator returns something unexpected if ($result instanceof Tag) { $tag = $result; } else { ...
php
{ "resource": "" }
q251244
Remove.removeRecursive
validation
protected function removeRecursive( $path, $pattern, Logger $logger ) { // Check if source file exists at all. if ( !is_file( $path ) && !is_dir( $path ) ) { $logger->log( "$path is not a valid source.", Logger::WARNING ); return; } // Skip non readab...
php
{ "resource": "" }
q251245
HTTPResponseCodes.getStringFromHTTPStatusCode
validation
static function getStringFromHTTPStatusCode($httpStatusCode) { if (array_key_exists($httpStatusCode, HTTPResponseCodes::$codes) === true) { return HTTPResponseCodes::$codes[$httpStatusCode]; } else { return "unknown error code: " . $httpStatusCode; } }
php
{ "resource": "" }
q251246
Spreadsheet.setRibbonXMLData
validation
public function setRibbonXMLData($target, $xmlData) { if ($target !== null && $xmlData !== null) { $this->ribbonXMLData = ['target' => $target, 'data' => $xmlData]; } else { $this->ribbonXMLData = null; } }
php
{ "resource": "" }
q251247
Spreadsheet.getRibbonXMLData
validation
public function getRibbonXMLData($what = 'all') //we need some constants here... { $returnData = null; $what = strtolower($what); switch ($what) { case 'all': $returnData = $this->ribbonXMLData; break; case 'target': case '...
php
{ "resource": "" }
q251248
Spreadsheet.getRibbonBinObjects
validation
public function getRibbonBinObjects($what = 'all') { $ReturnData = null; $what = strtolower($what); switch ($what) { case 'all': return $this->ribbonBinObjects; break; case 'names': case 'data': if (is_array...
php
{ "resource": "" }
q251249
Spreadsheet.disconnectWorksheets
validation
public function disconnectWorksheets() { $worksheet = null; foreach ($this->workSheetCollection as $k => &$worksheet) { $worksheet->disconnectCells(); $this->workSheetCollection[$k] = null; } unset($worksheet); $this->workSheetCollection = []; }
php
{ "resource": "" }
q251250
Spreadsheet.createSheet
validation
public function createSheet($sheetIndex = null) { $newSheet = new Worksheet($this); $this->addSheet($newSheet, $sheetIndex); return $newSheet; }
php
{ "resource": "" }
q251251
Spreadsheet.addSheet
validation
public function addSheet(Worksheet $pSheet, $iSheetIndex = null) { if ($this->sheetNameExists($pSheet->getTitle())) { throw new Exception( "Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename this worksheet first." ); } if ($iS...
php
{ "resource": "" }
q251252
Spreadsheet.removeSheetByIndex
validation
public function removeSheetByIndex($pIndex) { $numSheets = count($this->workSheetCollection); if ($pIndex > $numSheets - 1) { throw new Exception( "You tried to remove a sheet by the out of bounds index: {$pIndex}. The actual number of sheets is {$numSheets}." ...
php
{ "resource": "" }
q251253
Spreadsheet.getSheet
validation
public function getSheet($pIndex) { if (!isset($this->workSheetCollection[$pIndex])) { $numSheets = $this->getSheetCount(); throw new Exception( "Your requested sheet index: {$pIndex} is out of bounds. The actual number of sheets is {$numSheets}." ); ...
php
{ "resource": "" }
q251254
Spreadsheet.getSheetByName
validation
public function getSheetByName($pName) { $worksheetCount = count($this->workSheetCollection); for ($i = 0; $i < $worksheetCount; ++$i) { if ($this->workSheetCollection[$i]->getTitle() === $pName) { return $this->workSheetCollection[$i]; } } re...
php
{ "resource": "" }
q251255
Spreadsheet.getIndex
validation
public function getIndex(Worksheet $pSheet) { foreach ($this->workSheetCollection as $key => $value) { if ($value->getHashCode() == $pSheet->getHashCode()) { return $key; } } throw new Exception('Sheet does not exist.'); }
php
{ "resource": "" }
q251256
Spreadsheet.setActiveSheetIndexByName
validation
public function setActiveSheetIndexByName($pValue) { if (($worksheet = $this->getSheetByName($pValue)) instanceof Worksheet) { $this->setActiveSheetIndex($this->getIndex($worksheet)); return $worksheet; } throw new Exception('Workbook does not contain sheet:' . $pVa...
php
{ "resource": "" }
q251257
Spreadsheet.addExternalSheet
validation
public function addExternalSheet(Worksheet $pSheet, $iSheetIndex = null) { if ($this->sheetNameExists($pSheet->getTitle())) { throw new Exception("Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename the external sheet first."); } // count how many cellXfs...
php
{ "resource": "" }
q251258
Spreadsheet.addNamedRange
validation
public function addNamedRange(NamedRange $namedRange) { if ($namedRange->getScope() == null) { // global scope $this->namedRanges[$namedRange->getName()] = $namedRange; } else { // local scope $this->namedRanges[$namedRange->getScope()->getTitle() . '!...
php
{ "resource": "" }
q251259
Spreadsheet.removeNamedRange
validation
public function removeNamedRange($namedRange, Worksheet $pSheet = null) { if ($pSheet === null) { if (isset($this->namedRanges[$namedRange])) { unset($this->namedRanges[$namedRange]); } } else { if (isset($this->namedRanges[$pSheet->getTitle() . '!...
php
{ "resource": "" }
q251260
Spreadsheet.addCellXf
validation
public function addCellXf(Style $style) { $this->cellXfCollection[] = $style; $style->setIndex(count($this->cellXfCollection) - 1); }
php
{ "resource": "" }
q251261
Spreadsheet.removeCellXfByIndex
validation
public function removeCellXfByIndex($pIndex) { if ($pIndex > count($this->cellXfCollection) - 1) { throw new Exception('CellXf index is out of bounds.'); } // first remove the cellXf array_splice($this->cellXfCollection, $pIndex, 1); // then update cellXf indexe...
php
{ "resource": "" }
q251262
Spreadsheet.addCellStyleXf
validation
public function addCellStyleXf(Style $pStyle) { $this->cellStyleXfCollection[] = $pStyle; $pStyle->setIndex(count($this->cellStyleXfCollection) - 1); }
php
{ "resource": "" }
q251263
Spreadsheet.removeCellStyleXfByIndex
validation
public function removeCellStyleXfByIndex($pIndex) { if ($pIndex > count($this->cellStyleXfCollection) - 1) { throw new Exception('CellStyleXf index is out of bounds.'); } array_splice($this->cellStyleXfCollection, $pIndex, 1); }
php
{ "resource": "" }
q251264
Functions.flattenArray
validation
public static function flattenArray($array) { if (!is_array($array)) { return (array) $array; } $arrayValues = []; foreach ($array as $value) { if (is_array($value)) { foreach ($value as $val) { if (is_array($val)) { ...
php
{ "resource": "" }
q251265
Functions.flattenArrayIndexed
validation
public static function flattenArrayIndexed($array) { if (!is_array($array)) { return (array) $array; } $arrayValues = []; foreach ($array as $k1 => $value) { if (is_array($value)) { foreach ($value as $k2 => $val) { if (is_...
php
{ "resource": "" }
q251266
ContactsService.getContact
validation
function getContact($contactId, $checksum, $standard_fields = array(), $custom_fields = array(), $ignoreChecksum = false) { $queryParameters = array( 'id' => $contactId, 'checksum' => $checksum, 'standard_field' => $standard_fields, 'ignore_checksum' => ...
php
{ "resource": "" }
q251267
ContactsService.getContacts
validation
function getContacts($page_index = 1, $page_size = 100, $standard_fields = array(), $custom_fields = array()) { $queryParameters = array( 'page_index' => $page_index, 'page_size' => $page_size, 'standard_field' => $standard_fields ); $queryParamet...
php
{ "resource": "" }
q251268
ContactsService.getContactByEmail
validation
function getContactByEmail($email, $standard_fields = array(), $custom_fields = array()) { $queryParameters = array( 'standard_field' => $standard_fields ); $queryParameters = $this->appendArrayFields($queryParameters, 'custom_field', $custom_fields); return $th...
php
{ "resource": "" }
q251269
ContactsService.getContactsByExternalId
validation
function getContactsByExternalId($externalId, $standard_fields = array(), $custom_fields = array()) { $queryParameters = array( 'standard_field' => $standard_fields ); $queryParameters = $this->appendArrayFields($queryParameters, 'custom_field', $custom_fields); ...
php
{ "resource": "" }
q251270
ContactsService.getContactsByFilterId
validation
function getContactsByFilterId($filterId, $page_index = 1, $page_size = 100, $standard_fields = array(), $custom_fields = array()) { $queryParameters = array( 'page_index' => $page_index, 'page_size' => $page_size, 'standard_field' => $standard_fields ); ...
php
{ "resource": "" }
q251271
ContactsService.updateContact
validation
function updateContact($contact, $checksum = "", $src = null, $subscriptionPage = null, $triggerDoi = FALSE, $doiMailingKey = null, $ignoreChecksum = false) { $queryParameters = array( 'id' => $contact->id, 'checksum' => $checksum, 'triggerdoi' => ($triggerDoi == TRU...
php
{ "resource": "" }
q251272
ContactsService.synchronizeContacts
validation
function synchronizeContacts($contacts, $permission = null, $syncMode = null, $useExternalId = false, $ignoreInvalidContacts = false, $reimportUnsubscribedContacts = true, $overridePermission = true, $updateOnly = false, $preferMaileonId = false) { $queryParameters = array( 'permission' => ($...
php
{ "resource": "" }
q251273
ContactsService.unsubscribeContactByEmail
validation
function unsubscribeContactByEmail($email, $mailingId = "", $reasons = null) { $queryParameters = array(); if (!empty($mailingId)) { $queryParameters['mailingId'] = $mailingId; } if (!empty($reasons)) { if (is_array($reasons)) { $quer...
php
{ "resource": "" }
q251274
ContactsService.addUnsubscriptionReasonsToUnsubscribedContact
validation
function addUnsubscriptionReasonsToUnsubscribedContact($id, $checksum = null, $reasons = null, $ignore_checksum = false) { $queryParameters = array(); $queryParameters['id'] = $id; if (!empty($checksum)) { $queryParameters['checksum'] = $checksum; } if ($ig...
php
{ "resource": "" }
q251275
ContactsService.unsubscribeContactById
validation
function unsubscribeContactById($id, $mailingId = "", $reasons = null) { $queryParameters = array( 'id' => $id ); if (!empty($mailingId)) { $queryParameters['mailingId'] = $mailingId; } if (!empty($reasons)) { if (is_array($reaso...
php
{ "resource": "" }
q251276
ContactsService.unsubscribeContactByExternalId
validation
function unsubscribeContactByExternalId($externalId, $mailingId = "", $reasons = null) { $queryParameters = array(); if (!empty($mailingId)) { $queryParameters['mailingId'] = $mailingId; } if (!empty($reasons)) { if (is_array($reasons)) { ...
php
{ "resource": "" }
q251277
ContactsService.getBlockedContacts
validation
function getBlockedContacts($standardFields = array(), $customFields = array(), $pageIndex = 1, $pageSize = 1000) { $queryParameters = array( 'standard_field' => $standardFields, 'page_index' => $pageIndex, 'page_size' => $pageSize ); $queryParame...
php
{ "resource": "" }
q251278
ContactsService.createCustomField
validation
function createCustomField($name, $type = 'string') { $queryParameters = array('type' => $type); $encodedName = urlencode(mb_convert_encoding($name, "UTF-8")); return $this->post("contacts/fields/custom/${encodedName}", "", $queryParameters); }
php
{ "resource": "" }
q251279
ContactsService.renameCustomField
validation
function renameCustomField($oldName, $newName) { $encodedOldName = urlencode(mb_convert_encoding($oldName, "UTF-8")); $encodedNewName = urlencode(mb_convert_encoding($newName, "UTF-8")); return $this->put("contacts/fields/custom/${encodedOldName}/${encodedNewName}"); }
php
{ "resource": "" }
q251280
Xml.trySimpleXMLLoadString
validation
public function trySimpleXMLLoadString($pFilename) { try { $xml = simplexml_load_string( $this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() ); } catch (\Exception $e) { ...
php
{ "resource": "" }
q251281
Xml.load
validation
public function load($pFilename) { // Create new Spreadsheet $spreadsheet = new Spreadsheet(); $spreadsheet->removeSheetByIndex(0); // Load into this instance return $this->loadIntoExisting($pFilename, $spreadsheet); }
php
{ "resource": "" }
q251282
Rule.toString
validation
function toString() { return "Rule [isCustomfield=" . ($this->isCustomfield) ? "true" : "false" . ", field=" . $this->field . ", operator=" . $this->operator . ", value=" . $this->value . " (type = " . $this->type . ")"; }
php
{ "resource": "" }
q251283
StoragePluginManager.validatePlugin
validation
public function validatePlugin($plugin) { if ($plugin instanceof Storage\StorageInterface) { return; } throw new Storage\Exception\RuntimeException(sprintf('Plugin of type %s is invalid; must implement %s\Storage\StorageInterfaceInterface', (is_object($plugin) ? get_class($plugin) :...
php
{ "resource": "" }
q251284
PieceBag.offsetSet
validation
public function offsetSet($key, $value) { if(!($value instanceof PieceInterface)) { $value = new Piece($value); } parent::offsetSet($key, $value); }
php
{ "resource": "" }
q251285
FormItemFactory.createSelectAssociationFormItem
validation
private function createSelectAssociationFormItem(Model $model, Column $column, $item) { $result = new SelectFormItem(); $relations = $this->aujaConfigurator->getRelationsForModel($model); $relatedModel = null; foreach ($relations as $relation) { $rightModel = $relation->getR...
php
{ "resource": "" }
q251286
FormItemFactory.createFromType
validation
private function createFromType(Model $model, Column $column, $item) { $result = null; switch ($column->getType()) { case Type::TEXT: case Type::TARRAY: case Type::SIMPLE_ARRAY: case Type::JSON_ARRAY: case Type::OBJECT: case Type::B...
php
{ "resource": "" }
q251287
ContactReference.isEmpty
validation
function isEmpty() { $result = !isset($this->id) && !isset($this->external_id) && !isset($this->email); return $result; }
php
{ "resource": "" }
q251288
Copy.copyRecursive
validation
protected function copyRecursive( $src, $dst, $depth, Logger $logger ) { if ( $depth == 0 ) { return; } // Check if source file exists at all. if ( !is_file( $src ) && !is_dir( $src ) ) { $logger->log( "$src is not a valid source.", Logger::WA...
php
{ "resource": "" }
q251289
Theme.getColourByIndex
validation
public function getColourByIndex($index) { if (isset($this->colourMap[$index])) { return $this->colourMap[$index]; } return null; }
php
{ "resource": "" }
q251290
JSONSerializer.toArray
validation
private static function toArray($object) { $type = gettype($object); if($type == 'array') { foreach($object as $element) { // call this method on each object in the array $result[]= self::toArray($element); } ...
php
{ "resource": "" }
q251291
ConfigResolver.resolve
validation
public function resolve() { if (is_null($this->config->getDisplayField()) || $this->config->getDisplayField() == '') { $this->config->setDisplayField($this->resolveDisplayField()); $this->config->setVisibleFields($this->resolveVisibleFields()); } return $this->config; ...
php
{ "resource": "" }
q251292
ConfigResolver.resolveVisibleFields
validation
private function resolveVisibleFields() { $result = []; $columns = $this->model->getColumns(); foreach($columns as $column){ $result[] = $column->getName(); } return $result; }
php
{ "resource": "" }
q251293
FakerGenerator.resolvePath
validation
private function resolvePath($path_alias, $file_name) { $path = \Yii::getAlias($path_alias, false); $path = $path ? realpath($path) : $path; $file_name = !preg_match('/\.php$/i', $file_name) ? $file_name . '.php' : $file_name; if (!$path || !is_dir($path) || !file_exists($path . '/'...
php
{ "resource": "" }
q251294
DataSeriesValues.setDataType
validation
public function setDataType($dataType) { if (!in_array($dataType, self::$dataTypeValues)) { throw new Exception('Invalid datatype for chart data series values'); } $this->dataType = $dataType; return $this; }
php
{ "resource": "" }
q251295
DataSeriesValues.setDataValues
validation
public function setDataValues($dataValues) { $this->dataValues = Functions::flattenArray($dataValues); $this->pointCount = count($dataValues); return $this; }
php
{ "resource": "" }
q251296
Stack.push
validation
public function push($type, $value, $reference = null) { $this->stack[$this->count++] = [ 'type' => $type, 'value' => $value, 'reference' => $reference, ]; if ($type == 'Function') { $localeFunction = Calculation::localeFunc($value); ...
php
{ "resource": "" }
q251297
MemoryCacheItemPool.getItem
validation
public function getItem($key) { if ($this->hasItem($key) !== true) { $this->data[$key] = new CacheItem($key, null, false); } return $this->data[$key]; }
php
{ "resource": "" }
q251298
MemoryCacheItemPool.hasItem
validation
public function hasItem($key) { if (isset($this->data[$key])) { /* @var $item \Psr6NullCache\CacheItem */ $item = $this->data[$key]; if ($item->isHit() === true && ($item->getExpires() === null || $item->getExpires() > new DateTime())) { ...
php
{ "resource": "" }
q251299
MemoryCacheItemPool.save
validation
public function save(CacheItemInterface $item) { $item->setIsHit(true); $this->data[$item->getKey()] = $item; return true; }
php
{ "resource": "" }