_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q3100
NGSIAPIv2.post
train
public function post($url, $requestBody = null) { $posturl = $this->url . $url; return $this->restRequest($posturl, 'POST', $requestBody); }
php
{ "resource": "" }
q3101
SitemapRun.run
train
public function run() { $this->generator->addRaw( array( 'location' => 'example.com', 'last_modified' => '2013-01-28', 'change_frequency' => 'weekly', 'priority' => '0.65' ) ); $this->generator->addRaw( array( 'location' => 'example.com/test', ...
php
{ "resource": "" }
q3102
SystemEmailFromBuilder.canBuild
train
public function canBuild() { $configuration = $this->getEmailConfiguration(); $emailAddress = (string)$configuration['defaultMailFromAddress']; return \filter_var($emailAddress, FILTER_VALIDATE_EMAIL) !== false; }
php
{ "resource": "" }
q3103
CachedAssociationCount.getCachedRelationCount
train
protected function getCachedRelationCount($propertyName) { if (array_key_exists($propertyName, $this->cachedRelationCountsCount)) { return $this->cachedRelationCountsCount[$propertyName]; } $this->cachedRelationCountsCount[$propertyName] = $this->getUncachedRelationCount($proper...
php
{ "resource": "" }
q3104
CachedAssociationCount.getUncachedRelationCount
train
protected function getUncachedRelationCount($propertyName) { if ($this->$propertyName instanceof LazyObjectStorage) { $reflectionClass = new \ReflectionClass(LazyObjectStorage::class); $reflectionProperty = $reflectionClass->getProperty('fieldValue'); $reflectionProperty-...
php
{ "resource": "" }
q3105
Tx_Oelib_PageFinder.getPageUid
train
public function getPageUid() { switch ($this->getCurrentSource()) { case self::SOURCE_MANUAL: $result = $this->storedPageUid; break; case self::SOURCE_FRONT_END: $result = (int)$this->getFrontEndController()->id; break; ...
php
{ "resource": "" }
q3106
Tx_Oelib_PageFinder.getCurrentSource
train
public function getCurrentSource() { if ($this->manualPageUidSource !== self::SOURCE_AUTO) { $result = $this->manualPageUidSource; } elseif ($this->hasManualPageUid()) { $result = self::SOURCE_MANUAL; } elseif ($this->hasFrontEnd()) { $result = self::SOURC...
php
{ "resource": "" }
q3107
Views.pickView
train
public static function pickView($stack) { $viewRoot = trailingslashit(Paths::views()); foreach ($stack as $id) { $innerPath = str_replace('.', '/', $id); $innerPath .= '.blade.php'; if (file_exists($viewRoot . $innerPath)) return $id; } re...
php
{ "resource": "" }
q3108
Posts.mainPageTitle
train
public static function mainPageTitle() { if (is_home()) { if (get_option('page_for_posts', true)) { return get_the_title(get_option('page_for_posts', true)); } else { return __('Latest Posts', 'baobab'); ...
php
{ "resource": "" }
q3109
DefaultDataTablesRepository.buildDataTablesCountExported
train
protected function buildDataTablesCountExported(DataTablesProviderInterface $dtProvider) { $prefix = $dtProvider->getPrefix(); $qb = $this->createQueryBuilder($prefix) ->select("COUNT(" . $prefix . ")"); return $qb; }
php
{ "resource": "" }
q3110
DefaultDataTablesRepository.buildDataTablesCountFiltered
train
protected function buildDataTablesCountFiltered(DataTablesWrapperInterface $dtWrapper) { $prefix = $dtWrapper->getMapping()->getPrefix(); $qb = $this->createQueryBuilder($prefix) ->select("COUNT(" . $prefix . ")"); DataTablesRepositoryHelper::appendWhere($qb, $dtWrapper); ...
php
{ "resource": "" }
q3111
DefaultDataTablesRepository.buildDataTablesCountTotal
train
protected function buildDataTablesCountTotal(DataTablesWrapperInterface $dtWrapper) { $prefix = $dtWrapper->getMapping()->getPrefix(); $qb = $this->createQueryBuilder($prefix) ->select("COUNT(" . $prefix . ")"); return $qb; }
php
{ "resource": "" }
q3112
DefaultDataTablesRepository.buildDataTablesFindAll
train
protected function buildDataTablesFindAll(DataTablesWrapperInterface $dtWrapper) { $prefix = $dtWrapper->getMapping()->getPrefix(); $qb = $this->createQueryBuilder($prefix) ->setFirstResult($dtWrapper->getRequest()->getStart()); if (0 < $dtWrapper->getRequest()->getLength()) { ...
php
{ "resource": "" }
q3113
DataTablesExportHelper.isWindows
train
public static function isWindows(Request $request) { if (false === $request->headers->has("user-agent")) { return false; } $dd = new DeviceDetector($request->headers->get("user-agent")); $dd->parse(); $os = $dd->getOs("name"); return 1 === preg_match("/Win...
php
{ "resource": "" }
q3114
Ajax.generateNonceField
train
public function generateNonceField($action) { $nonceName = $this->namespace . '_' . $action; return wp_nonce_field(md5($nonceName), $nonceName, true, false); }
php
{ "resource": "" }
q3115
CacheControlService.getCacheTagsAndLifetime
train
protected function getCacheTagsAndLifetime() { $lifetime = null; $tags = array(); $entriesMetadata = $this->contentCacheFrontend->getAllMetadata(); foreach ($entriesMetadata as $identifier => $metadata) { $entryTags = isset($metadata['tags']) ? $metadata['tags'] : array()...
php
{ "resource": "" }
q3116
VarnishBanService.banAll
train
public function banAll($domains = null, $contentType = null) { $this->cacheInvalidator->invalidateRegex('.*', $contentType, $domains); $this->logger->log(sprintf('Cleared all Varnish cache%s%s', $domains ? ' for domains "' . (is_array($domains) ? implode(', ', $domains) : $domains) . '"' : '', $cont...
php
{ "resource": "" }
q3117
VarnishBanService.banByTags
train
public function banByTags(array $tags, $domains = null) { if (count($this->settings['ignoredCacheTags']) > 0) { $tags = array_diff($tags, $this->settings['ignoredCacheTags']); } /** * Sanitize tags * @see \Neos\Fusion\Core\Cache\ContentCache */ ...
php
{ "resource": "" }
q3118
Router.addFallthroughRoute
train
protected function addFallthroughRoute($controller, $uri) { $missing = $this->any($uri.'/{_missing}', $controller.'@missingMethod'); $missing->where('_missing', '(.*)'); }
php
{ "resource": "" }
q3119
Tx_Oelib_Db.select
train
public static function select( $fields, $tableNames, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '' ) { if ($tableNames === '') { throw new \InvalidArgumentException('The table names must not be empty.', 1331488261); } ...
php
{ "resource": "" }
q3120
Tx_Oelib_Db.selectSingle
train
public static function selectSingle( $fields, $tableNames, $whereClause = '', $groupBy = '', $orderBy = '', $offset = 0 ) { $result = self::selectMultiple( $fields, $tableNames, $whereClause, $groupBy, ...
php
{ "resource": "" }
q3121
Tx_Oelib_Db.selectMultiple
train
public static function selectMultiple( $fieldNames, $tableNames, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '' ) { $result = []; $dbResult = self::select( $fieldNames, $tableNames, $whereClause, ...
php
{ "resource": "" }
q3122
MetaGenerator.generate
train
public function generate() { $this->loadWebmasterTags(); $title = $this->getTitle(); $description = $this->getDescription(); $keywords = $this->getKeywords(); $metatags = $this->metatags; $html = array(); $html[] = "<title>$title</title>"; $html[] = sprintf('<meta name="description" item...
php
{ "resource": "" }
q3123
MetaGenerator.fromObject
train
public function fromObject(MetaAware $object) { $data = $object->getMetaData(); if (array_key_exists('title', $data)) { $this->setTitle($data['title']); } if (array_key_exists('description', $data)) { $this->setDescription($data['description']); } if (array_key_exists('keywords', $data)) { $thi...
php
{ "resource": "" }
q3124
MetaGenerator.setTitle
train
public function setTitle($title) { $title = strip_tags($title); $this->title_session = $title; $this->title = $title . $this->getDefault('separator') . $this->getDefault('title'); }
php
{ "resource": "" }
q3125
MetaGenerator.setDescription
train
public function setDescription($description) { $description = strip_tags($description); if (mb_strlen($description) > 160) { $description = mb_substr($description, 0, 160); } $this->description = $description; }
php
{ "resource": "" }
q3126
MetaGenerator.getKeywords
train
public function getKeywords() { $keywords = $this->keywords ? : $this->getDefault('keywords'); return (is_array($keywords)) ? implode(', ', $keywords) : $keywords; }
php
{ "resource": "" }
q3127
MetaGenerator.loadWebmasterTags
train
public function loadWebmasterTags() { foreach ($this->webmaster as $name => $value): if (!empty($value)): $meta = array_get(self::$webmasterTags, $name, $name); $this->addMeta($meta, $value); endif; endforeach; }
php
{ "resource": "" }
q3128
Cruncher.getLastVisited
train
public function getLastVisited($locale = null, $query = null) { $query = $this->determineLocaleAndQuery($locale, $query); $lastVisited = $query->orderBy('created_at', 'desc')->first(); return $lastVisited ? $lastVisited->created_at : null; }
php
{ "resource": "" }
q3129
Cruncher.getTotalVisitCount
train
public function getTotalVisitCount($locale = null, $query = null) { $query = $this->determineLocaleAndQuery($locale, $query); return $query->count(); }
php
{ "resource": "" }
q3130
Cruncher.getTodayCount
train
public function getTodayCount($locale = null, $query = null) { $query = $this->determineLocaleAndQuery($locale, $query); return $query->where('created_at', '>=', Carbon::today())->count(); }
php
{ "resource": "" }
q3131
Cruncher.getCountInBetween
train
public function getCountInBetween(Carbon $from, Carbon $until = null, $locale = null, $query = null, $cacheKey = null) { if (is_null($until)) { $until = Carbon::now(); } if ( ! is_null($cacheKey)) { $count = $this->getCachedCountBetween($from, $until,...
php
{ "resource": "" }
q3132
Cruncher.getCachedCountBetween
train
protected function getCachedCountBetween(Carbon $from, Carbon $until, $locale, $cacheKey) { $key = $this->makeBetweenCacheKey($from, $until, $locale, $cacheKey); return $this->cache->get($key); }
php
{ "resource": "" }
q3133
Cruncher.cacheCountBetween
train
protected function cacheCountBetween($count, Carbon $from, Carbon $until, $locale, $cacheKey) { // Cache only if cacheKey is present if ($cacheKey && ($until->timestamp < Carbon::now()->timestamp)) { $key = $this->makeBetweenCacheKey($from, $until, $locale, $cacheKey); ...
php
{ "resource": "" }
q3134
Cruncher.makeBetweenCacheKey
train
protected function makeBetweenCacheKey(Carbon $from, Carbon $until, $locale, $cacheKey) { $key = 'tracker.between.' . $cacheKey . '.'; $key .= (is_null($locale) ? '' : $locale . '.'); return $key . $from->timestamp . '-' . $until->timestamp; }
php
{ "resource": "" }
q3135
Cruncher.getRelativeYearCount
train
public function getRelativeYearCount($end = null, $locale = null, $query = null, $cacheKey = null) { if (is_null($end)) { $end = Carbon::today(); } return $this->getCountInBetween($end->copy()->subYear()->startOfDay(), $end->endOfDay(), $locale, $query, $cacheKey); }
php
{ "resource": "" }
q3136
Cruncher.getRelativeMonthCount
train
public function getRelativeMonthCount($end = null, $locale = null, $query = null, $cacheKey = null) { if (is_null($end)) { $end = Carbon::today(); } return $this->getCountInBetween($end->copy()->subMonth()->addDay()->startOfDay(), $end->endOfDay(), $locale, $query, $cach...
php
{ "resource": "" }
q3137
Cruncher.getRelativeWeekCount
train
public function getRelativeWeekCount($end = null, $locale = null, $query = null, $cacheKey = null) { if (is_null($end)) { $end = Carbon::today(); } return $this->getCountInBetween($end->copy()->subWeek()->addDay()->startOfDay(), $end->endOfDay(), $locale, $query, $cacheK...
php
{ "resource": "" }
q3138
Cruncher.getRelativeDayCount
train
public function getRelativeDayCount($end = null, $locale = null, $query = null, $cacheKey = null) { if (is_null($end)) { $end = Carbon::today(); } return $this->getCountInBetween($end, $end->copy()->endOfDay(), $locale, $query, $cacheKey); }
php
{ "resource": "" }
q3139
Cruncher.getCountForDay
train
public function getCountForDay(Carbon $day = null, $locale = null, $query = null, $cacheKey = null) { if (is_null($day)) { $day = Carbon::now(); } return $this->getCountInBetween($day->startOfDay(), $day->copy()->endOfDay(), $locale, $query, $cacheKey); }
php
{ "resource": "" }
q3140
Cruncher.getCountPerMonth
train
public function getCountPerMonth(Carbon $from, Carbon $until = null, $locale = null, $query = null, $cacheKey = null) { return $this->getCountPer('Month', $from, $until, $locale, $query, $cacheKey); }
php
{ "resource": "" }
q3141
Cruncher.getCountPer
train
protected function getCountPer($span, Carbon $from, Carbon $until = null, $locale = null, $query = null, $cacheKey = null) { $query = $this->determineLocaleAndQuery($locale, $query); $statistics = []; $labels = []; if (is_null($until)) { $until = Carbon::now(); ...
php
{ "resource": "" }
q3142
Cruncher.determineLocaleAndQuery
train
protected function determineLocaleAndQuery($locale, $query) { if (is_null($query)) { $modelName = $this->getViewModelName(); $query = with(new $modelName)->newQuery(); } if ($locale) { $query->where('locale', $locale); } ...
php
{ "resource": "" }
q3143
MetaData.extractMetaData
train
protected function extractMetaData(ResponseInterface $response) { $headers = $this->findMetaHeaders($response); if (!count($headers)) { return []; } $metaData = []; foreach ($headers as $header) { $metaData[$header] = $response->getHeaderLine($heade...
php
{ "resource": "" }
q3144
MetaData.findMetaHeaders
train
protected function findMetaHeaders(ResponseInterface $response) { $headerNames = array_keys($response->getHeaders()); $metaType = $this->objectMetaType(); return array_filter($headerNames, function ($header) use ($metaType) { return strpos($header, 'X-'.$metaType.'-Meta') !== fa...
php
{ "resource": "" }
q3145
MetaData.hasMeta
train
public function hasMeta($name) { $meta = $this->objectData('meta', []); return isset($meta[$this->sanitizeMetaName($name)]); }
php
{ "resource": "" }
q3146
MetaData.getMeta
train
public function getMeta($name) { if (!$this->hasMeta($name)) { throw new InvalidArgumentException('Meta data with name "'.$name.'" does not exists.'); } $meta = $this->objectData('meta', []); return $meta[$this->sanitizeMetaName($name)]; }
php
{ "resource": "" }
q3147
MetaData.setMeta
train
public function setMeta(array $meta) { $headers = []; $metaType = $this->objectMetaType(); // We will replace any 'X-{Object}-Meta-' prefixes in meta name // and prepend final header names with same prefix so API will // receive sanitized headers and won't produce any errors...
php
{ "resource": "" }
q3148
SubscriptionEntity.getContext
train
public function getContext($options = []) { $url = $this->getBaseURI(); if (count($options) > 0) { $prefix = ($this->_type) ? "&" : "?"; $url .= $prefix . urldecode(http_build_query($options)); } return $this->_orion->get($url); }
php
{ "resource": "" }
q3149
SubscriptionEntity.update
train
public function update($subscription){ if(!isset($this->_id) || null == $this->_id){ throw new \Exception("You must especify an Id to perform subscription updates"); } if($subscription instanceof SubscriptionFactory){ $context = new ContextFactory((array) $subscription->g...
php
{ "resource": "" }
q3150
Uuid.create
train
public static function create() { // use COM helper if available if (function_exists('com_create_guid')) { return com_create_guid(); } // generate UUID mt_srand((double) microtime() * 10000); // optional for php 4.2.0 and up. $charid = strtoupper(md5(uniq...
php
{ "resource": "" }
q3151
DataTablesWrapperHelper.getLanguageURL
train
public static function getLanguageURL($language) { // Initialize the directory. $dir = ObjectHelper::getDirectory(JQueryDataTablesBundle::class); $dir .= "/Resources/public/datatables-i18n/%language%.json"; // Initialize the URI. $uri = "/bundles/jquerydatatables/datatables-i18...
php
{ "resource": "" }
q3152
DataTablesWrapperHelper.getOptions
train
public static function getOptions(DataTablesWrapperInterface $dtWrapper) { $output = []; if (null !== $dtWrapper->getOptions()) { $output = $dtWrapper->getOptions()->getOptions(); } $output["ajax"] = []; $output["ajax"]["type"] = $dtWrapper->getMethod(); ...
php
{ "resource": "" }
q3153
File.fileData
train
protected function fileData($key, $default = null) { $this->guardDeletedFile(); return isset($this->data[$key]) ? $this->data[$key] : $default; }
php
{ "resource": "" }
q3154
File.absolutePath
train
protected function absolutePath($path = '') { if (!$path) { $path = $this->path(); } return '/'.$this->container().($path ? '/'.ltrim($path, '/') : ''); }
php
{ "resource": "" }
q3155
File.read
train
public function read() { $response = $this->api->request('GET', $this->absolutePath()); return (string) $response->getBody(); }
php
{ "resource": "" }
q3156
File.readStream
train
public function readStream($psr7Stream = false) { $response = $this->api->request('GET', $this->absolutePath()); if ($psr7Stream) { return $response->getBody(); } return StreamWrapper::getResource($response->getBody()); }
php
{ "resource": "" }
q3157
File.rename
train
public function rename($name) { $this->guardDeletedFile(); // If there is any slash character in new name, Selectel // will create new virtual directory and copy file to // this new one. Such behaviour may be unexpected. if (count(explode('/', $name)) > 1) { thr...
php
{ "resource": "" }
q3158
File.copy
train
public function copy($destination, $destinationContainer = null) { $this->guardDeletedFile(); if (is_null($destinationContainer)) { $destinationContainer = $this->container(); } $fullDestination = '/'.$destinationContainer.'/'.ltrim($destination, '/'); $respons...
php
{ "resource": "" }
q3159
File.delete
train
public function delete() { $this->guardDeletedFile(); $response = $this->api->request('DELETE', $this->absolutePath()); if ($response->getStatusCode() !== 204) { throw new ApiRequestFailedException('Unable to delete file "'.$this->path().'".', $response->getStatusCode()); ...
php
{ "resource": "" }
q3160
File.jsonSerialize
train
public function jsonSerialize() { return [ 'name' => $this->name(), 'path' => $this->path(), 'directory' => $this->directory(), 'container' => $this->container(), 'size' => $this->size(), 'content_type' => $this->contentType(), ...
php
{ "resource": "" }
q3161
GiroCheckout_SDK_Notify.getResponseParam
train
public function getResponseParam($param) { if (isset($this->notifyParams[$param])) { return $this->notifyParams[$param]; } return NULL; }
php
{ "resource": "" }
q3162
GiroCheckout_SDK_Notify.parseNotification
train
public function parseNotification($params) { $Config = GiroCheckout_SDK_Config::getInstance(); if ($Config->getConfig('DEBUG_MODE')) { GiroCheckout_SDK_Debug_helper::getInstance()->logNotificationInput($params); } if (!is_array($params) || empty($params)) { throw new GiroCheckout_SDK_Excep...
php
{ "resource": "" }
q3163
GiroCheckout_SDK_Notify.checkHash
train
public function checkHash() { $string = ''; $hashFieldName = $this->requestMethod->getNotifyHashName(); foreach ($this->notifyParams as $k => $v) { if ($k !== $hashFieldName) { $string .= $v; } } if ($this->notifyParams[$hashFieldName] === hash_hmac('md5', $string, $this->secre...
php
{ "resource": "" }
q3164
GiroCheckout_SDK_Notify.avsSuccessful
train
public function avsSuccessful() { if ($this->requestMethod->getAVSSuccessfulCode() != NULL) { return $this->requestMethod->getAVSSuccessfulCode() == $this->notifyParams['gcResultAVS']; } return FALSE; }
php
{ "resource": "" }
q3165
GiroCheckout_SDK_Notify.sendOkStatus
train
public function sendOkStatus() { $Config = GiroCheckout_SDK_Config::getInstance(); if ($Config->getConfig('DEBUG_MODE')) { GiroCheckout_SDK_Debug_helper::getInstance()->logNotificationOutput('sendOkStatus'); } header('HTTP/1.1 200 OK'); }
php
{ "resource": "" }
q3166
GiroCheckout_SDK_Notify.sendBadRequestStatus
train
public function sendBadRequestStatus() { $Config = GiroCheckout_SDK_Config::getInstance(); if ($Config->getConfig('DEBUG_MODE')) { GiroCheckout_SDK_Debug_helper::getInstance()->logNotificationOutput('sendBadRequestStatus'); } header('HTTP/1.1 400 Bad Request'); }
php
{ "resource": "" }
q3167
GiroCheckout_SDK_Notify.sendServiceUnavailableStatus
train
public function sendServiceUnavailableStatus() { $Config = GiroCheckout_SDK_Config::getInstance(); if ($Config->getConfig('DEBUG_MODE')) { GiroCheckout_SDK_Debug_helper::getInstance()->logNotificationOutput('sendServiceUnavailableStatus'); } header('HTTP/1.1 503 Service Unavailable'); }
php
{ "resource": "" }
q3168
GiroCheckout_SDK_Notify.sendOtherStatus
train
public function sendOtherStatus() { $Config = GiroCheckout_SDK_Config::getInstance(); if ($Config->getConfig('DEBUG_MODE')) { GiroCheckout_SDK_Debug_helper::getInstance()->logNotificationOutput('sendOtherStatus'); } header('HTTP/1.1 404 Not Found'); }
php
{ "resource": "" }
q3169
GiroCheckout_SDK_Notify.getNotifyResponseStringJson
train
public function getNotifyResponseStringJson() { $response['Result'] = $this->notifyResponse['Result']; $response['ErrorMessage'] = $this->notifyResponse['ErrorMessage']; $response['OrderId'] = $this->notifyResponse['OrderId']; $response['CustomerId'] = $this->notifyResponse['CustomerId']; $response[...
php
{ "resource": "" }
q3170
Tx_Oelib_FrontEndLoginManager.getLoggedInUser
train
public function getLoggedInUser($mapperName = \Tx_Oelib_Mapper_FrontEndUser::class) { if ($mapperName === '') { throw new \InvalidArgumentException('$mapperName must not be empty.', 1331488730); } if (!$this->isLoggedIn()) { return null; } if ($this->...
php
{ "resource": "" }
q3171
AbstractInitializer.getSettingOrThrow
train
public function getSettingOrThrow($key) { if ( !isset($this->data[$key])) { throw new UnknownSettingException($this->id, $key); } return $this->data[$key]; }
php
{ "resource": "" }
q3172
AbstractInitializer.getSetting
train
public function getSetting($key, $defaultValue) { if ( !isset($this->data[$key])) { return $defaultValue; } return $this->data[$key]; }
php
{ "resource": "" }
q3173
Tx_Oelib_TemplateHelper.init
train
public function init($configuration = null) { if ($this->isInitialized) { return; } // Calls the base class's constructor manually as this isn't done automatically. parent::__construct(); $this->initializeConfiguration($configuration); $this->ensureConte...
php
{ "resource": "" }
q3174
Tx_Oelib_TemplateHelper.getConfValue
train
private function getConfValue( $fieldName, $sheet = 'sDEF', $isFileName = false, $ignoreFlexform = false ) { $flexformsValue = ''; if (!$ignoreFlexform) { $flexformsValue = $this->pi_getFFvalue( $this->cObj->data['pi_flexform'], ...
php
{ "resource": "" }
q3175
Tx_Oelib_TemplateHelper.addPathToFileName
train
private function addPathToFileName($fileName, $path = '') { if (empty($path)) { $path = 'uploads/tx_' . $this->extKey . '/'; } return $path . $fileName; }
php
{ "resource": "" }
q3176
Tx_Oelib_TemplateHelper.getConfValueString
train
public function getConfValueString( $fieldName, $sheet = 'sDEF', $isFileName = false, $ignoreFlexform = false ) { return trim( $this->getConfValue( $fieldName, $sheet, $isFileName, $ignoreFlexform ...
php
{ "resource": "" }
q3177
Tx_Oelib_TemplateHelper.hasConfValueString
train
public function hasConfValueString( $fieldName, $sheet = 'sDEF', $ignoreFlexform = false ) { return $this->getConfValueString( $fieldName, $sheet, false, $ignoreFlexform ) !== ''; }
php
{ "resource": "" }
q3178
Tx_Oelib_TemplateHelper.setCachedConfigurationValue
train
public static function setCachedConfigurationValue($key, $value) { $pageUid = \Tx_Oelib_PageFinder::getInstance()->getPageUid(); if (!isset(self::$cachedConfigurations[$pageUid])) { self::$cachedConfigurations[$pageUid] = []; } self::$cachedConfigurations[$pageUid][$key...
php
{ "resource": "" }
q3179
Tx_Oelib_TemplateHelper.setLabels
train
public function setLabels() { $template = $this->getTemplate(); try { $labels = $template->getLabelMarkerNames(); } catch (Exception $exception) { $labels = []; } foreach ($labels as $label) { $template->setMarker($label, $this->translate(...
php
{ "resource": "" }
q3180
Tx_Oelib_TemplateHelper.ensureIntegerArrayValues
train
protected function ensureIntegerArrayValues(array $keys) { if (empty($keys)) { return; } foreach ($keys as $key) { if (!isset($this->piVars[$key]) || !is_array($this->piVars[$key]) ) { continue; } f...
php
{ "resource": "" }
q3181
Tx_Oelib_TemplateHelper.getListViewConfigurationValue
train
private function getListViewConfigurationValue($fieldName) { if (empty($fieldName)) { throw new \InvalidArgumentException('$fieldName must not be empty.', 1331489528); } if (!isset($this->conf['listView.']) || !isset($this->conf['listView.'][$fieldName]) ) { ...
php
{ "resource": "" }
q3182
GiroCheckout_SDK_Hash_helper.getHMACMD5Hash
train
public static function getHMACMD5Hash($password, $data) { $dataString = implode('', $data); return self::getHMACMD5HashString($password, $dataString); }
php
{ "resource": "" }
q3183
GiroCheckout_SDK_Hash_helper.getHMACMD5HashString
train
public static function getHMACMD5HashString($password, $data) { if (function_exists('hash_hmac')) { return hash_hmac('MD5', $data, $password); } else { return self::hmacFallbackMD5($data, $password); } }
php
{ "resource": "" }
q3184
ContentCacheFlusherService.generateCacheTags
train
protected function generateCacheTags($node) { $this->tagsToFlush[ContentCache::TAG_EVERYTHING] = 'which were tagged with "Everything".'; if (empty($this->workspacesToFlush[$node->getWorkspace()->getName()])) { $this->resolveWorkspaceChain($node->getWorkspace()); } if (!a...
php
{ "resource": "" }
q3185
Tx_Oelib_Template.getMarker
train
public function getMarker($markerName) { $unifiedMarkerName = $this->createMarkerName($markerName); if (!isset($this->markers[$unifiedMarkerName])) { return ''; } return $this->markers[$unifiedMarkerName]; }
php
{ "resource": "" }
q3186
Tx_Oelib_Template.isSubpartVisible
train
public function isSubpartVisible($subpartName) { if ($subpartName === '') { return false; } return isset($this->subparts[$subpartName]) && !isset($this->subpartsToHide[$subpartName]); }
php
{ "resource": "" }
q3187
Tx_Oelib_Template.replaceSubparts
train
protected function replaceSubparts($templateCode) { $template = $this; return preg_replace_callback( self::SUBPART_PATTERN, function (array $matches) use ($template) { return $template->getSubpart($matches[1]); }, $templateCode ...
php
{ "resource": "" }
q3188
Trackable.attachTrackerView
train
public function attachTrackerView($view) { if ( ! $this->trackerViews->contains($view->getKey())) { return $this->trackerViews()->attach($view); } }
php
{ "resource": "" }
q3189
Terms.implodeSlugs
train
public static function implodeSlugs($glue, $terms) { if ($terms==null || empty($terms) || is_wp_error($terms)) return ''; $tokens = array(); foreach ($terms as $t) { $tokens[] = $t->slug; } return implode($glue, $tokens); }
php
{ "resource": "" }
q3190
Terms.implodeNames
train
public static function implodeNames($glue, $terms) { if ($terms==null || empty($terms) || is_wp_error($terms)) return ''; $tokens = array(); foreach ($terms as $t) { $tokens[] = $t->name; } return implode($glue, $tokens); }
php
{ "resource": "" }
q3191
Tx_Oelib_ConfigurationProxy.get
train
protected function get($key) { $this->loadConfigurationLazily(); if ($this->hasConfigurationValue($key)) { $result = $this->configuration[$key]; } else { $result = ''; } return $result; }
php
{ "resource": "" }
q3192
VarnishCommandController.clearCommand
train
public function clearCommand($domain = null, $contentType = null) { $this->varnishBanService->banAll($domain, $contentType); }
php
{ "resource": "" }
q3193
DataTablesFactory.copyParameterBag
train
protected static function copyParameterBag(ParameterBag $src, ParameterBag $dst) { foreach ($src->keys() as $current) { if (true === in_array($current, DataTablesEnumerator::enumParameters())) { continue; } $dst->set($current, $src->get($current)); } ...
php
{ "resource": "" }
q3194
DataTablesFactory.isValidRawColumn
train
protected static function isValidRawColumn(array $rawColumn) { if (false === array_key_exists(DataTablesColumnInterface::DATATABLES_PARAMETER_DATA, $rawColumn)) { return false; } if (false === array_key_exists(DataTablesColumnInterface::DATATABLES_PARAMETER_NAME, $rawColumn)) { ...
php
{ "resource": "" }
q3195
DataTablesFactory.isValidRawOrder
train
protected static function isValidRawOrder(array $rawOrder) { if (false === array_key_exists(DataTablesOrderInterface::DATATABLES_PARAMETER_COLUMN, $rawOrder)) { return false; } if (false === array_key_exists(DataTablesOrderInterface::DATATABLES_PARAMETER_DIR, $rawOrder)) { ...
php
{ "resource": "" }
q3196
DataTablesFactory.isValidRawSearch
train
protected static function isValidRawSearch(array $rawSearch) { if (false === array_key_exists(DataTablesSearchInterface::DATATABLES_PARAMETER_REGEX, $rawSearch)) { return false; } if (false === array_key_exists(DataTablesSearchInterface::DATATABLES_PARAMETER_VALUE, $rawSearch)) { ...
php
{ "resource": "" }
q3197
DataTablesFactory.newColumn
train
public static function newColumn($data, $name, $cellType = DataTablesColumnInterface::DATATABLES_CELL_TYPE_TD) { $dtColumn = new DataTablesColumn(); $dtColumn->getMapping()->setColumn($data); $dtColumn->setCellType($cellType); $dtColumn->setData($data); $dtColumn->setName($name)...
php
{ "resource": "" }
q3198
DataTablesFactory.newWrapper
train
public static function newWrapper($url, DataTablesProviderInterface $provider, UserInterface $user = null) { $dtWrapper = new DataTablesWrapper(); $dtWrapper->getMapping()->setPrefix($provider->getPrefix()); $dtWrapper->setMethod($provider->getMethod()); $dtWrapper->setProvider($provide...
php
{ "resource": "" }
q3199
DataTablesFactory.parseColumn
train
protected static function parseColumn(array $rawColumn, DataTablesWrapperInterface $wrapper) { if (false === static::isValidRawColumn($rawColumn)) { return null; } $dtColumn = $wrapper->getColumn($rawColumn[DataTablesColumnInterface::DATATABLES_PARAMETER_DATA]); if (null ==...
php
{ "resource": "" }