_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q8100 | XMLAssertTrait.assertXMLMatchesXSD | train | public static function assertXMLMatchesXSD($XSD, $XML, string $message = '')
{
if (!is_string($XSD)) {
throw AssertHelper::createArgumentException(__TRAIT__, 'assertXMLMatchesXSD', 'string', $XSD);
}
AssertHelper::assertMethodDependency(__CLASS__, __TRAIT__, 'assertXMLMatchesXSD... | php | {
"resource": ""
} |
q8101 | XMLAssertTrait.assertXMLValid | train | public static function assertXMLValid($XML, string $message = '')
{
AssertHelper::assertMethodDependency(__CLASS__, __TRAIT__, 'assertXMLValid', ['assertThat']);
self::assertThat($XML, new XMLValidConstraint(), $message);
} | php | {
"resource": ""
} |
q8102 | BlendableLoader.getBlendablePlugin | train | public function getBlendablePlugin($name)
{
/** @var \LCI\Blend\Blendable\Plugin $plugin */
$plugin = new Plugin($this->modx, $this->blender, $name);
return $plugin->setSeedsDir($this->blender->getSeedsDir());
} | php | {
"resource": ""
} |
q8103 | BlendableLoader.getBlendableSnippet | train | public function getBlendableSnippet($name)
{
/** @var Snippet $snippet */
$snippet = new Snippet($this->modx, $this->blender, $name);
return $snippet->setSeedsDir($this->blender->getSeedsDir());
} | php | {
"resource": ""
} |
q8104 | BlendableLoader.getBlendableTemplate | train | public function getBlendableTemplate($name)
{
/** @var \LCI\Blend\Blendable\Template $template */
$template = new Template($this->modx, $this->blender, $name);
return $template->setSeedsDir($this->blender->getSeedsDir());
} | php | {
"resource": ""
} |
q8105 | BlendableLoader.getBlendableTemplateVariable | train | public function getBlendableTemplateVariable($name)
{
/** @var \LCI\Blend\Blendable\TemplateVariable $tv */
$tv = new TemplateVariable($this->modx, $this->blender, $name);
return $tv->setSeedsDir($this->blender->getSeedsDir());
} | php | {
"resource": ""
} |
q8106 | Convolution.assertValidMatrix | train | private function assertValidMatrix(array $matrix)
{
$count = count($matrix);
if ($count === 3) {
for ($x = 0; $x < $count; $x++) {
if (!is_array($matrix[$x])) {
throw new \RuntimeException(sprintf(
'Item "%d" In The Given Ma... | php | {
"resource": ""
} |
q8107 | Canonical.canonicalRedirectQueryStringStrategy | train | protected function canonicalRedirectQueryStringStrategy () {
/** @var $request \MvcCore\Request */
$request = & $this->request;
$redirectToCanonicalUrl = FALSE;
$requestGlobalGet = & $request->GetGlobalCollection('get');
$requestedCtrlDc = isset($requestGlobalGet[static::URL_PARAM_CONTROLLER]) ? $requestGloba... | php | {
"resource": ""
} |
q8108 | Canonical.canonicalRedirectRewriteRoutesStrategy | train | protected function canonicalRedirectRewriteRoutesStrategy () {
/** @var $request \MvcCore\Request */
$request = & $this->request;
$redirectToCanonicalUrl = FALSE;
$defaultParams = $this->GetDefaultParams() ?: [];
list($selfUrlDomainAndBasePart, $selfUrlPathAndQueryPart) = $this->currentRoute->Url(
$reque... | php | {
"resource": ""
} |
q8109 | UrlRewriteProductCategoryRepository.load | train | public function load($urlRewriteId)
{
// initialize the parameters
$params = array(MemberNames::URL_REWRITE_ID => $urlRewriteId);
// load and return the URL rewrite product category relation
$this->urlRewriteProductCategoryStmt->execute($params);
return $this->urlRewritePro... | php | {
"resource": ""
} |
q8110 | UrlRewriteProductCategoryRepository.findAllBySku | train | public function findAllBySku($sku)
{
// initialize the params
$params = array(MemberNames::SKU => $sku);
// load and return the URL rewrite product category relations for the passed SKU
$this->urlRewriteProductCategoriesBySkuStmt->execute($params);
return $this->urlRewriteP... | php | {
"resource": ""
} |
q8111 | Player.getStats | train | public function getStats()
{
if ($this->stats) {
return $this->stats;
}
return $this->stats = $this->api->stats($this->getDisplayName());
} | php | {
"resource": ""
} |
q8112 | Player.getCombatLevel | train | public function getCombatLevel($float = false)
{
$stats = $this->getStats();
return $this->api->calculateCombatLevel(
$stats->findByClass(Attack::class)->getLevel(),
$stats->findByClass(Strength::class)->getLevel(),
$stats->findByClass(Magic::class)->getLevel(),
... | php | {
"resource": ""
} |
q8113 | Reports.init | train | public function init() {
if (VERBOSE) echo 'INIT:' ,PHP_EOL;
if (VERBOSE) echo ' CONNECTING API' ,PHP_EOL;
$this->api->auth();
if (VERBOSE) echo ' API CONNECTED' ,PHP_EOL;
if (VERBOSE) echo ' CONNECTING SQL' ,PHP_EOL;
$this->db->connect();
if (VERBOSE) echo ' SQL ... | php | {
"resource": ""
} |
q8114 | Reports.importDumps | train | public function importDumps() {
if (VERBOSE) echo 'GETTING DUMP LIST',PHP_EOL;
$dumps = $this->api->api('/reports/dumps', 'GET');
if (VERBOSE) echo 'GOT DUMP LIST',PHP_EOL;
$dumps = array_reverse($dumps);
if (VERBOSE) echo 'EXECUTING DUMPS!',PHP_EOL;
foreach ($dumps as $... | php | {
"resource": ""
} |
q8115 | Reports.dump | train | public function dump($id) {
if (VERBOSE) echo " DUMP $id" ,PHP_EOL;
$filename = $this->dumps_dir . 'dump-' . $id . '.tar.gz';
if (file_exists($filename)) {
// skip
if (VERBOSE) echo " SKIPPING : $filename exists" ,PHP_EOL;
return false;
} else {
... | php | {
"resource": ""
} |
q8116 | Sharpen.setType | train | public function setType($type)
{
if (!array_key_exists($type, self::$Supported)) {
throw new \InvalidArgumentException(sprintf(
'Invalid Sharpen Type "%s"', $type
));
}
$this->type = $type;
} | php | {
"resource": ""
} |
q8117 | Result.seek | train | public function seek($row)
{
switch ($this->mode) {
case "mysql":
$this->result->data_seek($row);
break;
case "postgres":
case "redshift":
pg_result_seek($this->result, $row);
break;
case "odb... | php | {
"resource": ""
} |
q8118 | Result.count | train | public function count()
{
switch ($this->mode) {
case "mysql":
$rows = $this->result->num_rows;
break;
case "postgres":
case "redshift":
$rows = pg_num_rows($this->result);
break;
case "odbc":... | php | {
"resource": ""
} |
q8119 | Result.columnCount | train | public function columnCount()
{
switch ($this->mode) {
case "mysql":
$columns = $this->result->field_count;
break;
case "postgres":
case "redshift":
$columns = pg_num_fields($this->result);
break;
... | php | {
"resource": ""
} |
q8120 | Result.free | train | public function free()
{
switch ($this->mode) {
case "mysql":
$this->result->free();
break;
case "postgres":
case "redshift":
pg_free_result($this->result);
break;
case "odbc":
... | php | {
"resource": ""
} |
q8121 | Collection.getAssetsOnlyRaw | train | public function getAssetsOnlyRaw($group = null)
{
// Get all the assets for the given group and filter out assets that aren't listed
// as being raw.
$assets = $this->getAssets($group, true)->filter(function($asset)
{
return $asset->isRaw();
});
return $a... | php | {
"resource": ""
} |
q8122 | Collection.getAssets | train | public function getAssets($group = null, $raw = true)
{
// Spin through all of the assets that belong to the given group and push them on
// to the end of the array.
$assets = clone $this->directory->getAssets();
foreach ($assets as $key => $asset)
{
if ( ! $raw ... | php | {
"resource": ""
} |
q8123 | Collection.orderAsset | train | protected function orderAsset(Asset $asset, array &$assets)
{
$order = $asset->getOrder() and $order--;
// If an asset already exists at the given order key then we'll add one to the order
// so the asset essentially appears after the existing asset. This makes sense since
// the ar... | php | {
"resource": ""
} |
q8124 | Builder.build | train | public function build()
{
$this->overseer->clearRoles();
if (isset($this->config['roles'])) {
$this->saveRoles($this->config['roles']);
}
$this->overseer->clearPermissions();
if (isset($this->config['permissions'])) {
$this->savePermissions($this->c... | php | {
"resource": ""
} |
q8125 | HttpResponse.getBody | train | public function getBody() {
if (!isset($this->body)) {
$contentType = $this->getHeader('Content-Type');
if (stripos($contentType, 'application/json') !== false) {
$this->body = json_decode($this->rawBody, true);
} else {
$this->body = $this->r... | php | {
"resource": ""
} |
q8126 | HttpResponse.isResponseClass | train | public function isResponseClass(string $class): bool {
$pattern = '`^'.str_ireplace('x', '\d', preg_quote($class, '`')).'$`';
$result = preg_match($pattern, $this->statusCode);
return $result === 1;
} | php | {
"resource": ""
} |
q8127 | HttpResponse.setRawBody | train | public function setRawBody(string $body) {
$this->rawBody = $body;
$this->body = null;
return $this;
} | php | {
"resource": ""
} |
q8128 | HttpResponse.setStatus | train | public function setStatus($code, $reasonPhrase = null) {
if (preg_match('`(?:HTTP/([\d.]+)\s+)?(\d{3})\s*(.*)`i', $code, $matches)) {
$this->protocolVersion = $matches[1] ?: $this->protocolVersion;
$code = (int)$matches[2];
$reasonPhrase = $reasonPhrase ?: $matches[3];
... | php | {
"resource": ""
} |
q8129 | HttpResponse.parseStatusLine | train | private function parseStatusLine($headers): string {
if (empty($headers)) {
return '';
}
if (is_string($headers)) {
if (preg_match_all('`(?:^|\n)(HTTP/[^\r]+)\r\n`', $headers, $matches)) {
$firstLine = end($matches[1]);
} else {
... | php | {
"resource": ""
} |
q8130 | HttpResponse.offsetGet | train | public function offsetGet($offset) {
$this->getBody();
$result = isset($this->body[$offset]) ? $this->body[$offset] : null;
return $result;
} | php | {
"resource": ""
} |
q8131 | ScriptContainerTrait.withScript | train | public function withScript(ScriptElement $script, $scope = 'header')
{
// These are the only legal values.
assert(in_array($scope, ['header', 'footer']));
$that = clone($this);
$that->scripts[$scope][] = $script;
return $that;
} | php | {
"resource": ""
} |
q8132 | Transformation.rotate | train | public function rotate($degree, ColorInterface $background = null)
{
return $this->apply(new Rotate($degree, $background));
} | php | {
"resource": ""
} |
q8133 | Transformation.watermark | train | public function watermark(CanvasInterface $watermark, Coordinate $cooridnate = null)
{
return $this->apply(new Watermark($watermark, $cooridnate));
} | php | {
"resource": ""
} |
q8134 | Transformation.overlay | train | public function overlay(CanvasInterface $overlay, $mount = 100, Box $box = null)
{
return $this->apply(new Overlay($overlay, $mount, $box));
} | php | {
"resource": ""
} |
q8135 | Transformation.overlayWatermark | train | public function overlayWatermark(CanvasInterface $watermark, Coordinate $cooridnate = null, $mount = 100)
{
return $this->overlay($watermark, $mount, new Box($watermark->getDimension(), $cooridnate));
} | php | {
"resource": ""
} |
q8136 | RewriteRouting.rewriteRouting | train | protected function rewriteRouting ($requestCtrlName, $requestActionName) {
$request = & $this->request;
$requestedPathFirstWord = $this->rewriteRoutingGetReqPathFirstWord();
$this->rewriteRoutingProcessPreHandler($requestedPathFirstWord);
$routes = & $this->rewriteRoutingGetRoutesToMatch($requestedPathFirstWord... | php | {
"resource": ""
} |
q8137 | RewriteRouting.rewriteRoutingProcessPreHandler | train | protected function rewriteRoutingProcessPreHandler ($firstPathWord) {
if ($this->preRouteMatchingHandler === NULL) return;
call_user_func($this->preRouteMatchingHandler, $this, $this->request, $firstPathWord);
} | php | {
"resource": ""
} |
q8138 | RewriteRouting.& | train | protected function & rewriteRoutingGetRoutesToMatch ($firstPathWord) {
if (isset($this->routesGroups[$firstPathWord])) {
$routes = & $this->routesGroups[$firstPathWord];
} else if (isset($this->routesGroups[''])) {
$routes = & $this->routesGroups[''];
} else {
$routes = [];
}
reset($routes);
return... | php | {
"resource": ""
} |
q8139 | RewriteRouting.rewriteRoutingCheckRoute | train | protected function rewriteRoutingCheckRoute (\MvcCore\IRoute & $route, array $additionalInfo) {
list ($requestMethod,) = $additionalInfo;
$routeMethod = $route->GetMethod();
if ($routeMethod !== NULL && $routeMethod !== $requestMethod) return TRUE;
return FALSE;
} | php | {
"resource": ""
} |
q8140 | RewriteRouting.rewriteRoutingSetRequestedAndDefaultParams | train | protected function rewriteRoutingSetRequestedAndDefaultParams (array & $allMatchedParams, $requestCtrlName = NULL, $requestActionName = NULL) {
/** @var $this \MvcCore\Router */
// in array `$allMatchedParams` - there could be sometimes presented matched
// or route specified values from configuration already, u... | php | {
"resource": ""
} |
q8141 | RewriteRouting.rewriteRoutingSetRequestParams | train | protected function rewriteRoutingSetRequestParams (array & $allMatchedParams) {
$request = & $this->request;
$defaultParamsBefore = array_merge([], $this->defaultParams);
$requestParams = array_merge([], $this->defaultParams);
// filter request params
list($success, $requestParamsFiltered) = $this->currentRou... | php | {
"resource": ""
} |
q8142 | RewriteRouting.rewriteRoutingSetUpCurrentRouteByRequest | train | protected function rewriteRoutingSetUpCurrentRouteByRequest () {
$request = & $this->request;
$toolClass = self::$toolClass;
$this->currentRoute
->SetController(str_replace(['/', '\\\\'], ['\\', '//'],
$toolClass::GetPascalCaseFromDashed($request->GetControllerName())
))
->SetAction(
$toolClass::... | php | {
"resource": ""
} |
q8143 | Timing.time | train | public function time(string $name, string $message = null): TimerContract
{
$id = isset($this->timers[$name]) ? \uniqid($name) : $name;
$this->timers[$id] = $this->createTimer($name, \microtime(true), $message);
return $this->timers[$id];
} | php | {
"resource": ""
} |
q8144 | Timing.timeEnd | train | public function timeEnd($name = null): void
{
$timer = $name instanceof TimerContract ? $name : $this->resolveTimerFromName($name);
$timer->end();
} | php | {
"resource": ""
} |
q8145 | Timing.resolveTimerFromName | train | protected function resolveTimerFromName(string $name = null): TimerContract
{
$id = \is_null($name) ? \uniqid() : $name;
if (isset($this->timers[$id])) {
return $this->timers[$id];
}
return $this->createTimer($name, constant('LARAVEL_START'));
} | php | {
"resource": ""
} |
q8146 | Timing.createTimer | train | protected function createTimer(string $name, $startedAt, string $message = null): TimerContract
{
return (new Timer($name, $startedAt, $message))->setLogger($this->getLogger());
} | php | {
"resource": ""
} |
q8147 | CollectionsMethods.HasHeader | train | public function HasHeader ($name = '') {
if ($this->headers === NULL) $this->initHeaders();
return isset($this->headers[$name]);
} | php | {
"resource": ""
} |
q8148 | CollectionsMethods.& | train | public function & SetParam ($name = '', $value = '') {
/** @var $this \MvcCore\Request */
if ($this->params === NULL) $this->initParams();
$this->params[$name] = $value;
return $this;
} | php | {
"resource": ""
} |
q8149 | CollectionsMethods.& | train | public function & RemoveParam ($name = '') {
/** @var $this \MvcCore\Request */
if ($this->params === NULL) $this->initParams();
unset($this->params[$name]);
return $this;
} | php | {
"resource": ""
} |
q8150 | Entry.addDevelopmentAsset | train | public function addDevelopmentAsset($value, $fingerprint = null, $group = null)
{
if ($value instanceof Asset)
{
$group = $value->getGroup();
$fingerprint = $value->getBuildPath();
$value = $value->getRelativePath();
}
$this->development[$group]... | php | {
"resource": ""
} |
q8151 | Entry.getDevelopmentAsset | train | public function getDevelopmentAsset($value, $group = null)
{
if ($value instanceof Asset)
{
$group = $value->getGroup();
$value = $value->getRelativePath();
}
return isset($this->development[$group][$value]) ? $this->development[$group][$value] : null;
} | php | {
"resource": ""
} |
q8152 | Entry.getDevelopmentAssets | train | public function getDevelopmentAssets($group = null)
{
return is_null($group) ? $this->development : $this->development[$group];
} | php | {
"resource": ""
} |
q8153 | Entry.hasDevelopmentAssets | train | public function hasDevelopmentAssets($group = null)
{
return is_null($group) ? ! empty($this->development) : ! empty($this->development[$group]);
} | php | {
"resource": ""
} |
q8154 | Entry.resetDevelopmentAssets | train | public function resetDevelopmentAssets($group = null)
{
if (is_null($group))
{
$this->development = array();
}
else
{
$this->development[$group] = array();
}
} | php | {
"resource": ""
} |
q8155 | Entry.getProductionFingerprint | train | public function getProductionFingerprint($group)
{
return isset($this->fingerprints[$group]) ? $this->fingerprints[$group] : null;
} | php | {
"resource": ""
} |
q8156 | Filter.findMissingConstructorArgs | train | public function findMissingConstructorArgs()
{
try
{
$class = new ReflectionClass($this->getClassName());
}
catch (ReflectionException $e)
{
return $this;
}
if ($constructor = $class->getConstructor())
{
$finder = $... | php | {
"resource": ""
} |
q8157 | Filter.whenAssetIs | train | public function whenAssetIs($pattern)
{
return $this->when(function($asset) use ($pattern)
{
return (bool) preg_match('#'.$pattern.'#', $asset->getRelativePath());
});
} | php | {
"resource": ""
} |
q8158 | Filter.whenEnvironmentIs | train | public function whenEnvironmentIs()
{
$environments = func_get_args();
$appEnvironment = $this->appEnvironment;
return $this->when(function($asset) use ($environments, $appEnvironment)
{
return in_array($appEnvironment, $environments);
});
} | php | {
"resource": ""
} |
q8159 | Filter.setArgument | train | public function setArgument($argument, $position = null)
{
array_splice($this->arguments, $position ?: count($this->arguments), 0, array($argument));
return $this;
} | php | {
"resource": ""
} |
q8160 | Filter.getInstance | train | public function getInstance()
{
if ( ! $class = $this->getClassName())
{
$this->log->error(sprintf('"%s" will not be applied to asset "%s" due to an invalid filter name.', $this->filter, $this->resource->getRelativePath()));
}
if ($this->ignored or is_null($class) or ! $... | php | {
"resource": ""
} |
q8161 | Filter.processRequirements | train | public function processRequirements()
{
foreach ($this->requirements as $requirement)
{
if ( ! call_user_func($requirement, $this->resource, $this))
{
return false;
}
}
return true;
} | php | {
"resource": ""
} |
q8162 | CacheListClassLoader.loadClass | train | public function loadClass($class)
{
$result = $this->loadCachedClass($class);
if ($result === false) {
$result = parent::loadClass($class);
}
if ($this->verbose) {
return $result !== false;
}
} | php | {
"resource": ""
} |
q8163 | CacheListClassLoader.loadCachedClass | train | private function loadCachedClass($class)
{
$result = false;
if (isset($this->cache[$class])) {
$result = include $this->cache[$class];
if ($result === false) {
unset($this->cache[$class]);
$this->saveCache();
}
}
... | php | {
"resource": ""
} |
q8164 | CacheListClassLoader.loadFile | train | protected function loadFile($file, $class)
{
parent::loadFile($file, $class);
$this->cache[$class] = $file;
$this->saveCache();
return true;
} | php | {
"resource": ""
} |
q8165 | Polygon.addCoordinate | train | public function addCoordinate(Coordinate $coordinate)
{
$this->coordinates[] = $coordinate;
$this->setNumber(count($this->coordinates));
return $this;
} | php | {
"resource": ""
} |
q8166 | Polygon.setCoordinate | train | public function setCoordinate(\ArrayObject $coordinates)
{
$this->coordinates = $coordinates;
$this->setNumber(count($coordinates));
return $this;
} | php | {
"resource": ""
} |
q8167 | Polygon.setNumber | train | public function setNumber($num)
{
$num = (int) $num;
if ($num <= 0) {
throw new \InvalidArgumentException(sprintf(
'Invalid Number "%s" - Polygon Coordinates Number Must Be '
. 'Greater Than Zero'
, $num
));
... | php | {
"resource": ""
} |
q8168 | Polygon.assertPointsArrayLength | train | private function assertPointsArrayLength()
{
if (count($this->getCoordinates()) < self::$MIN_LENGTH) {
throw new \RuntimeException(sprintf(
'There Must Be At Least "%s" Coordinates To Draw A Polygon'
, self::$MIN_LENGTH
));
}
} | php | {
"resource": ""
} |
q8169 | CanBeLiked.likeIt | train | public function likeIt($user = null)
{
if (!$this->isLiked()) {
$this->likes()->create([
'user_id'=> $user ? $user->id : auth()->id()
]);
$this->incrementCount();
}
} | php | {
"resource": ""
} |
q8170 | CanBeLiked.unLikeIt | train | public function unLikeIt($user = null)
{
if ($like = $this->isLiked($user)) {
$like->delete();
$this->decrementCount();
}
} | php | {
"resource": ""
} |
q8171 | CanBeLiked.isLiked | train | public function isLiked($user = null)
{
return $this->likes()->where([
'user_id' => $user ? $user->id : auth()->id(),
'likeable_type' => get_class($this),
'likeable_id' => $this->id
])->first();
} | php | {
"resource": ""
} |
q8172 | CanBeLiked.toggleLike | train | public function toggleLike($user = null)
{
$this->isLiked($user) ? $this->unLikeIt($user) : $this->likeIt($user);
} | php | {
"resource": ""
} |
q8173 | Flatten.byObjectMethod | train | public static function byObjectMethod($values, $method)
{
if (isset($values) && Inspector::isTraversable($values)) {
if (is_array($values)) {
$flat_values = array();
$setter = 'setArrayValue';
} else {
$flat_values = new \stdClass();
... | php | {
"resource": ""
} |
q8174 | Repository.find | train | public function find($id)
{
return Arr::first($this->items, function ($key, Contract $skill) use ($id) {
return $skill->getId() === $id;
}, null);
} | php | {
"resource": ""
} |
q8175 | Repository.findByName | train | public function findByName($name)
{
return Arr::first($this->items, function ($key, Contract $skill) use ($name) {
return $skill->getName() === strtolower($name);
}, null);
} | php | {
"resource": ""
} |
q8176 | Generator.calcMod10V1 | train | public function calcMod10V1(string $number, string $separator = "", int $minimumLength = 6): string
{
$revstr = strrev((string) intval($number));
$revstrLen = strlen($revstr);
$total = 0;
for ($i = 0; $i < $revstrLen; $i++) {
if ($i % 2 == 0) {
$multiplier... | php | {
"resource": ""
} |
q8177 | Request.getCurrentRoute | train | protected function getCurrentRoute(): string
{
$request = resolve(HttpRequest::class);
$method = strtoupper($request->getMethod());
$path = ltrim($request->path(), '/');
$host = $request->getHost();
! is_null($host) && $host = rtrim($host, '/');
return "{$method} {$... | php | {
"resource": ""
} |
q8178 | Gamma.setLevel | train | public function setLevel($level)
{
if (!($level >= 0.01 && $level <= 4.99)) {
throw new \InvalidArgumentException("Gamma Level Must Be In Range(0.01,4.99)");
}
$this->level = (float) $level;
return $this;
} | php | {
"resource": ""
} |
q8179 | ModuleMakeCommand.createConfigFile | train | protected function createConfigFile(string $name): void
{
$file = base_path($this->moduleName().'/'.$name.'/Config/config.php');
if (! $this->files->exists($file)) {
$this->files->put($file, $this->files->get(__DIR__.'/stubs/config.stub'));
}
} | php | {
"resource": ""
} |
q8180 | Rating.getFieldDefinition | train | public function getFieldDefinition($arrOverrides = [])
{
$arrFieldDef = parent::getFieldDefinition($arrOverrides);
$arrFieldDef['inputType'] = 'text';
// We must not change the value.
$arrFieldDef['eval']['disabled'] = true;
return $arrFieldDef;
} | php | {
"resource": ""
} |
q8181 | Rating.getDataFor | train | public function getDataFor($arrIds)
{
$statement = $this->connection->createQueryBuilder()
->select('*')
->from('tl_metamodel_rating')
->andWhere('mid=:mid AND aid=:aid AND iid IN (:iids)')
->setParameter('mid', $this->getMetaModel()->get('id'))
->... | php | {
"resource": ""
} |
q8182 | Rating.unsetDataFor | train | public function unsetDataFor($arrIds)
{
$this->connection->createQueryBuilder()
->delete('tl_metamodel_rating')
->andWhere('mid=:mid AND aid=:aid AND iid IN (:iids)')
->setParameter('mid', $this->getMetaModel()->get('id'))
->setParameter('aid', $this->get('id'... | php | {
"resource": ""
} |
q8183 | Rating.addVote | train | public function addVote($intItemId, $fltValue, $blnLock = false)
{
if ($this->getSessionBag()->get($this->getLockId($intItemId))) {
return;
}
$arrData = $this->getDataFor([$intItemId]);
if (!$arrData || !$arrData[$intItemId]['votecount']) {
$voteCount = 0;... | php | {
"resource": ""
} |
q8184 | Rating.ensureImage | train | protected function ensureImage($uuidImage, $strDefault)
{
$imagePath = ToolboxFile::convertValueToPath($uuidImage);
if (\strlen($imagePath) && \file_exists(TL_ROOT . '/' . $imagePath)) {
return $imagePath;
}
return $strDefault;
} | php | {
"resource": ""
} |
q8185 | Rating.prepareTemplate | train | public function prepareTemplate(Template $objTemplate, $arrRowData, $objSettings)
{
parent::prepareTemplate($objTemplate, $arrRowData, $objSettings);
$base = Environment::get('base');
$lang = $this->getActiveLanguageArray();
$strEmpty = $this->ensureImage(
$this->get('r... | php | {
"resource": ""
} |
q8186 | Rating.sortIds | train | public function sortIds($idList, $strDirection)
{
$statement = $this->connection->createQueryBuilder()
->select('iid')
->from('tl_metamodel_rating')
->andWhere('mid=:mid AND aid=:aid AND iid IN (:iids)')
->setParameter('mid', $this->getMetaModel()->get('id'))
... | php | {
"resource": ""
} |
q8187 | Rating.getSessionBag | train | protected function getSessionBag()
{
if ($this->scopeDeterminator->currentScopeIsBackend()) {
return $this->session->getBag('contao_backend');
}
if ($this->scopeDeterminator->currentScopeIsFrontend()) {
return $this->session->getBag('contao_frontend');
}
... | php | {
"resource": ""
} |
q8188 | GettersSetters.GetMicrotime | train | public function GetMicrotime () {
if ($this->microtime === NULL) $this->microtime = $this->globalServer['REQUEST_TIME_FLOAT'];
return $this->microtime;
} | php | {
"resource": ""
} |
q8189 | GettersSetters.& | train | public function & SetTopLevelDomain ($topLevelDomain) {
/** @var $this \MvcCore\Request */
if ($this->domainParts === NULL) $this->initDomainSegments();
$this->domainParts[2] = $topLevelDomain;
$this->hostName = trim(implode('.', $this->domainParts), '.');
if ($this->hostName && $this->portDefined)
$this-... | php | {
"resource": ""
} |
q8190 | Environment.collection | train | public function collection(string $identifier, ?Closure $callback = null) : Collection {
if ( ! isset($this->collections[$identifier])) {
$directory = $this->prepareDefaultDirectory();
$this->collections[$identifier] = new Collection($directory, $identifier);
}
// If th... | php | {
"resource": ""
} |
q8191 | Environment.prepareDefaultDirectory | train | protected function prepareDefaultDirectory() : Directory {
$path = $this->finder->setWorkingDirectory('/');
return new Directory($this->factory, $this->finder, $path);
} | php | {
"resource": ""
} |
q8192 | Environment.package | train | public function package(string $package, ?string $namespace = null) : void {
if (is_null($namespace)) {
list($vendor, $namespace) = explode('/', $package);
}
$this->finder->addNamespace($namespace, $package);
} | php | {
"resource": ""
} |
q8193 | Environment.collections | train | public function collections(array $collections) : void {
foreach ($collections as $name => $callback) {
$this->make($name, $callback);
}
} | php | {
"resource": ""
} |
q8194 | Environment.offsetGet | train | public function offsetGet($offset) : ?Collection {
return $this->has($offset) ? $this->collection($offset) : null;
} | php | {
"resource": ""
} |
q8195 | FilterFactory.make | train | public function make($filter)
{
if ($filter instanceof Filter)
{
return clone $filter;
}
$filter = isset($this->aliases[$filter]) ? $this->aliases[$filter] : $filter;
if (is_array($filter))
{
list($filter, $callback) = array(current($... | php | {
"resource": ""
} |
q8196 | AbstractResult.getValues | train | public function getValues()
{
while ($row = $this->getNextRow()) {
if ($this->columnCount() > 1) {
$key = rtrim(reset($row));
$val = rtrim(next($row));
yield $key => $val;
} else {
yield rtrim(reset($row));
}... | php | {
"resource": ""
} |
q8197 | AbstractResult.groupBy | train | public function groupBy(...$keys)
{
$data = [];
while ($row = $this->getNextRow()) {
$position = &$data;
foreach ($keys as $key) {
if (is_callable($key)) {
$value = $key($row);
} else {
$value = $row[$... | php | {
"resource": ""
} |
q8198 | Helpers.IsErrorDispatched | train | public function IsErrorDispatched () {
$toolClass = $this->toolClass;
$defaultCtrlName = $toolClass::GetDashedFromPascalCase($this->defaultControllerName);
$errorActionName = $toolClass::GetDashedFromPascalCase($this->defaultControllerErrorActionName);
return $this->request->GetControllerName() == $defaultCtrlN... | php | {
"resource": ""
} |
q8199 | Helpers.IsNotFoundDispatched | train | public function IsNotFoundDispatched () {
$toolClass = $this->toolClass;
$defaultCtrlName = $toolClass::GetDashedFromPascalCase($this->defaultControllerName);
$errorActionName = $toolClass::GetDashedFromPascalCase($this->defaultControllerNotFoundActionName);
return $this->request->GetControllerName() == $defaul... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.