_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q11300
LdapFetcher.fullFetch
train
public function fullFetch($uSNChangedTo) { $searchFilter = Filter::andFilter( Filter::greaterOrEqual('uSNChanged', 0), Filter::lessOrEqual('uSNChanged', $uSNChangedTo) ); if ($this->fullSyncEntryFilter) { $searchFilter =
php
{ "resource": "" }
q11301
LdapFetcher.incrementalFetch
train
public function incrementalFetch($uSNChangedFrom, $uSNChangedTo, $detectDeleted = false) { // fetch changed $changedFilter = Filter::andFilter( Filter::greaterOrEqual('uSNChanged', $uSNChangedFrom), Filter::lessOrEqual('uSNChanged', $uSNChangedTo) ); if ($this->incrementalSyncEntryFilter) { $changedFilter = $changedFilter->addAnd($this->incrementalSyncEntryFilter); } $changed = $this->search($changedFilter); // fetch deleted $deleted = []; if ($detectDeleted) { $defaultNamingContext = $this->getRootDse()->getDefaultNamingContext(); $options = $this->ldap->getOptions(); $originalHost = isset($options['host']) ? $options['host'] : ''; $hostForDeleted = rtrim($originalHost, "/") . "/" .urlencode( sprintf("<WKGUID=%s,%s>", self::WK_GUID_DELETED_OBJECTS_CONTAINER_W, $defaultNamingContext) ) ; // hack that workarounds zendframework/zend-ldap connection issues. // should be removed after resolution of https://github.com/zendframework/zend-ldap/pull/69 if (!preg_match('~^ldap(?:i|s)?://~', $hostForDeleted)) { $schema = "ldap://"; if ((isset($options['port']) && $options['port'] == 636) || (isset($options['useSsl']) && $options['useSsl'] == true)) {
php
{ "resource": "" }
q11302
LdapFetcher.getRootDse
train
private function getRootDse() { if (!$this->rootDse) { $rootDse = $this->ldap->getRootDse(); if (!$rootDse instanceof ActiveDirectory) {
php
{ "resource": "" }
q11303
LdapFetcher.setupEntryFilter
train
private function setupEntryFilter($entryFilter) { if ($entryFilter == null) { return null; } if (is_string($entryFilter)) { $filter = new Filter\StringFilter($entryFilter); } elseif ($entryFilter instanceof AbstractFilter) { $filter = $entryFilter; } else { throw new InvalidArgumentException( sprintf(
php
{ "resource": "" }
q11304
LdapFetcher.search
train
private function search(AbstractFilter $filter) { if ($this->ldapSearchOptions) { $ldapResource = $this->ldap->getResource(); foreach ($this->ldapSearchOptions as $name => $options) { ldap_set_option($ldapResource, $name, $options);
php
{ "resource": "" }
q11305
ValueHolder.setValue
train
public function setValue($value, EntityInterface $entity = null) { $attribute_validator = $this->getAttribute()->getValidator(); $validation_result = $attribute_validator->validate($value, $entity); if ($validation_result->getSeverity() <= IncidentInterface::NOTICE) { $previous_native_value = $this->toNative(); $this->value = $validation_result->getSanitizedValue(); if (!$this->sameValueAs($previous_native_value)) { $value_changed_event = $this->createValueHolderChangedEvent($previous_native_value); $this->propagateValueChangedEvent($value_changed_event); }
php
{ "resource": "" }
q11306
ValueHolder.sameValueAs
train
public function sameValueAs($other_value) { $null_value = $this->attribute->getNullValue(); if ($null_value === $this->getValue() && $null_value === $other_value) { return true; }
php
{ "resource": "" }
q11307
ValueHolder.isEqualTo
train
public function isEqualTo(ValueHolderInterface $other_value_holder) { if (get_class($this) !== get_class($other_value_holder)) { return false;
php
{ "resource": "" }
q11308
ValueHolder.addValueChangedListener
train
public function addValueChangedListener(ValueChangedListenerInterface $listener) { if (!$this->listeners->hasItem($listener)) {
php
{ "resource": "" }
q11309
ValueHolder.removedValueChangedListener
train
public function removedValueChangedListener(ValueChangedListenerInterface $listener) { if ($this->listeners->hasItem($listener)) {
php
{ "resource": "" }
q11310
ValueHolder.onEntityChanged
train
public function onEntityChanged(EntityChangedEvent $embedded_entity_event) { $value_changed_event = $embedded_entity_event->getValueChangedEvent(); $this->propagateValueChangedEvent( new ValueChangedEvent(
php
{ "resource": "" }
q11311
ValueHolder.propagateValueChangedEvent
train
protected function propagateValueChangedEvent(ValueChangedEvent $event) { foreach ($this->listeners as $listener) {
php
{ "resource": "" }
q11312
ValueHolder.createValueHolderChangedEvent
train
protected function createValueHolderChangedEvent($prev_value, EventInterface $embedded_event = null) { return new ValueChangedEvent( array( 'attribute_name' => $this->getAttribute()->getName(), 'prev_value'
php
{ "resource": "" }
q11313
EventHandlerResolver.resolveHandlingMethod
train
protected function resolveHandlingMethod($eventType) { // Remove namespace $pos = strrpos($eventType, '\\'); if ($pos !== false) { $eventType = substr($eventType, $pos + 1); } // Remove "Event" suffix
php
{ "resource": "" }
q11314
Configurable.setOptions
train
protected function setOptions($options) { if (!$options instanceof OptionsInterface) { $options = is_array($options) ? $options : [];
php
{ "resource": "" }
q11315
ValidatorWithExclusion.shouldSkip
train
protected function shouldSkip($object, $propertyPath) { if (!\is_object($object) && !\is_array($object)) { return false; } if (!empty($propertyPath)) { $parts = \explode('.', $propertyPath); $accessor = new PropertyAccessor(); $parent = $object; foreach ($parts as $childSubPath) { if ($parent instanceof EntityInterface && $this->shouldSkipObjectProperty($parent, $childSubPath)) { return true;
php
{ "resource": "" }
q11316
UseAs.getAliasForClassname
train
public function getAliasForClassname(Classname $class) { foreach ($this->classnames as $c) { if ($c['classname']->equals($class)) { return
php
{ "resource": "" }
q11317
Context.getParameter
train
private function getParameter($paramName) { if (array_key_exists($paramName, $_REQUEST)) {
php
{ "resource": "" }
q11318
Context.get
train
public function get($key, $persistent = false) { if ($persistent) { $origKey = $key; $key = "PVALUE.$key"; } $key = strtoupper($key); if (isset($this->_config[$key])) { $value = $this->_config[$key]; if ($value instanceof IProcessParameter) { return $value->getParameter(); } else { return $value; } } elseif
php
{ "resource": "" }
q11319
Context.authenticatedUser
train
public function authenticatedUser() { if ($this->IsAuthenticated()) { $user = UserContext::getInstance()->userInfo();
php
{ "resource": "" }
q11320
Context.MakeLogin
train
public function MakeLogin($user, $id) { $userObj = $this->getUsersDatabase()->getById($id);
php
{ "resource": "" }
q11321
Context.AddCollectionToConfig
train
private function AddCollectionToConfig($collection) { foreach($collection as $key=>$value)
php
{ "resource": "" }
q11322
Context.AddSessionToConfig
train
private function AddSessionToConfig($collection) { if (is_array($collection)) { foreach($collection as $key => $value) {
php
{ "resource": "" }
q11323
Context.AddCookieToConfig
train
private function AddCookieToConfig($collection) { foreach($collection as $key => $value) {
php
{ "resource": "" }
q11324
Context.redirectUrl
train
public function redirectUrl($url) { $processor = new ParamProcessor(); $url = $processor->GetFullLink($url); $url = str_replace("&amp;", "&", $url); // IIS running CGI mode has a bug related to POST and header(LOCATION) to the SAME script. // In this environment the behavior expected causes a loop to the same page // To reproduce this behavior comment the this and try use any processpage state class $isBugVersion = stristr(PHP_OS, "win") && stristr($this->get("GATEWAY_INTERFACE"), "cgi") && stristr($this->get("SERVER_SOFTWARE"), "iis"); ob_clean(); if (!$isBugVersion) { header("Location: " . $url); } echo "<html>"; echo "<head>"; echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1;URL=$url\">"; echo "<style type='text/css'> "; echo " #logo{"; echo " width:32px;"; echo " height:32px;"; echo " top: 50%;"; echo "
php
{ "resource": "" }
q11325
Context.getUploadFileNames
train
public function getUploadFileNames($systemArray=false) { if ($systemArray) { return $_FILES; } else { $ret = array();
php
{ "resource": "" }
q11326
Context.processUpload
train
public function processUpload($filenameProcessor, $useProcessorForName, $field = null) { if (!($filenameProcessor instanceof UploadFilenameProcessor)) { throw new UploadUtilException("processUpload must receive a UploadFilenameProcessor class"); } else if (is_null($field)) { $ret = array(); foreach($_FILES as $file => $property) { $ret[] = $this->processUpload($filenameProcessor, $useProcessorForName, $property); } return $ret; } else if (is_string($field)) { $ret = array(); $ret[] = $this->processUpload($filenameProcessor, $useProcessorForName, $_FILES[$field]); return $ret; } else if (is_array($field)) { if ($useProcessorForName) { $uploadfile = $filenameProcessor->FullQualifiedNameAndPath(); } else
php
{ "resource": "" }
q11327
Context.getSuggestedContentType
train
public function getSuggestedContentType() { if (count($this->_contentType) == 0) { $this->_contentType["xsl"] = $this->getXsl(); $this->_contentType["content-type"] = "text/html"; $this->_contentType["content-disposition"] = ""; $this->_contentType["extension"] = ""; if ($this->get("xmlnuke.CHECKCONTENTTYPE")) { $filename = new AnydatasetFilenameProcessor("contenttype"); $anydataset = new AnyDataset($filename->FullQualifiedNameAndPath()); $itf = new IteratorFilter(); $itf->addRelation("xsl", Relation::EQUAL, $this->getXsl()); $it = $anydataset->getIterator($itf); if ($it->hasNext()) { $sr = $it->moveNext(); $this->_contentType = $sr->getOriginalRawFormat(); } else { $filename = new AnydatasetSetupFilenameProcessor("contenttype");
php
{ "resource": "" }
q11328
Price.createFromArray
train
public static function createFromArray($properties, string $priceType = self::GROSS, $validate = true) { if (!is_array($properties) && !$properties instanceof Traversable) { throw new InvalidArgumentException("prices must be iterable"); } $price = new static(null, $priceType); // Make sure default type is set first in order to be able to sanitize sign of other properties if (isset($properties[$priceType])) { $properties = [$priceType => $properties[$priceType]] + $properties; } foreach ($properties as $property => $value) { $value = Text::trim($value);
php
{ "resource": "" }
q11329
DirectAdminClient.da_request
train
public function da_request(string $method, string $uri = '', array $options = []): array { $this->lastRequest = microtime(true); try { $response = $this->request($method, $uri, $options); } catch(\Exception $e) { if($e instanceof RequestException) { throw new DirectAdminRequestException(sprintf('DirectAdmin %s %s request failed.', $method, $uri)); } if($e instanceof TransferException) { throw new DirectAdminTransferException(sprintf('DirectAdmin %s %s transfer failed.', $method, $uri));
php
{ "resource": "" }
q11330
CustomConfig.generateLanguageInput
train
protected function generateLanguageInput($form) { $curValueArray = $this->_context->get("xmlnuke.LANGUAGESAVAILABLE"); foreach ($curValueArray as $key => $value) { $form->addXmlnukeObject(new XmlEasyList(EasyListType::SELECTLIST, "languagesavailable$key", "xmlnuke.LANGUAGESAVAILABLE", $this->getLangArray(),
php
{ "resource": "" }
q11331
ConnectionFactory.needsRelogin
train
private function needsRelogin(SfdcConnectionInterface $con) { return ! $con->isLoggedIn() ||
php
{ "resource": "" }
q11332
Blacklist.getMinutesUntilExpired
train
protected function getMinutesUntilExpired(Payload $payload) { $exp = Utils::timestamp($payload['exp']); $iat = Utils::timestamp($payload['iat']); // get the latter of the two expiration dates and find // the number of minutes until the expiration date,
php
{ "resource": "" }
q11333
MxmapQuery.filterByTrackuid
train
public function filterByTrackuid($trackuid = null, $comparison = null) { if (null === $comparison) { if (is_array($trackuid)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11334
MxmapQuery.filterByGbxmapname
train
public function filterByGbxmapname($gbxmapname = null, $comparison = null) { if (null === $comparison) { if (is_array($gbxmapname)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11335
MxmapQuery.filterByTrackid
train
public function filterByTrackid($trackid = null, $comparison = null) { if (is_array($trackid)) { $useMinMax = false; if (isset($trackid['min'])) { $this->addUsingAlias(MxmapTableMap::COL_TRACKID, $trackid['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($trackid['max'])) { $this->addUsingAlias(MxmapTableMap::COL_TRACKID, $trackid['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11336
MxmapQuery.filterByUserid
train
public function filterByUserid($userid = null, $comparison = null) { if (is_array($userid)) { $useMinMax = false; if (isset($userid['min'])) { $this->addUsingAlias(MxmapTableMap::COL_USERID, $userid['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($userid['max'])) { $this->addUsingAlias(MxmapTableMap::COL_USERID, $userid['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11337
MxmapQuery.filterByUploadedat
train
public function filterByUploadedat($uploadedat = null, $comparison = null) { if (is_array($uploadedat)) { $useMinMax = false; if (isset($uploadedat['min'])) { $this->addUsingAlias(MxmapTableMap::COL_UPLOADEDAT, $uploadedat['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($uploadedat['max'])) { $this->addUsingAlias(MxmapTableMap::COL_UPLOADEDAT, $uploadedat['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11338
MxmapQuery.filterByUpdatedat
train
public function filterByUpdatedat($updatedat = null, $comparison = null) { if (is_array($updatedat)) { $useMinMax = false; if (isset($updatedat['min'])) { $this->addUsingAlias(MxmapTableMap::COL_UPDATEDAT, $updatedat['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($updatedat['max'])) { $this->addUsingAlias(MxmapTableMap::COL_UPDATEDAT, $updatedat['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11339
MxmapQuery.filterByMaptype
train
public function filterByMaptype($maptype = null, $comparison = null) { if (null === $comparison) { if (is_array($maptype)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11340
MxmapQuery.filterByTitlepack
train
public function filterByTitlepack($titlepack = null, $comparison = null) { if (null === $comparison) { if (is_array($titlepack)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11341
MxmapQuery.filterByStylename
train
public function filterByStylename($stylename = null, $comparison = null) { if (null === $comparison) { if (is_array($stylename)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11342
MxmapQuery.filterByDisplaycost
train
public function filterByDisplaycost($displaycost = null, $comparison = null) { if (is_array($displaycost)) { $useMinMax = false; if (isset($displaycost['min'])) { $this->addUsingAlias(MxmapTableMap::COL_DISPLAYCOST, $displaycost['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($displaycost['max'])) { $this->addUsingAlias(MxmapTableMap::COL_DISPLAYCOST, $displaycost['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11343
MxmapQuery.filterByModname
train
public function filterByModname($modname = null, $comparison = null) { if (null === $comparison) { if (is_array($modname)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11344
MxmapQuery.filterByLightmap
train
public function filterByLightmap($lightmap = null, $comparison = null) { if (is_array($lightmap)) { $useMinMax = false; if (isset($lightmap['min'])) { $this->addUsingAlias(MxmapTableMap::COL_LIGHTMAP, $lightmap['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($lightmap['max'])) { $this->addUsingAlias(MxmapTableMap::COL_LIGHTMAP, $lightmap['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11345
MxmapQuery.filterByExeversion
train
public function filterByExeversion($exeversion = null, $comparison = null) { if (null === $comparison) { if (is_array($exeversion)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11346
MxmapQuery.filterByExebuild
train
public function filterByExebuild($exebuild = null, $comparison = null) { if (null === $comparison) { if (is_array($exebuild)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11347
MxmapQuery.filterByEnvironmentname
train
public function filterByEnvironmentname($environmentname = null, $comparison = null) { if (null === $comparison) { if (is_array($environmentname)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11348
MxmapQuery.filterByVehiclename
train
public function filterByVehiclename($vehiclename = null, $comparison = null) { if (null === $comparison) { if (is_array($vehiclename)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11349
MxmapQuery.filterByUnlimiterrequired
train
public function filterByUnlimiterrequired($unlimiterrequired = null, $comparison = null) { if (is_string($unlimiterrequired)) { $unlimiterrequired =
php
{ "resource": "" }
q11350
MxmapQuery.filterByRoutename
train
public function filterByRoutename($routename = null, $comparison = null) { if (null === $comparison) { if (is_array($routename)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11351
MxmapQuery.filterByLengthname
train
public function filterByLengthname($lengthname = null, $comparison = null) { if (null === $comparison) { if (is_array($lengthname)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11352
MxmapQuery.filterByLaps
train
public function filterByLaps($laps = null, $comparison = null) { if (is_array($laps)) { $useMinMax = false; if (isset($laps['min'])) { $this->addUsingAlias(MxmapTableMap::COL_LAPS, $laps['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($laps['max'])) { $this->addUsingAlias(MxmapTableMap::COL_LAPS, $laps['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11353
MxmapQuery.filterByDifficultyname
train
public function filterByDifficultyname($difficultyname = null, $comparison = null) { if (null === $comparison) { if (is_array($difficultyname)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11354
MxmapQuery.filterByReplaytypename
train
public function filterByReplaytypename($replaytypename = null, $comparison = null) { if (null === $comparison) { if (is_array($replaytypename)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11355
MxmapQuery.filterByReplaywrid
train
public function filterByReplaywrid($replaywrid = null, $comparison = null) { if (is_array($replaywrid)) { $useMinMax = false; if (isset($replaywrid['min'])) { $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRID, $replaywrid['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($replaywrid['max'])) { $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRID, $replaywrid['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11356
MxmapQuery.filterByReplaywrtime
train
public function filterByReplaywrtime($replaywrtime = null, $comparison = null) { if (is_array($replaywrtime)) { $useMinMax = false; if (isset($replaywrtime['min'])) { $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRTIME, $replaywrtime['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($replaywrtime['max'])) { $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRTIME, $replaywrtime['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11357
MxmapQuery.filterByReplaywruserid
train
public function filterByReplaywruserid($replaywruserid = null, $comparison = null) { if (is_array($replaywruserid)) { $useMinMax = false; if (isset($replaywruserid['min'])) { $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRUSERID, $replaywruserid['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($replaywruserid['max'])) { $this->addUsingAlias(MxmapTableMap::COL_REPLAYWRUSERID, $replaywruserid['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11358
MxmapQuery.filterByReplaywrusername
train
public function filterByReplaywrusername($replaywrusername = null, $comparison = null) { if (null === $comparison) { if (is_array($replaywrusername)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11359
MxmapQuery.filterByRatingvotecount
train
public function filterByRatingvotecount($ratingvotecount = null, $comparison = null) { if (is_array($ratingvotecount)) { $useMinMax = false; if (isset($ratingvotecount['min'])) { $this->addUsingAlias(MxmapTableMap::COL_RATINGVOTECOUNT, $ratingvotecount['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($ratingvotecount['max'])) { $this->addUsingAlias(MxmapTableMap::COL_RATINGVOTECOUNT, $ratingvotecount['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11360
MxmapQuery.filterByRatingvoteaverage
train
public function filterByRatingvoteaverage($ratingvoteaverage = null, $comparison = null) { if (is_array($ratingvoteaverage)) { $useMinMax = false; if (isset($ratingvoteaverage['min'])) { $this->addUsingAlias(MxmapTableMap::COL_RATINGVOTEAVERAGE, $ratingvoteaverage['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($ratingvoteaverage['max'])) { $this->addUsingAlias(MxmapTableMap::COL_RATINGVOTEAVERAGE, $ratingvoteaverage['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11361
MxmapQuery.filterByReplaycount
train
public function filterByReplaycount($replaycount = null, $comparison = null) { if (is_array($replaycount)) { $useMinMax = false; if (isset($replaycount['min'])) { $this->addUsingAlias(MxmapTableMap::COL_REPLAYCOUNT, $replaycount['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($replaycount['max'])) { $this->addUsingAlias(MxmapTableMap::COL_REPLAYCOUNT, $replaycount['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11362
MxmapQuery.filterByTrackvalue
train
public function filterByTrackvalue($trackvalue = null, $comparison = null) { if (is_array($trackvalue)) { $useMinMax = false; if (isset($trackvalue['min'])) { $this->addUsingAlias(MxmapTableMap::COL_TRACKVALUE, $trackvalue['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($trackvalue['max'])) { $this->addUsingAlias(MxmapTableMap::COL_TRACKVALUE, $trackvalue['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11363
MxmapQuery.filterByComments
train
public function filterByComments($comments = null, $comparison = null) { if (null === $comparison) { if (is_array($comments)) { $comparison = Criteria::IN; }
php
{ "resource": "" }
q11364
MxmapQuery.filterByCommentscount
train
public function filterByCommentscount($commentscount = null, $comparison = null) { if (is_array($commentscount)) { $useMinMax = false; if (isset($commentscount['min'])) { $this->addUsingAlias(MxmapTableMap::COL_COMMENTSCOUNT, $commentscount['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($commentscount['max'])) { $this->addUsingAlias(MxmapTableMap::COL_COMMENTSCOUNT, $commentscount['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11365
MxmapQuery.filterByAwardcount
train
public function filterByAwardcount($awardcount = null, $comparison = null) { if (is_array($awardcount)) { $useMinMax = false; if (isset($awardcount['min'])) { $this->addUsingAlias(MxmapTableMap::COL_AWARDCOUNT, $awardcount['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($awardcount['max'])) { $this->addUsingAlias(MxmapTableMap::COL_AWARDCOUNT, $awardcount['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11366
MxmapQuery.filterByHasscreenshot
train
public function filterByHasscreenshot($hasscreenshot = null, $comparison = null) { if (is_string($hasscreenshot)) { $hasscreenshot =
php
{ "resource": "" }
q11367
MxmapQuery.filterByHasthumbnail
train
public function filterByHasthumbnail($hasthumbnail = null, $comparison = null) { if (is_string($hasthumbnail)) { $hasthumbnail =
php
{ "resource": "" }
q11368
MxmapQuery.filterByHasghostblocks
train
public function filterByHasghostblocks($hasghostblocks = null, $comparison = null) { if (is_string($hasghostblocks)) { $hasghostblocks =
php
{ "resource": "" }
q11369
MxmapQuery.filterByEmbeddedobjectscount
train
public function filterByEmbeddedobjectscount($embeddedobjectscount = null, $comparison = null) { if (is_array($embeddedobjectscount)) { $useMinMax = false; if (isset($embeddedobjectscount['min'])) { $this->addUsingAlias(MxmapTableMap::COL_EMBEDDEDOBJECTSCOUNT, $embeddedobjectscount['min'], Criteria::GREATER_EQUAL); $useMinMax = true; } if (isset($embeddedobjectscount['max'])) { $this->addUsingAlias(MxmapTableMap::COL_EMBEDDEDOBJECTSCOUNT, $embeddedobjectscount['max'], Criteria::LESS_EQUAL); $useMinMax = true;
php
{ "resource": "" }
q11370
MxmapQuery.filterByMap
train
public function filterByMap($map, $comparison = null) { if ($map instanceof \eXpansion\Bundle\Maps\Model\Map) { return $this ->addUsingAlias(MxmapTableMap::COL_TRACKUID, $map->getMapuid(), $comparison); } elseif ($map instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this
php
{ "resource": "" }
q11371
MxmapQuery.useMapQuery
train
public function useMapQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinMap($relationAlias, $joinType)
php
{ "resource": "" }
q11372
LogglyFormatter.format
train
public function format(array $record) { if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) { $record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
php
{ "resource": "" }
q11373
SuccessController.init
train
public function init() { parent::init(); $reservation = $this->getReservation(); // If we get to the success controller form any state except PENDING or PAID // This would mean someone would be clever and change the url from summary to success bypassing the payment // End the session, thus removing the reservation, and redirect back if (!in_array($reservation->Status, array('PENDING', 'PAID'))) {
php
{ "resource": "" }
q11374
Config.loadAndMerge
train
public function loadAndMerge(string $filename) { # Attempt to load config file if ( \file_exists($filename) ) { # Set filename $this->filename = $filename; # Load the config $configArray = \json_decode( \file_get_contents($filename), true); if ($configArray) { // $configArray = $this->array_change_key_case_recursive($configArray); // Lowercase the keys # Merge
php
{ "resource": "" }
q11375
NativeMailerHandler.addHeader
train
public function addHeader($headers) { foreach ((array) $headers as $header) { if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) {
php
{ "resource": "" }
q11376
Dlstats.logDLStats
train
protected function logDLStats() { $q = \Database::getInstance()->prepare("SELECT id FROM `tl_dlstats` WHERE `filename`=?") ->execute($this->_filename); if ($q->next()) { $this->_statId = $q->id; \Database::getInstance()->prepare("UPDATE `tl_dlstats` SET `tstamp`=?, `downloads`=`downloads`+1 WHERE `id`=?")
php
{ "resource": "" }
q11377
Vote.countVote
train
protected function countVote($toCount) { $value = 0; foreach ($this->votes as $login
php
{ "resource": "" }
q11378
BaseController.generateEtag
train
protected function generateEtag(\DateTime $timeStamp) { $user = $this->securityService->findGitUser();
php
{ "resource": "" }
q11379
FileSystemTrait.scanDirectory
train
public function scanDirectory($directory) { $extensions = $this->getOption('extensions'); foreach (scandir($directory) as $object) { if ($object === '.' || $object === '..') { continue; } $inputFile = $directory.DIRECTORY_SEPARATOR.$object; if (is_dir($inputFile)) {
php
{ "resource": "" }
q11380
PollCommand.execute
train
protected function execute(InputInterface $input, OutputInterface $output) { $pollerNames = $input->getOption('poller'); $forceFullSync = $input->getOption('force-full-sync'); if ($pollerNames) { $pollersToRun = []; foreach ($pollerNames as $name) { $pollersToRun[] = $this->pollerCollection->getPoller($name); } } else { $pollersToRun = $this->pollerCollection; }
php
{ "resource": "" }
q11381
PollCommand.runPoller
train
private function runPoller(Poller $poller, $forceFullSync, OutputInterface $output) { $output->write( sprintf("Run poller <info>%s</info>, force mode is <comment>%s</comment>: ", $poller->getName(), $forceFullSync ? 'on' : 'off') ); try { $processed = $poller->poll($forceFullSync);
php
{ "resource": "" }
q11382
ConfigHandler.getAvailableOverrides
train
public function getAvailableOverrides() { $path = $this->getPath(); $suffix = $this->getSuffix(); $glob = "{$path}/*{$suffix}"; $result = []; foreach (glob($glob) as $file) {
php
{ "resource": "" }
q11383
ConfigHandler.setFormat
train
public function setFormat($format) { if ($format) { $format = strtolower($format); if (!in_array($format, static::$validFormats)) { throw new Exception("Format {$format} is not supported"); }
php
{ "resource": "" }
q11384
Dedimania.sendRequest
train
final public function sendRequest(Request $request, $callback) { if ($this->enabled->get() == false) { return; } $this->webaccess->request( self::dedimaniaUrl,
php
{ "resource": "" }
q11385
Dedimania.setGReplay
train
protected function setGReplay($login) { if ($this->enabled->get() == false) { return; } $tempReplay = new IXR_Base64(""); $this->dedimaniaService->setGReplay("", $tempReplay); $player = new Player(); $player->login = $login; try { $this->factory->getConnection()->saveBestGhostsReplay($player, "exp2_temp_replay"); $replay = new IXR_Base64( $this->fileSystem->getUserData()->readAndDelete(
php
{ "resource": "" }
q11386
Dedimania.onEndMapStart
train
public function onEndMapStart($count, $time, $restarted, Map $map) { if ($this->enabled->get() == false)
php
{ "resource": "" }
q11387
MbWrapper.getNormalizedCharset
train
private function getNormalizedCharset($charset) { $upper = null; if (is_array($charset)) {
php
{ "resource": "" }
q11388
MbWrapper.getMbCharset
train
private function getMbCharset($cs) { $normalized = $this->getNormalizedCharset($cs); if (array_key_exists($normalized, self::$mbListedEncodings)) { return self::$mbListedEncodings[$normalized];
php
{ "resource": "" }
q11389
MxKarma.setVote
train
public function setVote($login, $vote) { $player = $this->playerStorage->getPlayerInfo($login); $obj = [ "login" => $login, "nickname" => $player->getNickName(), "vote" => $vote, ];
php
{ "resource": "" }
q11390
MxKarma.onStartMapEnd
train
public function onStartMapEnd($count, $time, $restarted, Map $map) { $this->startTime = time();
php
{ "resource": "" }
q11391
MxKarma.onEndMapEnd
train
public function onEndMapEnd($count, $time, $restarted, Map $map) { if (!empty($this->changedVotes)) { $votes = []; foreach ($this->changedVotes as $vote) { $votes[] =
php
{ "resource": "" }
q11392
RequestHandler.add
train
public function add($middleware) { if (!is_string($middleware) && !$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException('Middleware must be
php
{ "resource": "" }
q11393
RequestHandler.prepend
train
public function prepend($middleware) { if (!is_string($middleware) && !$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException('Middleware must be
php
{ "resource": "" }
q11394
RequestHandler.dispatch
train
public function dispatch(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
php
{ "resource": "" }
q11395
RequestHandler.handle
train
public function handle(ServerRequestInterface $request): ResponseInterface { if (!isset($this->middleware[$this->index])) { return $this->response; }
php
{ "resource": "" }
q11396
QueueService.push
train
public function push(array $message, callable $messageHandler) { $this->beanstalkMapper->put(serialize( array_merge(
php
{ "resource": "" }
q11397
MethodGetNumberLapsDataProvider.request
train
public function request() { $scriptSettings = $this->gameDataStorage->getScriptOptions(); $currentMap = $this->mapStorage->getCurrentMap(); $nbLaps = 1; if ($currentMap->lapRace) { $nbLaps = $currentMap->nbLaps;
php
{ "resource": "" }
q11398
EloquentJournalVoucher.getMaxJournalVoucherNumber
train
public function getMaxJournalVoucherNumber($id, $databaseConnectionName = null) { if(empty($databaseConnectionName)) { $databaseConnectionName = $this->databaseConnectionName; } return
php
{ "resource": "" }
q11399
EloquentJournalVoucher.getByOrganizationByPeriodAndByStatus
train
public function getByOrganizationByPeriodAndByStatus($organizationId, $periodIds, $status, $databaseConnectionName = null) { if(empty($databaseConnectionName)) { $databaseConnectionName = $this->databaseConnectionName; } return $this->JournalVoucher->setConnection($databaseConnectionName)
php
{ "resource": "" }