_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q258400
AbstractSubject.getRootCategory
test
public function getRootCategory() { // load the actual store view code $storeViewCode = $this->getStoreViewCode($this->getDefaultStoreViewCode()); // query weather or not we've a root category or not if (isset($this->rootCategories[$storeViewCode])) { return $this->root...
php
{ "resource": "" }
q258401
AbstractSubject.resolveOriginalColumnName
test
public function resolveOriginalColumnName($columnName) { // try to load the original data $originalData = $this->getOriginalData(); // query whether or not original data is available if (isset($originalData[ColumnKeys::ORIGINAL_COLUMN_NAMES])) { // query whether or not ...
php
{ "resource": "" }
q258402
AbstractSubject.getOriginalData
test
public function getOriginalData() { // initialize the array for the original data $originalData = array(); // query whether or not the column contains original data if ($this->hasOriginalData()) { // unerialize the original data from the column $originalData...
php
{ "resource": "" }
q258403
AbstractSubject.hasOriginalData
test
public function hasOriginalData() { return isset($this->headers[ColumnKeys::ORIGINAL_DATA]) && isset($this->row[$this->headers[ColumnKeys::ORIGINAL_DATA]]); }
php
{ "resource": "" }
q258404
AbstractSubject.wrapException
test
public function wrapException( array $columnNames = array(), \Exception $parent = null, $className = '\TechDivision\Import\Exceptions\WrappedColumnException' ) { // initialize the message $message = $parent->getMessage(); // query whether or not has been a result of...
php
{ "resource": "" }
q258405
AbstractSubject.appendExceptionSuffix
test
public function appendExceptionSuffix($message = null, $filename = null, $lineNumber = null) { // query whether or not a filename has been passed if ($filename === null) { $filename = $this->getFilename(); } // query whether or not a line number has been passed ...
php
{ "resource": "" }
q258406
FileUploadTrait.getNewFileName
test
public function getNewFileName($targetFilename) { // load the file information $fileInfo = pathinfo($targetFilename); // query whether or not, the file exists if ($this->getFilesystemAdapter()->isFile($targetFilename)) { // initialize the incex and the basename ...
php
{ "resource": "" }
q258407
FileUploadTrait.uploadFile
test
public function uploadFile($filename) { // trim the leading /, if available $trimmedFilename = ltrim($filename, '/'); $mediaDir = ltrim($this->getMediaDir(), '/'); $imagesFileDir = ltrim($this->getImagesFileDir(), '/'); // prepare source/target filename $sourceFilen...
php
{ "resource": "" }
q258408
FileUploadTrait.deleteFile
test
public function deleteFile($filename) { // trim the leading /, if available $trimmedFilename = ltrim($filename, '/'); $mediaDir = ltrim($this->getMediaDir(), '/'); // prepare source/target filename $targetFilename = sprintf('%s/%s', $mediaDir, $trimmedFilename); //...
php
{ "resource": "" }
q258409
EavEntityTypeRepository.findAll
test
public function findAll() { // initialize the array for the EAV entity types $eavEntityTypes = array(); // try to load the EAV entity types $this->eavEntityTypeStmt->execute(); // load the available EAV entity types $availableEntityTypes = $this->eavEntityTypeStmt-...
php
{ "resource": "" }
q258410
EavEntityTypeRepository.findOneByEntityTypeCode
test
public function findOneByEntityTypeCode($entityTypeCode) { // load and return the EAV attribute with the passed params $this->eavEntityTypeByEntityTypeACodeStmt->execute(array(MemberNames::ENTITY_TYPE_CODE => $entityTypeCode)); return $this->eavEntityTypeByEntityTypeACodeStmt->fetch(\PDO::FE...
php
{ "resource": "" }
q258411
ValueCsvSerializer.serialize
test
public function serialize(array $unserialized = null) { // do nothing, if the passed value is empty or NULL if ($unserialized === null || $unserialized === '') { return; } // load the global configuration $configuration = $this->getConfiguration(); // i...
php
{ "resource": "" }
q258412
ValueCsvSerializer.unserialize
test
public function unserialize($serialized = null) { // do nothing, if the passed value is empty or NULL if ($serialized === null || $serialized === '') { return; } // load the global configuration $configuration = $this->getConfiguration(); // initializet...
php
{ "resource": "" }
q258413
MissingOptionValuesPlugin.getTargetDir
test
protected function getTargetDir() { // load the actual status $status = $this->getRegistryProcessor()->getAttribute($this->getSerial()); // query whether or not the configured source directory is available if (!is_dir($sourceDir = $status[RegistryKeys::SOURCE_DIRECTORY])) { ...
php
{ "resource": "" }
q258414
ExportConfigFactory.createExportConfig
test
public function createExportConfig() { // initialize the lexer configuration $config = new ExporterConfig(); // query whether or not a delimiter character has been configured if ($delimiter = $this->configuration->getDelimiter()) { $config->setDelimiter($delimiter); ...
php
{ "resource": "" }
q258415
AdditionalAttributeCsvSerializer.init
test
public function init(CsvConfigurationInterface $configuration) { // pass the configuration to the parent instance parent::init($configuration); // create the CSV value serializer instance $this->setValueCsvSerializer($this->getValueCsvSerializerFactory()->createSerializer($configur...
php
{ "resource": "" }
q258416
AdditionalAttributeCsvSerializer.unserialize
test
public function unserialize($serialized = null) { // initialize the array for the unserialized additional attributes $attributes = array(); // explode the additional attributes if ($additionalAttributes = $this->explode($serialized)) { // iterate over the attributes and...
php
{ "resource": "" }
q258417
AdditionalAttributeCsvSerializer.serialize
test
public function serialize(array $unserialized = null) { // initialize the array $attributes = array(); if (is_array($unserialized)) { // serialize the key/value pairs into the array foreach ($unserialized as $attributeCode => $attributeValue) { $attr...
php
{ "resource": "" }
q258418
AbstractBaseProcessor.getPreparedStatement
test
protected function getPreparedStatement($name = null) { // try to load the prepared statement, or use the default one if (isset($this->preparedStatements[$name])) { return $this->preparedStatements[$name]; } // return the first (default) prepared statement retur...
php
{ "resource": "" }
q258419
AbstractBaseProcessor.init
test
public function init() { // load the statements $statements = $this->getStatements(); foreach ($statements as $name => $statement) { $this->addPreparedStatement($name, $this->getConnection()->prepare($statement)); } }
php
{ "resource": "" }
q258420
AdditionalAttributeObserver.parseAdditionaAttributes
test
protected function parseAdditionaAttributes($additionalAttributes) { // load the global configuration $configuration = $this->getSubject()->getConfiguration()->getConfiguration(); // initializet delimiter, enclosure and escape char $delimiter = $configuration->getDelimiter(); ...
php
{ "resource": "" }
q258421
CoreConfigDataUidGenerator.generate
test
public function generate(array $entity) { // load the data to generate the entity with $path = $entity[MemberNames::PATH]; $scope = $entity[MemberNames::SCOPE]; $scopeId = $entity[MemberNames::SCOPE_ID]; // generate and return the entity return sprintf('%s/%s/%s', $...
php
{ "resource": "" }
q258422
AbstractCachedRepository.resolveReference
test
protected function resolveReference($from) { // query whether or not a reference exists if (isset($this->references[$from])) { return $this->references[$from]; } // return the passed reference return $from; }
php
{ "resource": "" }
q258423
AbstractCachedRepository.toCache
test
public function toCache($cacheKey, $value, array $references = array()) { // add the value to the cache $this->cache[$cacheKey] = $value; // also register the references if given foreach ($references as $from => $to) { $this->references[$from] = $to; } }
php
{ "resource": "" }
q258424
AbstractCachedRepository.fromCache
test
public function fromCache($cacheKey) { // query whether or not a value for the cache key is available if (isset($this->cache[$resolvedCacheKey = $this->resolveReference($cacheKey)])) { return $this->cache[$resolvedCacheKey]; } // throw an exception if not throw ...
php
{ "resource": "" }
q258425
AbstractCachedRepository.flushCache
test
public function flushCache($cacheKey = null) { // flush the complete cache, if NO cache key has been passed if ($cacheKey === null) { $this->references = $this->cache = array(); return; } // only flush the value with the passed cache key if (isset($t...
php
{ "resource": "" }
q258426
EavAttributeSetRepository.load
test
public function load($id) { // execute the prepared statement and return the EAV attribute set with the passed ID $this->eavAttributeSetStmt->execute(array($id)); return $this->eavAttributeSetStmt->fetch(\PDO::FETCH_ASSOC); }
php
{ "resource": "" }
q258427
EavAttributeSetRepository.findAllByEntityTypeId
test
public function findAllByEntityTypeId($entityTypeId) { // initialize the array for the attribute sets $eavAttributeSets = array(); // load the attributes $this->eavAttributeSetsByEntityTypeIdStmt->execute(array($entityTypeId)); // load the available EAV attribute sets ...
php
{ "resource": "" }
q258428
EavAttributeSetRepository.findOneByEntityTypeIdAndAttributeSetName
test
public function findOneByEntityTypeIdAndAttributeSetName($entityTypeId, $attributeSetName) { // initialize the params $params = array( MemberNames::ENTITY_TYPE_ID => $entityTypeId, MemberNames::ATTRIBUTE_SET_NAME => $attributeSetName ); // load and retur...
php
{ "resource": "" }
q258429
EavAttributeSetRepository.findOneByEntityTypeCodeAndAttributeSetName
test
public function findOneByEntityTypeCodeAndAttributeSetName($entityTypeCode, $attributeSetName) { // initialize the params $params = array( MemberNames::ENTITY_TYPE_CODE => $entityTypeCode, MemberNames::ATTRIBUTE_SET_NAME => $attributeSetName ); // load and...
php
{ "resource": "" }
q258430
CsvExportAdapterFactory.createExportAdapter
test
public function createExportAdapter(SubjectConfigurationInterface $subjectConfiguration) { // load the export adapter configuration $exportAdapterConfiguration = $subjectConfiguration->getExportAdapter(); // load the serializer factory instance $serializerFactory = $this->container...
php
{ "resource": "" }
q258431
PDOConnectionWrapper.quote
test
public function quote($string, $parameterType = \PDO::PARAM_STR) { return $this->connection->quote($string, $parameterType); }
php
{ "resource": "" }
q258432
UrlRewriteRepository.findAllByEntityTypeAndEntityId
test
public function findAllByEntityTypeAndEntityId($entityType, $entityId) { // initialize the params $params = array( MemberNames::ENTITY_TYPE => $entityType, MemberNames::ENTITY_ID => $entityId ); // load and return the URL rewrites $this->urlRewrite...
php
{ "resource": "" }
q258433
UrlRewriteRepository.findAllByEntityTypeAndEntityIdAndStoreId
test
public function findAllByEntityTypeAndEntityIdAndStoreId($entityType, $entityId, $storeId) { // initialize the params $params = array( MemberNames::ENTITY_TYPE => $entityType, MemberNames::ENTITY_ID => $entityId, MemberNames::STORE_ID => $storeId ); ...
php
{ "resource": "" }
q258434
Interpreter.notify
test
private function notify(array $row) { // make the observers local $observers = $this->observers; // invoke the observers on the passed line foreach ($observers as $observer) { $this->delegate($observer, $row); } }
php
{ "resource": "" }
q258435
Interpreter.checkRowConsistency
test
private function checkRowConsistency(array $row) { // query whether or not strict mode is enabled if ($this->isNotStrict()) { return; } // count the number of columns $current = count($row); // if the row consistency has not been set, set it if ...
php
{ "resource": "" }
q258436
RowTrait.hasValue
test
public function hasValue($name) { // query whether or not the header is available if ($this->hasHeader($name)) { // load the key for the row $headerValue = $this->getHeader($name); // query whether the rows column has a vaild value return (isset($thi...
php
{ "resource": "" }
q258437
SubjectFactory.createSubject
test
public function createSubject(SubjectConfigurationInterface $subjectConfiguration) { // load the subject instance from the DI container and set the subject configuration $subjectInstance = $this->container->get($subjectConfiguration->getId()); $subjectInstance->setConfiguration($subjectConf...
php
{ "resource": "" }
q258438
AdditionalAttributeCsvSerializerFactory.createSerializer
test
public function createSerializer(CsvConfigurationInterface $configuration) { // load the serializer instance from the container and pass the configuration /** @var \TechDivision\Import\Serializers\ConfigurationAwareSerializerInterface $serializer */ $serializer = $this->container->get(Depen...
php
{ "resource": "" }
q258439
EavAttributeRepository.findAllByEntityTypeIdAndAttributeSetName
test
public function findAllByEntityTypeIdAndAttributeSetName($entityTypeId, $attributeSetName) { // initialize the params $params = array( MemberNames::ENTITY_TYPE_ID => $entityTypeId, MemberNames::ATTRIBUTE_SET_NAME => $attributeSetName ); // initialize the...
php
{ "resource": "" }
q258440
EavAttributeRepository.findAllByOptionValueAndStoreId
test
public function findAllByOptionValueAndStoreId($optionValue, $storeId) { // initialize the params $params = array( MemberNames::VALUE => $optionValue, MemberNames::STORE_ID => $storeId ); // execute the prepared statement and return the array with the EAV...
php
{ "resource": "" }
q258441
EavAttributeRepository.findAllByIsUserDefined
test
public function findAllByIsUserDefined($isUserDefined = 1) { // initialize the array for the EAV attributes $eavAttributes = array(); // initialize the params $params = array(MemberNames::ID_USER_DEFINED => $isUserDefined); // execute the prepared statement and return the ...
php
{ "resource": "" }
q258442
EavAttributeRepository.findAllByEntityTypeIdAndIsUserDefined
test
public function findAllByEntityTypeIdAndIsUserDefined($entityTypeId, $isUserDefined = 1) { // initialize the array for the EAV attributes $eavAttributes = array(); // initialize the params $params = array( MemberNames::ENTITY_TYPE_ID => $entityTypeId, Membe...
php
{ "resource": "" }
q258443
EavAttributeRepository.findAllByEntityTypeId
test
public function findAllByEntityTypeId($entityTypeId) { // initialize the array for the EAV attributes $eavAttributes = array(); // execute the prepared statement and return the array with the EAV attributes $this->eavAttributesByEntityTypeIdAndUserDefinedStmt->execute(array(MemberN...
php
{ "resource": "" }
q258444
EavAttributeRepository.findOneByOptionValueAndStoreId
test
public function findOneByOptionValueAndStoreId($optionValue, $storeId) { // execute the prepared statement and return the array with the fail EAV attributes if (sizeof($eavAttributes = $this->findAllByOptionValueAndStoreId($optionValue, $storeId)) > 0) { return reset($eavAttributes); ...
php
{ "resource": "" }
q258445
ObserverVisitor.prepareObservers
test
protected function prepareObservers(SubjectInterface $subject, array $observers, $type = null) { // iterate over the array with observers and prepare them foreach ($observers as $key => $observer) { // we have to initialize the type only on the first level if ($type == null)...
php
{ "resource": "" }
q258446
FilesystemTrait.resolvePath
test
public function resolvePath($path) { // if we've an absolute path, return it immediately if ($this->getFilesystemAdapter()->isDir($path)) { return $path; } // temporarily save the path $originalPath = $path; // try to prepend the actual working director...
php
{ "resource": "" }
q258447
FilesystemTrait.mkdir
test
public function mkdir($pathname, $mode = 0700, $recursive = false) { return $this->getFilesystemAdapter()->mkdir($pathname, $mode, $recursive); }
php
{ "resource": "" }
q258448
RegistryProcessor.setAttribute
test
public function setAttribute($key, $value) { // query whether or not the key has already been used if (isset($this->attributes[$key])) { throw new \Exception(sprintf('Try to override data with key %s', $key)); } // set the attribute in the registry $this->attrib...
php
{ "resource": "" }
q258449
RegistryProcessor.raiseCounter
test
public function raiseCounter($key, $counterName) { // raise/initialize the value if (isset($this->attributes[$key][$counterName])) { $this->attributes[$key][$counterName]++; } else { $this->attributes[$key][$counterName] = 1; } // return the new valu...
php
{ "resource": "" }
q258450
RegistryProcessor.mergeAttributesRecursive
test
public function mergeAttributesRecursive($key, array $attributes) { // if the key not exists, simply add the new attributes if (!isset($this->attributes[$key])) { $this->attributes[$key] = $attributes; return; } // if the key exists and the value is an array...
php
{ "resource": "" }
q258451
LeagueFilesystemAdapterFactory.createFilesystemAdapter
test
public function createFilesystemAdapter(SubjectConfigurationInterface $subjectConfiguration) { // the filesystem adapter configuration $filesystemAdapterConfiguration = $subjectConfiguration->getFilesystemAdapter(); // load the filesystem adapter's adapter configuration (FS specific) ...
php
{ "resource": "" }
q258452
CategoryRepository.findAllByStoreView
test
public function findAllByStoreView($storeViewId) { // try to load the categories and return them $this->categoriesByStoreViewStmt->execute(array(MemberNames::STORE_ID => $storeViewId)); return $this->categoriesByStoreViewStmt->fetchAll(\PDO::FETCH_ASSOC); }
php
{ "resource": "" }
q258453
CategoryRepository.findAllRootCategories
test
public function findAllRootCategories() { // try to load the categories $this->rootCategoriesStmt->execute(); // initialize the array with the store code as key $rootCategories = array(); // load the available root categories $availableRootCategories = $this->rootC...
php
{ "resource": "" }
q258454
EmitterFactory.createEmitter
test
public function createEmitter() { // initialize the event emitter $emitter = new Emitter(); // load the listener configuration from the configuration $availableListeners = $this->configuration->getListeners(); // load, initialize and add the configured listeners to the emi...
php
{ "resource": "" }
q258455
EmitterFactory.prepareListeners
test
protected function prepareListeners(EmitterInterface $emitter, array $listeners, $eventName = null) { // iterate over the array with listeners and prepare them foreach ($listeners as $key => $listener) { // we have to initialize the event name only on the first level if ($ev...
php
{ "resource": "" }
q258456
AbstractPlugin.removeDir
test
protected function removeDir($src) { // open the directory $dir = opendir($src); // remove files/folders recursively while (false !== ($file = readdir($dir))) { if (($file != '.') && ($file != '..')) { $full = $src . '/' . $file; if (is_d...
php
{ "resource": "" }
q258457
AbstractPlugin.getSwiftMailer
test
protected function getSwiftMailer() { // the swift mailer configuration if ($swiftMailerConfiguration = $this->getPluginConfiguration()->getSwiftMailer()) { // load the factory that creates the swift mailer instance $factory = $swiftMailerConfiguration->getFactory(); ...
php
{ "resource": "" }
q258458
AbstractFileResolver.initialize
test
protected function initialize($serial) { // load the actual status $status = $this->getRegistryProcessor()->getAttribute($serial); // query whether or not the configured source directory is available if (!is_dir($sourceDir = $status[RegistryKeys::SOURCE_DIRECTORY])) { t...
php
{ "resource": "" }
q258459
AbstractFileResolver.loadFiles
test
public function loadFiles($serial) { // clear the filecache clearstatcache(); // initialize the resolver $this->initialize($serial); // initialize the array with the files matching the suffix found in the source directory $files = glob(sprintf('%s/*.%s', $this->get...
php
{ "resource": "" }
q258460
UrlRewriteDeleteProcessor.getStatements
test
protected function getStatements() { return array( SqlStatementKeys::DELETE_URL_REWRITE => $this->loadStatement(SqlStatementKeys::DELETE_URL_REWRITE), SqlStatementKeys::DELETE_URL_REWRITE_BY_SKU => $this->loadStatement(SqlStatementKeys::DELETE_URL_REWRITE_BY_SKU), SqlStat...
php
{ "resource": "" }
q258461
CsvImportAdapterFactory.createImportAdapter
test
public function createImportAdapter(SubjectConfigurationInterface $subjectConfiguration) { // load the import adapter configuration $importAdapterConfiguration = $subjectConfiguration->getImportAdapter(); // load the serializer factory instance $serializerFactory = $this->container...
php
{ "resource": "" }
q258462
CallbackVisitor.prepareCallbacks
test
protected function prepareCallbacks(SubjectInterface $subject, array $callbacks, $type = null) { // iterate over the array with callbacks and prepare them foreach ($callbacks as $key => $callback) { // we have to initialize the type only on the first level if ($type == null)...
php
{ "resource": "" }
q258463
ImportProcessor.getGlobalData
test
public function getGlobalData() { // initialize the array for the global data $globalData = array(); // initialize the global data $globalData[RegistryKeys::STORES] = $this->getStores(); $globalData[RegistryKeys::LINK_TYPES] = $this->getLinkTypes(); $globalData[Regi...
php
{ "resource": "" }
q258464
AbstractSqlStatementRepository.load
test
public function load($id) { // try to find the SQL statement with the passed key if (isset($this->preparedStatements[$id])) { return $this->preparedStatements[$id]; } // throw an exception if NOT available throw new \Exception(sprintf('Can\'t find SQL statement ...
php
{ "resource": "" }
q258465
DateConverterFactory.createDateConverter
test
public function createDateConverter(SubjectConfigurationInterface $subject) { // create a new date converter instance for the subject with the passed configuration $dateConverter = $this->container->get($subject->getDateConverter()->getId()); $dateConverter->setSubjectConfiguration($subject...
php
{ "resource": "" }
q258466
ExportableTrait.overrideArtefacts
test
protected function overrideArtefacts($type, array $artefacts) { foreach ($artefacts as $key => $artefact) { $this->artefacs[$type][$this->getLastEntityId()][$key] = $artefact; } }
php
{ "resource": "" }
q258467
ExportableTrait.appendArtefacts
test
protected function appendArtefacts($type, array $artefacts) { foreach ($artefacts as $artefact) { $this->artefacs[$type][$this->getLastEntityId()][] = $artefact; } }
php
{ "resource": "" }
q258468
ExportableTrait.getArtefactsByTypeAndEntityId
test
public function getArtefactsByTypeAndEntityId($type, $entityId) { // query whether or not, artefacts for the passed params are available if (isset($this->artefacs[$type][$entityId])) { // load the artefacts $artefacts = $this->artefacs[$type][$entityId]; // unse...
php
{ "resource": "" }
q258469
ExportableTrait.newArtefact
test
public function newArtefact(array $columns, array $originalColumnNames = array()) { // initialize the original data and the artefact $artefact = array(); $originalData = array(); // query whether or not, we've original columns if (sizeof($originalColumnNames) > 0) { ...
php
{ "resource": "" }
q258470
ExportableTrait.export
test
public function export($timestamp, $counter) { $this->getExportAdapter()->export($this->getArtefacts(), $this->getTargetDir(), $timestamp, $counter); }
php
{ "resource": "" }
q258471
LinkTypeRepository.findAll
test
public function findAll() { // query whether or not we've already loaded the value if (!isset($this->cache[__METHOD__])) { // try to load the link types $this->linkTypeStmt->execute(); // initialize the array for the link types $linkTypes = array(); ...
php
{ "resource": "" }
q258472
ImageTypeRepository.findAll
test
public function findAll() { // initialize the result array $result = array(); // load and the image types from the EAV attribute table $this->imageTypesByEntityTypeCodeAndFrontendInputStmt->execute(); // fetch the image types with the passed parameters if ($imageTy...
php
{ "resource": "" }
q258473
SimpleDateConverter.convert
test
public function convert($date) { // create a DateTime instance from the passed value if ($dateTime = \DateTime::createFromFormat($this->getDateConverterConfiguration()->getSourceDateFormat(), $date)) { return $dateTime->format('Y-m-d H:i:s'); } // return NULL, if the pa...
php
{ "resource": "" }
q258474
SimpleNumberConverter.convert
test
public function convert($number) { // initialize the formatter instance with the source locale $formatter = \NumberFormatter::create($this->getNumberConverterConfiguration()->getLocale(), \NumberFormatter::DECIMAL); // parse, format and return the value return $this->getFormatter()...
php
{ "resource": "" }
q258475
SubjectExecutor.execute
test
public function execute(SubjectConfigurationInterface $subject, array $matches, $serial, $pathname) { // initialize the subject and import the bunch $subjectInstance = $this->subjectFactory->createSubject($subject); try { // setup the subject instance $subjectInstan...
php
{ "resource": "" }
q258476
SimpleFileResolver.getPatternKeys
test
protected function getPatternKeys() { // load the pattern keys from the configuration $patternKeys = $this->getPatternElements(); // make sure that they are all lowercase array_walk($patternKeys, function (&$value) { $value = strtolower($value); }); // ...
php
{ "resource": "" }
q258477
SimpleFileResolver.resolvePatternValues
test
protected function resolvePatternValues() { // initialize the array $elements = array(); // load the pattern keys $patternKeys = $this->getPatternKeys(); // prepare the pattern values foreach ($patternKeys as $element) { $elements[] = sprintf('(?<%s>%s)...
php
{ "resource": "" }
q258478
SimpleFileResolver.resolvePatternValue
test
protected function resolvePatternValue($element) { // query whether or not matches has been found OR the counter element has been passed if ($this->countMatches() === 0 || BunchKeys::COUNTER === $element) { // prepare the method name for the callback to load the pattern value with ...
php
{ "resource": "" }
q258479
SimpleFileResolver.preparePattern
test
protected function preparePattern() { return sprintf($this->getRegex(), implode($this->getElementSeparator(), $this->resolvePatternValues()), $this->getSuffix()); }
php
{ "resource": "" }
q258480
SimpleFileResolver.prepareOkFilename
test
protected function prepareOkFilename(array $parts) { return sprintf('%s/%s.%s', $this->getSourceDir(), implode($this->getElementSeparator(), $parts), $this->getOkFileSuffix()); }
php
{ "resource": "" }
q258481
SimpleFileResolver.isEqualFilename
test
protected function isEqualFilename($filename1, $filename2) { return $this->stripSuffix($filename1, $this->getSuffix()) === $this->stripSuffix($filename2, $this->getOkFileSuffix()); }
php
{ "resource": "" }
q258482
SimpleFileResolver.getOkFilenames
test
protected function getOkFilenames() { // initialize the array for the available okFilenames $okFilenames = array(); // prepare the OK filenames based on the found CSV file information for ($i = 1; $i <= sizeof($patternKeys = $this->getPatternKeys()); $i++) { // intializ...
php
{ "resource": "" }
q258483
SimpleFileResolver.shouldBeHandled
test
public function shouldBeHandled($filename) { // initialize the array with the matches $matches = array(); // update the matches, if the pattern matches if ($result = preg_match($this->preparePattern(), $filename, $matches)) { foreach ($matches as $name => $match) { ...
php
{ "resource": "" }
q258484
SimpleFileResolver.cleanUpOkFile
test
public function cleanUpOkFile($filename) { // query whether or not the subject needs an OK file, if yes remove the filename from the file if ($this->getSubjectConfiguration()->isOkFileNeeded() === false) { return; } try { // try to load the expected OK filen...
php
{ "resource": "" }
q258485
TaxClassRepository.findAll
test
public function findAll() { // initialize the array with the available tax classes $taxClasses = array(); // execute the prepared statement $this->taxClassesStmt->execute(); // load the available tax classes $availableTaxClasses = $this->taxClassesStmt->fetchAll();...
php
{ "resource": "" }
q258486
EavAttributeOptionValueCacheWarmer.warm
test
public function warm() { // load the available EAV attribute option values $eavAttributeOptionValues = $this->repository->findAll(); // prepare the caches for the statements foreach ($eavAttributeOptionValues as $eavAttributeOptionValue) { // prepare the cache key and a...
php
{ "resource": "" }
q258487
StoreWebsiteRepository.findAll
test
public function findAll() { // initialize the array with the available store websites $storeWebsites = array(); // execute the prepared statement $this->storeWebsitesStmt->execute(); // load the available store websites $availableStoreWebsites = $this->storeWebsite...
php
{ "resource": "" }
q258488
StoreRepository.findAll
test
public function findAll() { // initialize the array with the available stores $stores = array(); // execute the prepared statement $this->storesStmt->execute(); // load the available stores $availableStores = $this->storesStmt->fetchAll(); // fetch the sto...
php
{ "resource": "" }
q258489
CategoryVarcharRepository.findAllByEntityIds
test
public function findAllByEntityIds(array $entityIds) { // prepare the cache key $vals = implode(',', $entityIds); $sql = str_replace('?', $vals, $this->loadStatement(SqlStatementKeys::CATEGORY_VARCHARS_BY_ENTITY_IDS)); // load the categories with the passed values and return them ...
php
{ "resource": "" }
q258490
CategoryVarcharRepository.findByEntityId
test
public function findByEntityId($entityId) { // prepare the cache key $sql = str_replace('?', $entityId, $this->loadStatement(SqlStatementKeys::CATEGORY_VARCHARS_BY_ENTITY_IDS)); // load the categories with the passed values and return them if ($stmt = $this->getConnection()->query(...
php
{ "resource": "" }
q258491
CustomerGroupRepository.findAll
test
public function findAll() { // initialize the array for the customer groups $customerGroups = []; // execute the prepared statement $this->customerGroupsStmt->execute(); // load the available customer groups $availableCustomerGroups = $this->customerGroupsStmt->fet...
php
{ "resource": "" }
q258492
PrimaryKeyUtil.getPrimaryKeyMemberName
test
public function getPrimaryKeyMemberName() { // make sure the edition name is in upper cases $editionName = strtoupper($this->configuration->getMagentoEdition()); // return the primary key member name for the actual edition if (isset($this->editionPrimaryKeyMemberNameMappings[$editi...
php
{ "resource": "" }
q258493
AttributeObserverTrait.clearRow
test
protected function clearRow() { // query whether or not the column keys has been initialized if ($this->cleanUpEmptyColumnKeys === null) { // initialize the array with the column keys that has to be cleaned-up $this->cleanUpEmptyColumnKeys = array(); // query wh...
php
{ "resource": "" }
q258494
RenderBlade.blade
test
public static function blade($view, $data = array(), $viewPath = EVENTMANAGERINTEGRATION_VIEW_PATH) { if (!file_exists(EVENTMANAGERINTEGRATION_CACHE_DIR)) { mkdir(EVENTMANAGERINTEGRATION_CACHE_DIR, 0777, true); } $blade = new Blade($viewPath, EVENTMANAGERINTEGRATION_CACHE_DIR); ...
php
{ "resource": "" }
q258495
Events.registerRestRoutes
test
public function registerRestRoutes() { register_rest_route( 'wp/v2', '/'.$this->postType.'/'.'module', array( 'methods' => \WP_REST_Server::READABLE, 'callback' => array($this, 'getEvents'), 'args' => $this->getCollectionPar...
php
{ "resource": "" }
q258496
Events.getCollectionParams
test
public function getCollectionParams() { return array( 'page' => array( 'description' => 'Current page of the collection.', 'type' => 'integer', 'default' => 1, 'sanitize_callback' => 'absint', ), 'per_page' =...
php
{ "resource": "" }
q258497
Events.sanitizeEndDate
test
public function sanitizeEndDate($data) { $data = strtotime($data); if ($data == false) { $data = strtotime('today midnight'); } $data = strtotime('+1 day', $data) - 1; return date('Y-m-d H:i:s', $data); }
php
{ "resource": "" }
q258498
Events.getEvents
test
public function getEvents($request) { // Get params $params = $request->get_params(); // Set display limit to -1 to get all events $params['display_limit'] = -1; // Save coordinates to location array if (!empty($params['lat']) && !empty($params['lng'])) { ...
php
{ "resource": "" }
q258499
Events.mapEventModuleData
test
public function mapEventModuleData($moduleId, $events) { $data = get_fields($moduleId); $template = $data['mod_event_display'] ?? 'list'; $class = '\EventManagerIntegration\Module\Event\TemplateController\\'.ucwords($template).'Template'; if (class_exists($class)) { $c...
php
{ "resource": "" }