id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3,900 | skimia/assets | src/Scanner/ScannerServiceProvider.php | ScannerServiceProvider.loadScanned | public function loadScanned()
{
if ($this->app->environment('local') && $this->app['config']->get('assets.generate_when_local', false)) {
$this->scanDirectories();
}
$scans = $this->getDirectories();
if (! empty($scans) && $this->getScanner()->isScanned()) {
... | php | public function loadScanned()
{
if ($this->app->environment('local') && $this->app['config']->get('assets.generate_when_local', false)) {
$this->scanDirectories();
}
$scans = $this->getDirectories();
if (! empty($scans) && $this->getScanner()->isScanned()) {
... | [
"public",
"function",
"loadScanned",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"app",
"->",
"environment",
"(",
"'local'",
")",
"&&",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'assets.generate_when_local'",
",",
"false",
")",
... | Load the scanned assets.
@return void | [
"Load",
"the",
"scanned",
"assets",
"."
] | f74b1886659cba78a4d8e3e61ba334b32059faa1 | https://github.com/skimia/assets/blob/f74b1886659cba78a4d8e3e61ba334b32059faa1/src/Scanner/ScannerServiceProvider.php#L59-L70 |
3,901 | agentmedia/phine-forms | src/Forms/Modules/Backend/TextareaForm.php | TextareaForm.AddValueField | private function AddValueField()
{
$name = 'Value';
$field = new Fields\Textarea($name, $this->textarea->GetValue());
$this->AddField($field);
} | php | private function AddValueField()
{
$name = 'Value';
$field = new Fields\Textarea($name, $this->textarea->GetValue());
$this->AddField($field);
} | [
"private",
"function",
"AddValueField",
"(",
")",
"{",
"$",
"name",
"=",
"'Value'",
";",
"$",
"field",
"=",
"new",
"Fields",
"\\",
"Textarea",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"textarea",
"->",
"GetValue",
"(",
")",
")",
";",
"$",
"this",
... | Adds the value field | [
"Adds",
"the",
"value",
"field"
] | cd7a92ea443756bef5885a9e8f59ad6b8d2771fc | https://github.com/agentmedia/phine-forms/blob/cd7a92ea443756bef5885a9e8f59ad6b8d2771fc/src/Forms/Modules/Backend/TextareaForm.php#L137-L142 |
3,902 | agentmedia/phine-forms | src/Forms/Modules/Backend/TextareaForm.php | TextareaForm.SaveElement | protected function SaveElement()
{
$this->textarea->SetLabel($this->Value('Label'));
$this->textarea->SetName($this->Value('Name'));
$this->textarea->SetValue($this->Value('Value'));
$this->textarea->SetPattern($this->Value('Pattern'));
$this->textarea->SetMinLength((int)$thi... | php | protected function SaveElement()
{
$this->textarea->SetLabel($this->Value('Label'));
$this->textarea->SetName($this->Value('Name'));
$this->textarea->SetValue($this->Value('Value'));
$this->textarea->SetPattern($this->Value('Pattern'));
$this->textarea->SetMinLength((int)$thi... | [
"protected",
"function",
"SaveElement",
"(",
")",
"{",
"$",
"this",
"->",
"textarea",
"->",
"SetLabel",
"(",
"$",
"this",
"->",
"Value",
"(",
"'Label'",
")",
")",
";",
"$",
"this",
"->",
"textarea",
"->",
"SetName",
"(",
"$",
"this",
"->",
"Value",
"... | Attaches the basic properties to the textarea element
@return ContentTextarea Returns the textarea content element | [
"Attaches",
"the",
"basic",
"properties",
"to",
"the",
"textarea",
"element"
] | cd7a92ea443756bef5885a9e8f59ad6b8d2771fc | https://github.com/agentmedia/phine-forms/blob/cd7a92ea443756bef5885a9e8f59ad6b8d2771fc/src/Forms/Modules/Backend/TextareaForm.php#L148-L159 |
3,903 | digit-soft/re-action-promise | src/OrderedExecutionQueue.php | OrderedExecutionQueue.next | protected function next()
{
$promiseOrValue = array_shift($this->queue);
$promise = resolve($promiseOrValue);
$this->cancellationQueue->enqueue($promise);
return $promise;
} | php | protected function next()
{
$promiseOrValue = array_shift($this->queue);
$promise = resolve($promiseOrValue);
$this->cancellationQueue->enqueue($promise);
return $promise;
} | [
"protected",
"function",
"next",
"(",
")",
"{",
"$",
"promiseOrValue",
"=",
"array_shift",
"(",
"$",
"this",
"->",
"queue",
")",
";",
"$",
"promise",
"=",
"resolve",
"(",
"$",
"promiseOrValue",
")",
";",
"$",
"this",
"->",
"cancellationQueue",
"->",
"enq... | Get next promise from queue
@return ExtendedPromiseInterface | [
"Get",
"next",
"promise",
"from",
"queue"
] | 9a16b9ca95eeafd3ebcc0a1e8e76ad958c48bac1 | https://github.com/digit-soft/re-action-promise/blob/9a16b9ca95eeafd3ebcc0a1e8e76ad958c48bac1/src/OrderedExecutionQueue.php#L105-L111 |
3,904 | digit-soft/re-action-promise | src/OrderedExecutionQueue.php | OrderedExecutionQueue.createRejectFunction | protected function createRejectFunction($reject)
{
$this->reject = function($reason) use (&$reject) {
$cancelQueue = $this->cancellationQueue;
$cancelQueue();
return isset($reject) ? $reject($reason) : null;
};
} | php | protected function createRejectFunction($reject)
{
$this->reject = function($reason) use (&$reject) {
$cancelQueue = $this->cancellationQueue;
$cancelQueue();
return isset($reject) ? $reject($reason) : null;
};
} | [
"protected",
"function",
"createRejectFunction",
"(",
"$",
"reject",
")",
"{",
"$",
"this",
"->",
"reject",
"=",
"function",
"(",
"$",
"reason",
")",
"use",
"(",
"&",
"$",
"reject",
")",
"{",
"$",
"cancelQueue",
"=",
"$",
"this",
"->",
"cancellationQueue... | Create reject function with cancellation queue
@param callable|null $reject | [
"Create",
"reject",
"function",
"with",
"cancellation",
"queue"
] | 9a16b9ca95eeafd3ebcc0a1e8e76ad958c48bac1 | https://github.com/digit-soft/re-action-promise/blob/9a16b9ca95eeafd3ebcc0a1e8e76ad958c48bac1/src/OrderedExecutionQueue.php#L125-L132 |
3,905 | franzip/serp-fetcher | src/Helpers/FileSystemHelper.php | FileSystemHelper.validateCache | public static function validateCache($file, $cacheTTL, $cacheForever)
{
$currentTime = time();
$expireTime = $cacheTTL * 60 * 60;
$fileTime = filemtime($file);
return ($currentTime - $expireTime < $fileTime)
or $cacheForever;
} | php | public static function validateCache($file, $cacheTTL, $cacheForever)
{
$currentTime = time();
$expireTime = $cacheTTL * 60 * 60;
$fileTime = filemtime($file);
return ($currentTime - $expireTime < $fileTime)
or $cacheForever;
} | [
"public",
"static",
"function",
"validateCache",
"(",
"$",
"file",
",",
"$",
"cacheTTL",
",",
"$",
"cacheForever",
")",
"{",
"$",
"currentTime",
"=",
"time",
"(",
")",
";",
"$",
"expireTime",
"=",
"$",
"cacheTTL",
"*",
"60",
"*",
"60",
";",
"$",
"fil... | Check if a given cache entry is still valid.
Will always return true if permanent caching has been set on.
@param string $file
@param int $cacheTTL
@param bool $cacheForever
@return bool | [
"Check",
"if",
"a",
"given",
"cache",
"entry",
"is",
"still",
"valid",
".",
"Will",
"always",
"return",
"true",
"if",
"permanent",
"caching",
"has",
"been",
"set",
"on",
"."
] | 0554b682a8e4aec6e5d615866087b34e731e0d88 | https://github.com/franzip/serp-fetcher/blob/0554b682a8e4aec6e5d615866087b34e731e0d88/src/Helpers/FileSystemHelper.php#L19-L26 |
3,906 | kreta-plugins/VCS | src/Kreta/Component/VCS/Repository/BranchRepository.php | BranchRepository.findOrCreateBranch | public function findOrCreateBranch(RepositoryInterface $repository, $branchName)
{
try {
return $this->findOneBy(['name' => $branchName, 'repository' => $repository], false);
} catch (NoResultException $e) {
$branch = new Branch();
$branch
->setNam... | php | public function findOrCreateBranch(RepositoryInterface $repository, $branchName)
{
try {
return $this->findOneBy(['name' => $branchName, 'repository' => $repository], false);
} catch (NoResultException $e) {
$branch = new Branch();
$branch
->setNam... | [
"public",
"function",
"findOrCreateBranch",
"(",
"RepositoryInterface",
"$",
"repository",
",",
"$",
"branchName",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"findOneBy",
"(",
"[",
"'name'",
"=>",
"$",
"branchName",
",",
"'repository'",
"=>",
"$",
"r... | Tries to find a branch by repository and branch name and throws exception if is not able to do so.
@param \Kreta\Component\VCS\Model\Interfaces\RepositoryInterface $repository The repository
@param string $branchName The branch name
@return \Kreta\Component\VCS\Model... | [
"Tries",
"to",
"find",
"a",
"branch",
"by",
"repository",
"and",
"branch",
"name",
"and",
"throws",
"exception",
"if",
"is",
"not",
"able",
"to",
"do",
"so",
"."
] | 0b6daae2b8044d9250adc8009d03a6745370cd2e | https://github.com/kreta-plugins/VCS/blob/0b6daae2b8044d9250adc8009d03a6745370cd2e/src/Kreta/Component/VCS/Repository/BranchRepository.php#L36-L50 |
3,907 | factorio-item-browser/api-database | src/Repository/IconRepository.php | IconRepository.findDataByTypesAndNames | public function findDataByTypesAndNames(array $namesByTypes, array $modCombinationIds = []): array
{
$columns = [
'i.id AS id',
'IDENTITY(i.file) AS hash',
'i.type AS type',
'i.name AS name',
'mc.order AS order'
];
$queryBuilder = ... | php | public function findDataByTypesAndNames(array $namesByTypes, array $modCombinationIds = []): array
{
$columns = [
'i.id AS id',
'IDENTITY(i.file) AS hash',
'i.type AS type',
'i.name AS name',
'mc.order AS order'
];
$queryBuilder = ... | [
"public",
"function",
"findDataByTypesAndNames",
"(",
"array",
"$",
"namesByTypes",
",",
"array",
"$",
"modCombinationIds",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"columns",
"=",
"[",
"'i.id AS id'",
",",
"'IDENTITY(i.file) AS hash'",
",",
"'i.type AS type'",... | Finds the data of the specified entities.
@param array|string[][] $namesByTypes
@param array|int[] $modCombinationIds
@return array|IconData[] | [
"Finds",
"the",
"data",
"of",
"the",
"specified",
"entities",
"."
] | c3a27e5673462a58b5afafc0ea0e0002f6db9803 | https://github.com/factorio-item-browser/api-database/blob/c3a27e5673462a58b5afafc0ea0e0002f6db9803/src/Repository/IconRepository.php#L24-L60 |
3,908 | factorio-item-browser/api-database | src/Repository/IconRepository.php | IconRepository.findDataByHashes | public function findDataByHashes(array $hashes, array $modCombinationIds = []): array
{
$result = [];
if (count($hashes) > 0) {
$columns = [
'i.id AS id',
'IDENTITY(i.file) AS hash',
'i.type AS type',
'i.name AS name',
... | php | public function findDataByHashes(array $hashes, array $modCombinationIds = []): array
{
$result = [];
if (count($hashes) > 0) {
$columns = [
'i.id AS id',
'IDENTITY(i.file) AS hash',
'i.type AS type',
'i.name AS name',
... | [
"public",
"function",
"findDataByHashes",
"(",
"array",
"$",
"hashes",
",",
"array",
"$",
"modCombinationIds",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"count",
"(",
"$",
"hashes",
")",
">",
"0",
")",
"{"... | Finds the data of the icons with the specified hashes.
@param array|string[] $hashes
@param array|int[] $modCombinationIds
@return array|IconData[] | [
"Finds",
"the",
"data",
"of",
"the",
"icons",
"with",
"the",
"specified",
"hashes",
"."
] | c3a27e5673462a58b5afafc0ea0e0002f6db9803 | https://github.com/factorio-item-browser/api-database/blob/c3a27e5673462a58b5afafc0ea0e0002f6db9803/src/Repository/IconRepository.php#L68-L95 |
3,909 | factorio-item-browser/api-database | src/Repository/IconRepository.php | IconRepository.mapIconDataResult | protected function mapIconDataResult(array $iconData): array
{
$result = [];
foreach ($iconData as $data) {
$result[] = IconData::createFromArray($data);
}
return $result;
} | php | protected function mapIconDataResult(array $iconData): array
{
$result = [];
foreach ($iconData as $data) {
$result[] = IconData::createFromArray($data);
}
return $result;
} | [
"protected",
"function",
"mapIconDataResult",
"(",
"array",
"$",
"iconData",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"iconData",
"as",
"$",
"data",
")",
"{",
"$",
"result",
"[",
"]",
"=",
"IconData",
"::",
"cre... | Maps the query result to instances of IconData.
@param array $iconData
@return array|IconData[] | [
"Maps",
"the",
"query",
"result",
"to",
"instances",
"of",
"IconData",
"."
] | c3a27e5673462a58b5afafc0ea0e0002f6db9803 | https://github.com/factorio-item-browser/api-database/blob/c3a27e5673462a58b5afafc0ea0e0002f6db9803/src/Repository/IconRepository.php#L102-L109 |
3,910 | stubbles/stubbles-values | src/main/php/Result.php | Result.filter | public function filter(callable $predicate): self
{
if ($this->isPresent() && $predicate($this->value)) {
return $this;
}
return self::$null;
} | php | public function filter(callable $predicate): self
{
if ($this->isPresent() && $predicate($this->value)) {
return $this;
}
return self::$null;
} | [
"public",
"function",
"filter",
"(",
"callable",
"$",
"predicate",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"isPresent",
"(",
")",
"&&",
"$",
"predicate",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
... | returns result when value is present and fulfills the predicate
In case the value is null or or doesn't fulfill the predicate the return
value is a null result.
@param callable $predicate
@return \stubbles\values\Result | [
"returns",
"result",
"when",
"value",
"is",
"present",
"and",
"fulfills",
"the",
"predicate"
] | 505e016715f7d7f96e180f2e8a1d711a12a3c4c2 | https://github.com/stubbles/stubbles-values/blob/505e016715f7d7f96e180f2e8a1d711a12a3c4c2/src/main/php/Result.php#L110-L117 |
3,911 | stubbles/stubbles-values | src/main/php/Result.php | Result.map | public function map(callable $mapper): self
{
if ($this->isPresent()) {
return new self($mapper($this->value));
}
return self::$null;
} | php | public function map(callable $mapper): self
{
if ($this->isPresent()) {
return new self($mapper($this->value));
}
return self::$null;
} | [
"public",
"function",
"map",
"(",
"callable",
"$",
"mapper",
")",
":",
"self",
"{",
"if",
"(",
"$",
"this",
"->",
"isPresent",
"(",
")",
")",
"{",
"return",
"new",
"self",
"(",
"$",
"mapper",
"(",
"$",
"this",
"->",
"value",
")",
")",
";",
"}",
... | maps the value using mapper into a different result
In case the value is null the return value still is a null result.
@param callable $mapper
@return \stubbles\values\Result | [
"maps",
"the",
"value",
"using",
"mapper",
"into",
"a",
"different",
"result"
] | 505e016715f7d7f96e180f2e8a1d711a12a3c4c2 | https://github.com/stubbles/stubbles-values/blob/505e016715f7d7f96e180f2e8a1d711a12a3c4c2/src/main/php/Result.php#L127-L134 |
3,912 | stubbles/stubbles-values | src/main/php/Result.php | Result.whenEmpty | public function whenEmpty($other): self
{
if (!$this->isEmpty($this->value)) {
return $this;
}
return self::of($other);
} | php | public function whenEmpty($other): self
{
if (!$this->isEmpty($this->value)) {
return $this;
}
return self::of($other);
} | [
"public",
"function",
"whenEmpty",
"(",
"$",
"other",
")",
":",
"self",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isEmpty",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"return",
"self",
"::",
"of",
"(",
"$",
... | returns the result if value is not empty, or result of other
@param mixed $other
@return \stubbles\values\Result
@since 6.2.0 | [
"returns",
"the",
"result",
"if",
"value",
"is",
"not",
"empty",
"or",
"result",
"of",
"other"
] | 505e016715f7d7f96e180f2e8a1d711a12a3c4c2 | https://github.com/stubbles/stubbles-values/blob/505e016715f7d7f96e180f2e8a1d711a12a3c4c2/src/main/php/Result.php#L173-L180 |
3,913 | stubbles/stubbles-values | src/main/php/Result.php | Result.applyWhenEmpty | public function applyWhenEmpty(callable $other): self
{
if (!$this->isEmpty($this->value)) {
return $this;
}
return self::of($other());
} | php | public function applyWhenEmpty(callable $other): self
{
if (!$this->isEmpty($this->value)) {
return $this;
}
return self::of($other());
} | [
"public",
"function",
"applyWhenEmpty",
"(",
"callable",
"$",
"other",
")",
":",
"self",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isEmpty",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"return",
"self",
"::",
"of... | returns the result if value is not empty, or the result of applied other
@param callable $other
@return \stubbles\values\Result
@since 6.2.0 | [
"returns",
"the",
"result",
"if",
"value",
"is",
"not",
"empty",
"or",
"the",
"result",
"of",
"applied",
"other"
] | 505e016715f7d7f96e180f2e8a1d711a12a3c4c2 | https://github.com/stubbles/stubbles-values/blob/505e016715f7d7f96e180f2e8a1d711a12a3c4c2/src/main/php/Result.php#L189-L196 |
3,914 | CakeCMS/Extensions | src/Controller/Component/ExtensionComponent.php | ExtensionComponent.getEntity | public function getEntity($plugin)
{
$plugin = Inflector::camelize($plugin);
$slug = Str::low($plugin);
$entity = $this->_controller->Extensions->findBySlug($slug)->first();
if ($entity === null) {
$entity = $this->_controller->Extensions->newEntity([
'p... | php | public function getEntity($plugin)
{
$plugin = Inflector::camelize($plugin);
$slug = Str::low($plugin);
$entity = $this->_controller->Extensions->findBySlug($slug)->first();
if ($entity === null) {
$entity = $this->_controller->Extensions->newEntity([
'p... | [
"public",
"function",
"getEntity",
"(",
"$",
"plugin",
")",
"{",
"$",
"plugin",
"=",
"Inflector",
"::",
"camelize",
"(",
"$",
"plugin",
")",
";",
"$",
"slug",
"=",
"Str",
"::",
"low",
"(",
"$",
"plugin",
")",
";",
"$",
"entity",
"=",
"$",
"this",
... | Get current plugin entity.
@param string $plugin
@return \Cake\Datasource\EntityInterface|\Cake\ORM\Entity|mixed | [
"Get",
"current",
"plugin",
"entity",
"."
] | 5c719a8283ff2bc5499658f2ef3d6932d26c55e6 | https://github.com/CakeCMS/Extensions/blob/5c719a8283ff2bc5499658f2ef3d6932d26c55e6/src/Controller/Component/ExtensionComponent.php#L45-L64 |
3,915 | jeromeklam/freefw | src/FreeFW/Core/Application.php | Application.afterRender | protected function afterRender()
{
$this->logger->debug('application.afterRender.start');
$manager = $this->getEventManager();
$manager->notify(\FreeFW\Constants::EVENT_AFTER_RENDER);
$this->logger->debug('application.afterRender.end');
return $this;
} | php | protected function afterRender()
{
$this->logger->debug('application.afterRender.start');
$manager = $this->getEventManager();
$manager->notify(\FreeFW\Constants::EVENT_AFTER_RENDER);
$this->logger->debug('application.afterRender.end');
return $this;
} | [
"protected",
"function",
"afterRender",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"'application.afterRender.start'",
")",
";",
"$",
"manager",
"=",
"$",
"this",
"->",
"getEventManager",
"(",
")",
";",
"$",
"manager",
"->",
"notify",
"... | Event de fin
@return void | [
"Event",
"de",
"fin"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Core/Application.php#L52-L59 |
3,916 | phlexible/phlexible | src/Phlexible/Bundle/ElementBundle/Controller/LocksController.php | LocksController.listAction | public function listAction()
{
$lockManager = $this->get('phlexible_element.element_lock_manager');
$userManager = $this->get('phlexible_user.user_manager');
$locks = $lockManager->findAll();
$data = [];
foreach ($locks as $lock) {
/* @var $lock ElementLock */
... | php | public function listAction()
{
$lockManager = $this->get('phlexible_element.element_lock_manager');
$userManager = $this->get('phlexible_user.user_manager');
$locks = $lockManager->findAll();
$data = [];
foreach ($locks as $lock) {
/* @var $lock ElementLock */
... | [
"public",
"function",
"listAction",
"(",
")",
"{",
"$",
"lockManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_element.element_lock_manager'",
")",
";",
"$",
"userManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_user.user_manager'",
")",
";",
... | List locks.
@return JsonResponse
@Route("/list", name="locks_list") | [
"List",
"locks",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementBundle/Controller/LocksController.php#L37-L64 |
3,917 | phlexible/phlexible | src/Phlexible/Bundle/ElementBundle/Controller/LocksController.php | LocksController.deleteAction | public function deleteAction($id)
{
$lockManager = $this->get('phlexible_element.element_lock_manager');
$lock = $lockManager->find($id);
$lockManager->deleteLock($lock);
return new ResultResponse(true, 'Lock released.');
} | php | public function deleteAction($id)
{
$lockManager = $this->get('phlexible_element.element_lock_manager');
$lock = $lockManager->find($id);
$lockManager->deleteLock($lock);
return new ResultResponse(true, 'Lock released.');
} | [
"public",
"function",
"deleteAction",
"(",
"$",
"id",
")",
"{",
"$",
"lockManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_element.element_lock_manager'",
")",
";",
"$",
"lock",
"=",
"$",
"lockManager",
"->",
"find",
"(",
"$",
"id",
")",
";",
"$... | Delete lock.
@param string $id
@return ResultResponse
@Route("/delete/{id}", name="locks_delete") | [
"Delete",
"lock",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementBundle/Controller/LocksController.php#L74-L82 |
3,918 | phlexible/phlexible | src/Phlexible/Bundle/ElementBundle/Controller/LocksController.php | LocksController.deletemyAction | public function deletemyAction()
{
$uid = $this->getUser()->getId();
$lockManager = $this->get('phlexible_element.element_lock_manager');
$myLocks = $lockManager->findBy(['userId' => $uid]);
foreach ($myLocks as $lock) {
$lockManager->deleteLock($lock);
}
... | php | public function deletemyAction()
{
$uid = $this->getUser()->getId();
$lockManager = $this->get('phlexible_element.element_lock_manager');
$myLocks = $lockManager->findBy(['userId' => $uid]);
foreach ($myLocks as $lock) {
$lockManager->deleteLock($lock);
}
... | [
"public",
"function",
"deletemyAction",
"(",
")",
"{",
"$",
"uid",
"=",
"$",
"this",
"->",
"getUser",
"(",
")",
"->",
"getId",
"(",
")",
";",
"$",
"lockManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_element.element_lock_manager'",
")",
";",
"$... | Delete my locks.
@return ResultResponse
@Route("/deletemy", name="locks_delete_my") | [
"Delete",
"my",
"locks",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementBundle/Controller/LocksController.php#L90-L102 |
3,919 | phlexible/phlexible | src/Phlexible/Bundle/ElementBundle/Controller/LocksController.php | LocksController.lockAction | public function lockAction(Request $request)
{
// get request parameters
$eid = (int) $request->get('eid');
$language = $request->get('language');
$elementService = $this->get('phlexible_element.element_service');
$lockManager = $this->get('phlexible_element.element_lock_man... | php | public function lockAction(Request $request)
{
// get request parameters
$eid = (int) $request->get('eid');
$language = $request->get('language');
$elementService = $this->get('phlexible_element.element_service');
$lockManager = $this->get('phlexible_element.element_lock_man... | [
"public",
"function",
"lockAction",
"(",
"Request",
"$",
"request",
")",
"{",
"// get request parameters",
"$",
"eid",
"=",
"(",
"int",
")",
"$",
"request",
"->",
"get",
"(",
"'eid'",
")",
";",
"$",
"language",
"=",
"$",
"request",
"->",
"get",
"(",
"'... | Lock element.
@param Request $request
@return ResultResponse
@Route("/lock", name="elements_locks_lock") | [
"Lock",
"element",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/ElementBundle/Controller/LocksController.php#L127-L150 |
3,920 | webbuilders-group/silverstripe-kapost-bridge | code/control/KapostService.php | KapostService.index | public function index() {
//If the request is not a post request 404
if(!$this->request->isPOST()) {
if(class_exists('ErrorPage')) {
$response=ErrorPage::response_for(404);
if(!empty($response)) {
return parent::httpError(404, $response);
... | php | public function index() {
//If the request is not a post request 404
if(!$this->request->isPOST()) {
if(class_exists('ErrorPage')) {
$response=ErrorPage::response_for(404);
if(!empty($response)) {
return parent::httpError(404, $response);
... | [
"public",
"function",
"index",
"(",
")",
"{",
"//If the request is not a post request 404",
"if",
"(",
"!",
"$",
"this",
"->",
"request",
"->",
"isPOST",
"(",
")",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'ErrorPage'",
")",
")",
"{",
"$",
"response",
"="... | Handles incoming requests to the kapost service | [
"Handles",
"incoming",
"requests",
"to",
"the",
"kapost",
"service"
] | 718f498cad0eec764d19c9081404b2a0c8f44d71 | https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/control/KapostService.php#L96-L174 |
3,921 | webbuilders-group/silverstripe-kapost-bridge | code/control/KapostService.php | KapostService.preview | public function preview() {
$auth=$this->request->getVar('auth');
$token=KapostPreviewToken::get()->filter('Code', Convert::raw2sql($auth))->first();
//Verify the token exists and hasn't expired yet
if(!empty($token) && $token!==false && $token->exists() && time()-strtotime($tok... | php | public function preview() {
$auth=$this->request->getVar('auth');
$token=KapostPreviewToken::get()->filter('Code', Convert::raw2sql($auth))->first();
//Verify the token exists and hasn't expired yet
if(!empty($token) && $token!==false && $token->exists() && time()-strtotime($tok... | [
"public",
"function",
"preview",
"(",
")",
"{",
"$",
"auth",
"=",
"$",
"this",
"->",
"request",
"->",
"getVar",
"(",
"'auth'",
")",
";",
"$",
"token",
"=",
"KapostPreviewToken",
"::",
"get",
"(",
")",
"->",
"filter",
"(",
"'Code'",
",",
"Convert",
":... | Handles rendering of the preview for an object
@return string Response to send to the object | [
"Handles",
"rendering",
"of",
"the",
"preview",
"for",
"an",
"object"
] | 718f498cad0eec764d19c9081404b2a0c8f44d71 | https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/control/KapostService.php#L180-L206 |
3,922 | webbuilders-group/silverstripe-kapost-bridge | code/control/KapostService.php | KapostService.authenticate | protected function authenticate($username, $password) {
$authenticator=$this->config()->authenticator_class;
$member=$authenticator::authenticate(array(
$this->config()->authenticator_username_field=>$username,
... | php | protected function authenticate($username, $password) {
$authenticator=$this->config()->authenticator_class;
$member=$authenticator::authenticate(array(
$this->config()->authenticator_username_field=>$username,
... | [
"protected",
"function",
"authenticate",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"$",
"authenticator",
"=",
"$",
"this",
"->",
"config",
"(",
")",
"->",
"authenticator_class",
";",
"$",
"member",
"=",
"$",
"authenticator",
"::",
"authenticate",... | Checks the authentication of the api request
@param string $username Username to look up
@param string $password Password to match against
@return bool Returns boolean true if authentication passes false otherwise | [
"Checks",
"the",
"authentication",
"of",
"the",
"api",
"request"
] | 718f498cad0eec764d19c9081404b2a0c8f44d71 | https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/control/KapostService.php#L301-L310 |
3,923 | webbuilders-group/silverstripe-kapost-bridge | code/control/KapostService.php | KapostService.getUsersBlogs | protected function getUsersBlogs($app_id) {
if(SiteConfig::has_extension('SiteConfigSubsites')) {
$response=array();
//Disable subsite filter
Subsite::disable_subsite_filter();
$subsites=Subsite::get();
foreach($subsites as $s... | php | protected function getUsersBlogs($app_id) {
if(SiteConfig::has_extension('SiteConfigSubsites')) {
$response=array();
//Disable subsite filter
Subsite::disable_subsite_filter();
$subsites=Subsite::get();
foreach($subsites as $s... | [
"protected",
"function",
"getUsersBlogs",
"(",
"$",
"app_id",
")",
"{",
"if",
"(",
"SiteConfig",
"::",
"has_extension",
"(",
"'SiteConfigSubsites'",
")",
")",
"{",
"$",
"response",
"=",
"array",
"(",
")",
";",
"//Disable subsite filter",
"Subsite",
"::",
"disa... | Gets the site config or subsites for the current site
@return array Nested array of sites | [
"Gets",
"the",
"site",
"config",
"or",
"subsites",
"for",
"the",
"current",
"site"
] | 718f498cad0eec764d19c9081404b2a0c8f44d71 | https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/control/KapostService.php#L326-L355 |
3,924 | webbuilders-group/silverstripe-kapost-bridge | code/control/KapostService.php | KapostService.getCategories | protected function getCategories($blog_id) {
$categories=array();
//If we have a SiteTree class add the classes
if(class_exists('SiteTree')) {
$pageClasses=ClassInfo::subclassesFor('SiteTree');
foreach($pageClasses as $class) {
if($class!... | php | protected function getCategories($blog_id) {
$categories=array();
//If we have a SiteTree class add the classes
if(class_exists('SiteTree')) {
$pageClasses=ClassInfo::subclassesFor('SiteTree');
foreach($pageClasses as $class) {
if($class!... | [
"protected",
"function",
"getCategories",
"(",
"$",
"blog_id",
")",
"{",
"$",
"categories",
"=",
"array",
"(",
")",
";",
"//If we have a SiteTree class add the classes",
"if",
"(",
"class_exists",
"(",
"'SiteTree'",
")",
")",
"{",
"$",
"pageClasses",
"=",
"Class... | Gets the categories
@param mixed $blog_id ID of the blog
@return array Array of categories | [
"Gets",
"the",
"categories"
] | 718f498cad0eec764d19c9081404b2a0c8f44d71 | https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/control/KapostService.php#L680-L712 |
3,925 | webbuilders-group/silverstripe-kapost-bridge | code/control/KapostService.php | KapostService.getPreview | protected function getPreview($blog_id, $content, $content_id) {
$results=$this->extend('getPreview', $blog_id, $content, $content_id);
if($results && is_array($results)) {
$results=array_filter($results, function($v) {return !is_null($v);});
if(count($results)>0) {
... | php | protected function getPreview($blog_id, $content, $content_id) {
$results=$this->extend('getPreview', $blog_id, $content, $content_id);
if($results && is_array($results)) {
$results=array_filter($results, function($v) {return !is_null($v);});
if(count($results)>0) {
... | [
"protected",
"function",
"getPreview",
"(",
"$",
"blog_id",
",",
"$",
"content",
",",
"$",
"content_id",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"extend",
"(",
"'getPreview'",
",",
"$",
"blog_id",
",",
"$",
"content",
",",
"$",
"content_id",
... | Handles rendering of the preview
@param mixed $blog_id Identifier for the current site
@param array $content Post details
@param mixed $content_id Identifier for the post | [
"Handles",
"rendering",
"of",
"the",
"preview"
] | 718f498cad0eec764d19c9081404b2a0c8f44d71 | https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/control/KapostService.php#L880-L927 |
3,926 | webbuilders-group/silverstripe-kapost-bridge | code/control/KapostService.php | KapostService.struct_to_assoc | final protected function struct_to_assoc($struct) {
$result=array();
foreach($struct as $item) {
if(array_key_exists('key', $item) && array_key_exists('value', $item)) {
if(array_key_exists($item['key'], $result)) {
user_error('Duplicate key detected in st... | php | final protected function struct_to_assoc($struct) {
$result=array();
foreach($struct as $item) {
if(array_key_exists('key', $item) && array_key_exists('value', $item)) {
if(array_key_exists($item['key'], $result)) {
user_error('Duplicate key detected in st... | [
"final",
"protected",
"function",
"struct_to_assoc",
"(",
"$",
"struct",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"struct",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'key'",
",",
"$",
"item",
... | Converts a struct to an associtive array based on the key value pair in the struct
@param array $struct Input struct to be converted
@return array Associtive array matching the struct | [
"Converts",
"a",
"struct",
"to",
"an",
"associtive",
"array",
"based",
"on",
"the",
"key",
"value",
"pair",
"in",
"the",
"struct"
] | 718f498cad0eec764d19c9081404b2a0c8f44d71 | https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/control/KapostService.php#L934-L949 |
3,927 | webbuilders-group/silverstripe-kapost-bridge | code/control/KapostService.php | KapostService.mergeResultArray | private function mergeResultArray($leftArray, $rightArray) {
foreach($rightArray as $key=>$value) {
if(is_array($value) && array_key_exists($key, $leftArray)) {
$leftArray[$key]=array_merge($leftArray[$key], $value);
}else {
$leftArray[$key]=$value;
... | php | private function mergeResultArray($leftArray, $rightArray) {
foreach($rightArray as $key=>$value) {
if(is_array($value) && array_key_exists($key, $leftArray)) {
$leftArray[$key]=array_merge($leftArray[$key], $value);
}else {
$leftArray[$key]=$value;
... | [
"private",
"function",
"mergeResultArray",
"(",
"$",
"leftArray",
",",
"$",
"rightArray",
")",
"{",
"foreach",
"(",
"$",
"rightArray",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"&&",
"array_key_exists"... | Merges two arrays, overwriting the keys in the left array with the right array recurrsivly. Meaning that if a value in the right array is it self an array and the key exists in the left array it recurses into it.
@param array $leftArray Left array to merge into
@param array $rightArray Right array to merge from
@return... | [
"Merges",
"two",
"arrays",
"overwriting",
"the",
"keys",
"in",
"the",
"left",
"array",
"with",
"the",
"right",
"array",
"recurrsivly",
".",
"Meaning",
"that",
"if",
"a",
"value",
"in",
"the",
"right",
"array",
"is",
"it",
"self",
"an",
"array",
"and",
"t... | 718f498cad0eec764d19c9081404b2a0c8f44d71 | https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/control/KapostService.php#L957-L967 |
3,928 | webbuilders-group/silverstripe-kapost-bridge | code/control/KapostService.php | KapostService.find_file_by_url | public static function find_file_by_url($url) {
$url=Director::makeRelative($url);
if($url) {
$file=File::get()->filter('Filename', Convert::raw2sql($url))->first();
if(!empty($file) && $file!==false && $file->ID>0) {
return $file;
}
}
... | php | public static function find_file_by_url($url) {
$url=Director::makeRelative($url);
if($url) {
$file=File::get()->filter('Filename', Convert::raw2sql($url))->first();
if(!empty($file) && $file!==false && $file->ID>0) {
return $file;
}
}
... | [
"public",
"static",
"function",
"find_file_by_url",
"(",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"Director",
"::",
"makeRelative",
"(",
"$",
"url",
")",
";",
"if",
"(",
"$",
"url",
")",
"{",
"$",
"file",
"=",
"File",
"::",
"get",
"(",
")",
"->",
"... | Finds a file record based on the url of the file, this is needed because Kapost doesn't seem to send anything back other than the url in the cms
@param string $url Absolute url to the file
@return File Returns the file instance representing the url, or boolean false if it's not found | [
"Finds",
"a",
"file",
"record",
"based",
"on",
"the",
"url",
"of",
"the",
"file",
"this",
"is",
"needed",
"because",
"Kapost",
"doesn",
"t",
"seem",
"to",
"send",
"anything",
"back",
"other",
"than",
"the",
"url",
"in",
"the",
"cms"
] | 718f498cad0eec764d19c9081404b2a0c8f44d71 | https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/control/KapostService.php#L996-L1006 |
3,929 | webbuilders-group/silverstripe-kapost-bridge | code/control/KapostService.php | KapostService.generateErrorResponse | protected function generateErrorResponse(PhpXmlRpc\Server $server, PhpXmlRpc\Response $r) {
$this->response->addHeader('Content-Type', $r->content_type);
$this->response->addHeader('Vary', 'Accept-Charset');
$payload='<?xml version="1.0"?>';
if(empty($r->payload)) {
... | php | protected function generateErrorResponse(PhpXmlRpc\Server $server, PhpXmlRpc\Response $r) {
$this->response->addHeader('Content-Type', $r->content_type);
$this->response->addHeader('Vary', 'Accept-Charset');
$payload='<?xml version="1.0"?>';
if(empty($r->payload)) {
... | [
"protected",
"function",
"generateErrorResponse",
"(",
"PhpXmlRpc",
"\\",
"Server",
"$",
"server",
",",
"PhpXmlRpc",
"\\",
"Response",
"$",
"r",
")",
"{",
"$",
"this",
"->",
"response",
"->",
"addHeader",
"(",
"'Content-Type'",
",",
"$",
"r",
"->",
"content_... | Takes the xmlrpc object and generates the response to be set back
@param PhpXmlRpc\Server $server XML-RPC Server instance
@param PhpXmlRpc\Response $r XML-RPC Response object to relay to client
@return string Response to be sent to the client | [
"Takes",
"the",
"xmlrpc",
"object",
"and",
"generates",
"the",
"response",
"to",
"be",
"set",
"back"
] | 718f498cad0eec764d19c9081404b2a0c8f44d71 | https://github.com/webbuilders-group/silverstripe-kapost-bridge/blob/718f498cad0eec764d19c9081404b2a0c8f44d71/code/control/KapostService.php#L1014-L1027 |
3,930 | indigophp-archive/fuel-core | classes/Facade.php | Facade.instance | public static function instance($instance = null)
{
$class = get_called_class();
if (static::exists($instance))
{
$instance = static::$_instances[$class][$instance];
}
else
{
$instance = false;
}
return $instance;
} | php | public static function instance($instance = null)
{
$class = get_called_class();
if (static::exists($instance))
{
$instance = static::$_instances[$class][$instance];
}
else
{
$instance = false;
}
return $instance;
} | [
"public",
"static",
"function",
"instance",
"(",
"$",
"instance",
"=",
"null",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"static",
"::",
"exists",
"(",
"$",
"instance",
")",
")",
"{",
"$",
"instance",
"=",
"static",
"... | Return an instance or false
@param string $instance
@return mixed | [
"Return",
"an",
"instance",
"or",
"false"
] | 275462154fb7937f8e1c2c541b31d8e7c5760e39 | https://github.com/indigophp-archive/fuel-core/blob/275462154fb7937f8e1c2c541b31d8e7c5760e39/classes/Facade.php#L75-L89 |
3,931 | indigophp-archive/fuel-core | classes/Facade.php | Facade.delete | public static function delete($instance)
{
$class = get_called_class();
if ($instance === true)
{
static::$_instances[$class] = array();
return true;
}
elseif (static::exists($instance))
{
unset(static::$_instances[$class][$instance]);
return true;
}
return false;
} | php | public static function delete($instance)
{
$class = get_called_class();
if ($instance === true)
{
static::$_instances[$class] = array();
return true;
}
elseif (static::exists($instance))
{
unset(static::$_instances[$class][$instance]);
return true;
}
return false;
} | [
"public",
"static",
"function",
"delete",
"(",
"$",
"instance",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"$",
"instance",
"===",
"true",
")",
"{",
"static",
"::",
"$",
"_instances",
"[",
"$",
"class",
"]",
"=",
"arra... | Deletes an instance if exists
@param mixed $instance If true, all instances are deleted
@return boolean | [
"Deletes",
"an",
"instance",
"if",
"exists"
] | 275462154fb7937f8e1c2c541b31d8e7c5760e39 | https://github.com/indigophp-archive/fuel-core/blob/275462154fb7937f8e1c2c541b31d8e7c5760e39/classes/Facade.php#L98-L116 |
3,932 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/ShopSettingController.php | ShopSettingController.showAction | public function showAction(ShopSetting $shopSetting)
{
$editForm = $this->createForm(new ShopSettingType(), $shopSetting, array(
'action' => $this->generateUrl('admin_amulen_shop_setting_update', array('id' => $shopSetting->getid())),
'method' => 'PUT',
));
$deleteFor... | php | public function showAction(ShopSetting $shopSetting)
{
$editForm = $this->createForm(new ShopSettingType(), $shopSetting, array(
'action' => $this->generateUrl('admin_amulen_shop_setting_update', array('id' => $shopSetting->getid())),
'method' => 'PUT',
));
$deleteFor... | [
"public",
"function",
"showAction",
"(",
"ShopSetting",
"$",
"shopSetting",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"ShopSettingType",
"(",
")",
",",
"$",
"shopSetting",
",",
"array",
"(",
"'action'",
"=>",
"$",
"this",... | Finds and displays a ShopSetting entity.
@Route("/{id}/show", name="admin_amulen_shop_setting_show", requirements={"id"="\d+"})
@Method("GET")
@Template() | [
"Finds",
"and",
"displays",
"a",
"ShopSetting",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/ShopSettingController.php#L45-L59 |
3,933 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/ShopSettingController.php | ShopSettingController.newAction | public function newAction()
{
$shopSetting = new ShopSetting();
$form = $this->createForm(new ShopSettingType(), $shopSetting);
return array(
'shopSetting' => $shopSetting,
'form' => $form->createView(),
);
} | php | public function newAction()
{
$shopSetting = new ShopSetting();
$form = $this->createForm(new ShopSettingType(), $shopSetting);
return array(
'shopSetting' => $shopSetting,
'form' => $form->createView(),
);
} | [
"public",
"function",
"newAction",
"(",
")",
"{",
"$",
"shopSetting",
"=",
"new",
"ShopSetting",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"ShopSettingType",
"(",
")",
",",
"$",
"shopSetting",
")",
";",
"return",
"ar... | Displays a form to create a new ShopSetting entity.
@Route("/new", name="admin_amulen_shop_setting_new")
@Method("GET")
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"ShopSetting",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/ShopSettingController.php#L68-L77 |
3,934 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/ShopSettingController.php | ShopSettingController.createAction | public function createAction(Request $request)
{
$shopSetting = new ShopSetting();
$form = $this->createForm(new ShopSettingType(), $shopSetting);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($shopSetting);
... | php | public function createAction(Request $request)
{
$shopSetting = new ShopSetting();
$form = $this->createForm(new ShopSettingType(), $shopSetting);
if ($form->handleRequest($request)->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($shopSetting);
... | [
"public",
"function",
"createAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"shopSetting",
"=",
"new",
"ShopSetting",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"ShopSettingType",
"(",
")",
",",
"$",
"shopSetti... | Creates a new ShopSetting entity.
@Route("/create", name="admin_amulen_shop_setting_create")
@Method("POST")
@Template("FlowcodeShopBundle:ShopSetting:new.html.twig") | [
"Creates",
"a",
"new",
"ShopSetting",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/ShopSettingController.php#L86-L102 |
3,935 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Controller/ShopSettingController.php | ShopSettingController.updateAction | public function updateAction(ShopSetting $shopSetting, Request $request)
{
$editForm = $this->createForm(new ShopSettingType(), $shopSetting, array(
'action' => $this->generateUrl('admin_amulen_shop_setting_update', array('id' => $shopSetting->getid())),
'method' => 'PUT',
))... | php | public function updateAction(ShopSetting $shopSetting, Request $request)
{
$editForm = $this->createForm(new ShopSettingType(), $shopSetting, array(
'action' => $this->generateUrl('admin_amulen_shop_setting_update', array('id' => $shopSetting->getid())),
'method' => 'PUT',
))... | [
"public",
"function",
"updateAction",
"(",
"ShopSetting",
"$",
"shopSetting",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"editForm",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"ShopSettingType",
"(",
")",
",",
"$",
"shopSetting",
",",
"array",
"... | Edits an existing ShopSetting entity.
@Route("/{id}/update", name="admin_amulen_shop_setting_update", requirements={"id"="\d+"})
@Method("PUT")
@Template("FlowcodeShopBundle:ShopSetting:show.html.twig") | [
"Edits",
"an",
"existing",
"ShopSetting",
"entity",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Controller/ShopSettingController.php#L111-L129 |
3,936 | unclecheese/silverstripe-reflection-templates | code/ReflectionTemplate.php | ReflectionTemplate.getTopLevelBlocks | public function getTopLevelBlocks() {
$ret = array ();
foreach($this->blockManifest as $block) {
if(!$block->getParent()) {
$ret[] = $block;
}
}
return $ret;
} | php | public function getTopLevelBlocks() {
$ret = array ();
foreach($this->blockManifest as $block) {
if(!$block->getParent()) {
$ret[] = $block;
}
}
return $ret;
} | [
"public",
"function",
"getTopLevelBlocks",
"(",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"blockManifest",
"as",
"$",
"block",
")",
"{",
"if",
"(",
"!",
"$",
"block",
"->",
"getParent",
"(",
")",
")",
"{"... | Gets all the blocks at the top level
@return array | [
"Gets",
"all",
"the",
"blocks",
"at",
"the",
"top",
"level"
] | 7ae6fc333246afd1099bf91f281211ec8d8232d2 | https://github.com/unclecheese/silverstripe-reflection-templates/blob/7ae6fc333246afd1099bf91f281211ec8d8232d2/code/ReflectionTemplate.php#L348-L357 |
3,937 | unclecheese/silverstripe-reflection-templates | code/ReflectionTemplate.php | ReflectionTemplate_Block.addChild | public function addChild($index) {
foreach($this->children as $child) {
if($child->getID() == $index) return;
}
$this->children[] = $this->reflector->getBlockByID($index);
} | php | public function addChild($index) {
foreach($this->children as $child) {
if($child->getID() == $index) return;
}
$this->children[] = $this->reflector->getBlockByID($index);
} | [
"public",
"function",
"addChild",
"(",
"$",
"index",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"children",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"child",
"->",
"getID",
"(",
")",
"==",
"$",
"index",
")",
"return",
";",
"}",
"$",
"this"... | Adds a child block to this block
@param int $index The offset of the child block | [
"Adds",
"a",
"child",
"block",
"to",
"this",
"block"
] | 7ae6fc333246afd1099bf91f281211ec8d8232d2 | https://github.com/unclecheese/silverstripe-reflection-templates/blob/7ae6fc333246afd1099bf91f281211ec8d8232d2/code/ReflectionTemplate.php#L497-L502 |
3,938 | unclecheese/silverstripe-reflection-templates | code/ReflectionTemplate.php | ReflectionTemplate_Block.getChildByName | public function getChildByName($name) {
foreach($this->getChildren() as $child) {
if($child->getName() == $name) return $child;
}
return false;
} | php | public function getChildByName($name) {
foreach($this->getChildren() as $child) {
if($child->getName() == $name) return $child;
}
return false;
} | [
"public",
"function",
"getChildByName",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getChildren",
"(",
")",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"child",
"->",
"getName",
"(",
")",
"==",
"$",
"name",
")",
"return",
"$",... | Gets a child block by name
@param string $name
@return ReflectionTemplate_Block | [
"Gets",
"a",
"child",
"block",
"by",
"name"
] | 7ae6fc333246afd1099bf91f281211ec8d8232d2 | https://github.com/unclecheese/silverstripe-reflection-templates/blob/7ae6fc333246afd1099bf91f281211ec8d8232d2/code/ReflectionTemplate.php#L669-L675 |
3,939 | unclecheese/silverstripe-reflection-templates | code/ReflectionTemplate.php | ReflectionTemplate_Block.getRelativeOffset | public function getRelativeOffset() {
if($this->getParent()) {
return $this->id - $this->getParent()->getID();
}
return $this->id;
} | php | public function getRelativeOffset() {
if($this->getParent()) {
return $this->id - $this->getParent()->getID();
}
return $this->id;
} | [
"public",
"function",
"getRelativeOffset",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getParent",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"id",
"-",
"$",
"this",
"->",
"getParent",
"(",
")",
"->",
"getID",
"(",
")",
";",
"}",
"return",
... | Gets the offset, relative to the parent block
@return int | [
"Gets",
"the",
"offset",
"relative",
"to",
"the",
"parent",
"block"
] | 7ae6fc333246afd1099bf91f281211ec8d8232d2 | https://github.com/unclecheese/silverstripe-reflection-templates/blob/7ae6fc333246afd1099bf91f281211ec8d8232d2/code/ReflectionTemplate.php#L705-L711 |
3,940 | atelierspierrot/library | src/Library/Reporter/Reporter.php | Reporter.setAdapterType | public function setAdapterType($type)
{
$adapter_type = '\Library\Reporter\Adapter\\'.ucfirst($type);
if (class_exists($adapter_type)) {
$this->setAdapter(new $adapter_type);
} else {
throw new \RuntimeException(
sprintf('Reporter adapter for type "%s"... | php | public function setAdapterType($type)
{
$adapter_type = '\Library\Reporter\Adapter\\'.ucfirst($type);
if (class_exists($adapter_type)) {
$this->setAdapter(new $adapter_type);
} else {
throw new \RuntimeException(
sprintf('Reporter adapter for type "%s"... | [
"public",
"function",
"setAdapterType",
"(",
"$",
"type",
")",
"{",
"$",
"adapter_type",
"=",
"'\\Library\\Reporter\\Adapter\\\\'",
".",
"ucfirst",
"(",
"$",
"type",
")",
";",
"if",
"(",
"class_exists",
"(",
"$",
"adapter_type",
")",
")",
"{",
"$",
"this",
... | Set the adapter type to use
@param string $type The type name
@return self $this for method chaining
@throws Throws a RuntimeException if the adapter doesn't exist | [
"Set",
"the",
"adapter",
"type",
"to",
"use"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Reporter/Reporter.php#L183-L194 |
3,941 | atelierspierrot/library | src/Library/Reporter/Reporter.php | Reporter.setAdapter | public function setAdapter(AbstractAdapter $adapter)
{
$cls = get_class($adapter);
foreach(self::$default_masks as $_mask) {
if (null===@constant($cls.'::mask_'.$_mask)) {
throw new \LogicException(
sprintf('Reporter adapter "%s" must define a mask nam... | php | public function setAdapter(AbstractAdapter $adapter)
{
$cls = get_class($adapter);
foreach(self::$default_masks as $_mask) {
if (null===@constant($cls.'::mask_'.$_mask)) {
throw new \LogicException(
sprintf('Reporter adapter "%s" must define a mask nam... | [
"public",
"function",
"setAdapter",
"(",
"AbstractAdapter",
"$",
"adapter",
")",
"{",
"$",
"cls",
"=",
"get_class",
"(",
"$",
"adapter",
")",
";",
"foreach",
"(",
"self",
"::",
"$",
"default_masks",
"as",
"$",
"_mask",
")",
"{",
"if",
"(",
"null",
"===... | Set the adapter
@param \Library\Reporter\AbstractAdapter $adapter The instance of a ReporterAdapter
@return self
@throws \LogicException | [
"Set",
"the",
"adapter"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Reporter/Reporter.php#L213-L225 |
3,942 | atelierspierrot/library | src/Library/Reporter/Reporter.php | Reporter.setOutput | public function setOutput($output)
{
if ($this->getFlag() & self::OUTPUT_APPEND) {
$this->output .= $output;
} elseif ($this->getFlag() & self::OUTPUT_BY_LINE) {
$this->output = $output;
}
return $this;
} | php | public function setOutput($output)
{
if ($this->getFlag() & self::OUTPUT_APPEND) {
$this->output .= $output;
} elseif ($this->getFlag() & self::OUTPUT_BY_LINE) {
$this->output = $output;
}
return $this;
} | [
"public",
"function",
"setOutput",
"(",
"$",
"output",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getFlag",
"(",
")",
"&",
"self",
"::",
"OUTPUT_APPEND",
")",
"{",
"$",
"this",
"->",
"output",
".=",
"$",
"output",
";",
"}",
"elseif",
"(",
"$",
"this"... | Set some content
@param string $output The content string
@return self Returns `$this` for method chaining | [
"Set",
"some",
"content"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Reporter/Reporter.php#L243-L251 |
3,943 | atelierspierrot/library | src/Library/Reporter/Reporter.php | Reporter.write | public function write($content, $tag_type = 'default', $args = null)
{
if (is_null($args)) $args = array();
if (!is_array($args)) $args = array( $args );
$output = $this->getAdapter()->renderTag($content, $tag_type, $args);
echo PHP_EOL.$output.PHP_EOL;
} | php | public function write($content, $tag_type = 'default', $args = null)
{
if (is_null($args)) $args = array();
if (!is_array($args)) $args = array( $args );
$output = $this->getAdapter()->renderTag($content, $tag_type, $args);
echo PHP_EOL.$output.PHP_EOL;
} | [
"public",
"function",
"write",
"(",
"$",
"content",
",",
"$",
"tag_type",
"=",
"'default'",
",",
"$",
"args",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"args",
")",
")",
"$",
"args",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"is... | Display on screen a content with a specific tag mask
@param string $content The content string to use
@param string $tag_type The type of tag mask to use
@param string|array $args An array of arguments to pass to the mask (or a single string that
will be taken as the first array item)
@return void | [
"Display",
"on",
"screen",
"a",
"content",
"with",
"a",
"specific",
"tag",
"mask"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Reporter/Reporter.php#L299-L305 |
3,944 | atelierspierrot/library | src/Library/Reporter/Reporter.php | Reporter.renderMulti | public function renderMulti($content, $tag_type = 'default', array $multi = array(), $args = null, $placeholder_mask = '@%s@')
{
if (is_null($args)) $args = array();
if (!is_array($args)) $args = array( $args );
// rendering all placeholders
$placeholders_table = array();
fo... | php | public function renderMulti($content, $tag_type = 'default', array $multi = array(), $args = null, $placeholder_mask = '@%s@')
{
if (is_null($args)) $args = array();
if (!is_array($args)) $args = array( $args );
// rendering all placeholders
$placeholders_table = array();
fo... | [
"public",
"function",
"renderMulti",
"(",
"$",
"content",
",",
"$",
"tag_type",
"=",
"'default'",
",",
"array",
"$",
"multi",
"=",
"array",
"(",
")",
",",
"$",
"args",
"=",
"null",
",",
"$",
"placeholder_mask",
"=",
"'@%s@'",
")",
"{",
"if",
"(",
"is... | Render a content with a specific tag mask and some placeholders
This is quite the same as the `render()` method but in this case, the `$content` string
may contains some placeholders like `@name@` that will be replaced in the result by
the `name` item of the `$multi` array argument after rendering it by the `render()`... | [
"Render",
"a",
"content",
"with",
"a",
"specific",
"tag",
"mask",
"and",
"some",
"placeholders"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Reporter/Reporter.php#L333-L362 |
3,945 | bfw-systems/controller | src/BfwController.php | BfwController.update | public function update(\SplSubject $subject)
{
if ($subject->getAction() === 'ctrlRouterLink_exec_execRoute') {
$this->obtainCtrlRouterInfos($subject);
if (
$this->ctrlRouterInfos->isFound === true &&
$this->ctrlRouterInfos->forWho === $th... | php | public function update(\SplSubject $subject)
{
if ($subject->getAction() === 'ctrlRouterLink_exec_execRoute') {
$this->obtainCtrlRouterInfos($subject);
if (
$this->ctrlRouterInfos->isFound === true &&
$this->ctrlRouterInfos->forWho === $th... | [
"public",
"function",
"update",
"(",
"\\",
"SplSubject",
"$",
"subject",
")",
"{",
"if",
"(",
"$",
"subject",
"->",
"getAction",
"(",
")",
"===",
"'ctrlRouterLink_exec_execRoute'",
")",
"{",
"$",
"this",
"->",
"obtainCtrlRouterInfos",
"(",
"$",
"subject",
")... | Observer update method
@param \SplSubject $subject
@return void | [
"Observer",
"update",
"method"
] | c22c497c14df54d8e8f10f653d2b37995d30c4c0 | https://github.com/bfw-systems/controller/blob/c22c497c14df54d8e8f10f653d2b37995d30c4c0/src/BfwController.php#L117-L129 |
3,946 | bfw-systems/controller | src/BfwController.php | BfwController.run | protected function run()
{
if (PHP_SAPI === 'cli') {
return;
}
if ($this->ctrlRouterInfos->target === null) {
return;
}
$this->module
->monolog
->getLogger()
->debug(
'Execute curren... | php | protected function run()
{
if (PHP_SAPI === 'cli') {
return;
}
if ($this->ctrlRouterInfos->target === null) {
return;
}
$this->module
->monolog
->getLogger()
->debug(
'Execute curren... | [
"protected",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"PHP_SAPI",
"===",
"'cli'",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"ctrlRouterInfos",
"->",
"target",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"mo... | Run controller system if application is not run in cli mode
@return void | [
"Run",
"controller",
"system",
"if",
"application",
"is",
"not",
"run",
"in",
"cli",
"mode"
] | c22c497c14df54d8e8f10f653d2b37995d30c4c0 | https://github.com/bfw-systems/controller/blob/c22c497c14df54d8e8f10f653d2b37995d30c4c0/src/BfwController.php#L150-L175 |
3,947 | bfw-systems/controller | src/BfwController.php | BfwController.runObject | protected function runObject()
{
$targetInfos = $this->ctrlRouterInfos->target;
if (
!is_array($targetInfos) ||
(is_array($targetInfos) && count($targetInfos) !== 2)
) {
throw new Exception(
'The route target should be an array wit... | php | protected function runObject()
{
$targetInfos = $this->ctrlRouterInfos->target;
if (
!is_array($targetInfos) ||
(is_array($targetInfos) && count($targetInfos) !== 2)
) {
throw new Exception(
'The route target should be an array wit... | [
"protected",
"function",
"runObject",
"(",
")",
"{",
"$",
"targetInfos",
"=",
"$",
"this",
"->",
"ctrlRouterInfos",
"->",
"target",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"targetInfos",
")",
"||",
"(",
"is_array",
"(",
"$",
"targetInfos",
")",
"&&",
... | Call controller when is an object.
@return void | [
"Call",
"controller",
"when",
"is",
"an",
"object",
"."
] | c22c497c14df54d8e8f10f653d2b37995d30c4c0 | https://github.com/bfw-systems/controller/blob/c22c497c14df54d8e8f10f653d2b37995d30c4c0/src/BfwController.php#L182-L216 |
3,948 | bfw-systems/controller | src/BfwController.php | BfwController.runProcedural | protected function runProcedural()
{
$routerLinker = $this->ctrlRouterInfos;
$runFct = function() use ($routerLinker) {
$controllerFile = (string) $routerLinker->target;
if (!file_exists(CTRL_DIR.$controllerFile)) {
throw new Exception(
... | php | protected function runProcedural()
{
$routerLinker = $this->ctrlRouterInfos;
$runFct = function() use ($routerLinker) {
$controllerFile = (string) $routerLinker->target;
if (!file_exists(CTRL_DIR.$controllerFile)) {
throw new Exception(
... | [
"protected",
"function",
"runProcedural",
"(",
")",
"{",
"$",
"routerLinker",
"=",
"$",
"this",
"->",
"ctrlRouterInfos",
";",
"$",
"runFct",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"routerLinker",
")",
"{",
"$",
"controllerFile",
"=",
"(",
"string",
... | Call controler when is a procedural file
@return void | [
"Call",
"controler",
"when",
"is",
"a",
"procedural",
"file"
] | c22c497c14df54d8e8f10f653d2b37995d30c4c0 | https://github.com/bfw-systems/controller/blob/c22c497c14df54d8e8f10f653d2b37995d30c4c0/src/BfwController.php#L223-L241 |
3,949 | jmpantoja/planb-utils | src/Utils/Options/Options.php | Options.setCurrentProfile | private function setCurrentProfile(string $name): self
{
if (!$this->mapOfProfiles->hasKey($name)) {
throw UndefinedProfileException::forProfile($name);
}
$this->resolver = null;
$this->currentProfile = $name;
return $this;
} | php | private function setCurrentProfile(string $name): self
{
if (!$this->mapOfProfiles->hasKey($name)) {
throw UndefinedProfileException::forProfile($name);
}
$this->resolver = null;
$this->currentProfile = $name;
return $this;
} | [
"private",
"function",
"setCurrentProfile",
"(",
"string",
"$",
"name",
")",
":",
"self",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"mapOfProfiles",
"->",
"hasKey",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"UndefinedProfileException",
"::",
"forProfile",
"(... | Asigna el perfil
@param string $name
@return \PlanB\Utils\Options\Options | [
"Asigna",
"el",
"perfil"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Utils/Options/Options.php#L91-L101 |
3,950 | jmpantoja/planb-utils | src/Utils/Options/Options.php | Options.getResolver | private function getResolver(): OptionsResolver
{
if (!is_null($this->resolver)) {
return $this->resolver;
}
$this->resolver = $this->buildResolver();
return $this->resolver;
} | php | private function getResolver(): OptionsResolver
{
if (!is_null($this->resolver)) {
return $this->resolver;
}
$this->resolver = $this->buildResolver();
return $this->resolver;
} | [
"private",
"function",
"getResolver",
"(",
")",
":",
"OptionsResolver",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"resolver",
")",
")",
"{",
"return",
"$",
"this",
"->",
"resolver",
";",
"}",
"$",
"this",
"->",
"resolver",
"=",
"$",
"th... | Devuelve el optionsResolver
si no existe, lo crea y configura
@return \Symfony\Component\OptionsResolver\OptionsResolver | [
"Devuelve",
"el",
"optionsResolver",
"si",
"no",
"existe",
"lo",
"crea",
"y",
"configura"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Utils/Options/Options.php#L154-L163 |
3,951 | jmpantoja/planb-utils | src/Utils/Options/Options.php | Options.buildResolver | private function buildResolver(): OptionsResolver
{
$resolver = new OptionsResolver();
$profile = $this->mapOfProfiles->get($this->currentProfile);
call_user_func($profile, $resolver);
return $resolver;
} | php | private function buildResolver(): OptionsResolver
{
$resolver = new OptionsResolver();
$profile = $this->mapOfProfiles->get($this->currentProfile);
call_user_func($profile, $resolver);
return $resolver;
} | [
"private",
"function",
"buildResolver",
"(",
")",
":",
"OptionsResolver",
"{",
"$",
"resolver",
"=",
"new",
"OptionsResolver",
"(",
")",
";",
"$",
"profile",
"=",
"$",
"this",
"->",
"mapOfProfiles",
"->",
"get",
"(",
"$",
"this",
"->",
"currentProfile",
")... | Devuelve un objeto OptionResolver configurado el perfil actual
@return \Symfony\Component\OptionsResolver\OptionsResolver | [
"Devuelve",
"un",
"objeto",
"OptionResolver",
"configurado",
"el",
"perfil",
"actual"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Utils/Options/Options.php#L171-L179 |
3,952 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php | FinePHPArrayTranslationService.validateInstance | public function validateInstance() {
$instanceName = MoufManager::getMoufManager()->findInstanceName($this);
if (!file_exists(ROOT_PATH.$this->i18nMessagePath."message.php")) {
return new MoufValidatorResult(MoufValidatorResult::ERROR, "<b>Fine: </b>Unable to find default translation file for instance: <... | php | public function validateInstance() {
$instanceName = MoufManager::getMoufManager()->findInstanceName($this);
if (!file_exists(ROOT_PATH.$this->i18nMessagePath."message.php")) {
return new MoufValidatorResult(MoufValidatorResult::ERROR, "<b>Fine: </b>Unable to find default translation file for instance: <... | [
"public",
"function",
"validateInstance",
"(",
")",
"{",
"$",
"instanceName",
"=",
"MoufManager",
"::",
"getMoufManager",
"(",
")",
"->",
"findInstanceName",
"(",
"$",
"this",
")",
";",
"if",
"(",
"!",
"file_exists",
"(",
"ROOT_PATH",
".",
"$",
"this",
"->... | Runs the validation of the instance.
Returns a MoufValidatorResult explaining the result.
@return MoufValidatorResult | [
"Runs",
"the",
"validation",
"of",
"the",
"instance",
".",
"Returns",
"a",
"MoufValidatorResult",
"explaining",
"the",
"result",
"."
] | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php#L103-L139 |
3,953 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php | FinePHPArrayTranslationService.forceLanguage | public function forceLanguage($language) {
$changeLanguage = false;
// Check if the user set null to retrieve the initial language
// If the initial language is already recovered fine don't require the file
if($language === null) {
// Save old language
$language = $this->language;
// Retrieve in... | php | public function forceLanguage($language) {
$changeLanguage = false;
// Check if the user set null to retrieve the initial language
// If the initial language is already recovered fine don't require the file
if($language === null) {
// Save old language
$language = $this->language;
// Retrieve in... | [
"public",
"function",
"forceLanguage",
"(",
"$",
"language",
")",
"{",
"$",
"changeLanguage",
"=",
"false",
";",
"// Check if the user set null to retrieve the initial language\r",
"// If the initial language is already recovered fine don't require the file\r",
"if",
"(",
"$",
"l... | Use this function to force the language.
Don't forget to call this function with null to restore default parameters.
Return true if the language change, else the language is the same,
this function return false
@param string $language
@return bool | [
"Use",
"this",
"function",
"to",
"force",
"the",
"language",
".",
"Don",
"t",
"forget",
"to",
"call",
"this",
"function",
"with",
"null",
"to",
"restore",
"default",
"parameters",
".",
"Return",
"true",
"if",
"the",
"language",
"change",
"else",
"the",
"la... | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php#L338-L363 |
3,954 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php | FinePHPArrayTranslationService.loadAllMessages | public function loadAllMessages() {
$files = glob(ROOT_PATH.$this->i18nMessagePath.'message*.php');
$defaultFound = false;
foreach ($files as $file) {
$base = basename($file);
if ($base == "message.php") {
$messageFile = new FineMessageLanguage();
$messageFile->loadAllFile(ROOT_PATH.$this->... | php | public function loadAllMessages() {
$files = glob(ROOT_PATH.$this->i18nMessagePath.'message*.php');
$defaultFound = false;
foreach ($files as $file) {
$base = basename($file);
if ($base == "message.php") {
$messageFile = new FineMessageLanguage();
$messageFile->loadAllFile(ROOT_PATH.$this->... | [
"public",
"function",
"loadAllMessages",
"(",
")",
"{",
"$",
"files",
"=",
"glob",
"(",
"ROOT_PATH",
".",
"$",
"this",
"->",
"i18nMessagePath",
".",
"'message*.php'",
")",
";",
"$",
"defaultFound",
"=",
"false",
";",
"foreach",
"(",
"$",
"files",
"as",
"... | Load all messages | [
"Load",
"all",
"messages"
] | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php#L420-L446 |
3,955 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php | FinePHPArrayTranslationService.getAllMessages | public function getAllMessages($language = null) {
$this->loadAllMessages();
// The array of messages by message, then by language:
// array(message_key => array(language => message))
$msgs = array();
$keys = $this->getAllKeys();
$languages = $this->getSupportedLanguages();
foreach ($... | php | public function getAllMessages($language = null) {
$this->loadAllMessages();
// The array of messages by message, then by language:
// array(message_key => array(language => message))
$msgs = array();
$keys = $this->getAllKeys();
$languages = $this->getSupportedLanguages();
foreach ($... | [
"public",
"function",
"getAllMessages",
"(",
"$",
"language",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"loadAllMessages",
"(",
")",
";",
"// The array of messages by message, then by language:\r",
"// array(message_key => array(language => message))\r",
"$",
"msgs",
"=",
... | Loads and returns all the messages with languages, in a big array. | [
"Loads",
"and",
"returns",
"all",
"the",
"messages",
"with",
"languages",
"in",
"a",
"big",
"array",
"."
] | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php#L451-L470 |
3,956 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php | FinePHPArrayTranslationService.getMessageForAllLanguages | public function getMessageForAllLanguages($key, $lang = null) {
if (!$this->messages) {
$this->loadAllMessages();
}
$messageArray = array();
foreach ($this->messages as $language=>$messageLanguage) {
if(is_null($lang) || $lang == "")
$messageArray[$language] = $messageLanguage->getMessa... | php | public function getMessageForAllLanguages($key, $lang = null) {
if (!$this->messages) {
$this->loadAllMessages();
}
$messageArray = array();
foreach ($this->messages as $language=>$messageLanguage) {
if(is_null($lang) || $lang == "")
$messageArray[$language] = $messageLanguage->getMessa... | [
"public",
"function",
"getMessageForAllLanguages",
"(",
"$",
"key",
",",
"$",
"lang",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"messages",
")",
"{",
"$",
"this",
"->",
"loadAllMessages",
"(",
")",
";",
"}",
"$",
"messageArray",
"=",
... | Get the message for language.
@param string $key
@return array<string, string> | [
"Get",
"the",
"message",
"for",
"language",
"."
] | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php#L478-L492 |
3,957 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php | FinePHPArrayTranslationService.getAllKeys | public function getAllKeys() {
$all_messages = array();
// First, let's merge all the arrays in order to get all the keys:
foreach ($this->messages as $language=>$message) {
$all_messages = array_merge($all_messages, $message->getAllMessages());
}
return array_keys($all_messages);
} | php | public function getAllKeys() {
$all_messages = array();
// First, let's merge all the arrays in order to get all the keys:
foreach ($this->messages as $language=>$message) {
$all_messages = array_merge($all_messages, $message->getAllMessages());
}
return array_keys($all_messages);
} | [
"public",
"function",
"getAllKeys",
"(",
")",
"{",
"$",
"all_messages",
"=",
"array",
"(",
")",
";",
"// First, let's merge all the arrays in order to get all the keys:\r",
"foreach",
"(",
"$",
"this",
"->",
"messages",
"as",
"$",
"language",
"=>",
"$",
"message",
... | Returns the list of all keys that have been defined in all language files.
loadAllMessages must have been called first. | [
"Returns",
"the",
"list",
"of",
"all",
"keys",
"that",
"have",
"been",
"defined",
"in",
"all",
"language",
"files",
".",
"loadAllMessages",
"must",
"have",
"been",
"called",
"first",
"."
] | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php#L498-L507 |
3,958 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php | FinePHPArrayTranslationService.createLanguageFile | public function createLanguageFile($language) {
if ($language=="default") {
$file = ROOT_PATH.$this->i18nMessagePath."message.php";
} else {
$file = ROOT_PATH.$this->i18nMessagePath."message_".$language.".php";
}
if (!is_writable($file)) {
if (!file_exists($file)) {
// Does the director... | php | public function createLanguageFile($language) {
if ($language=="default") {
$file = ROOT_PATH.$this->i18nMessagePath."message.php";
} else {
$file = ROOT_PATH.$this->i18nMessagePath."message_".$language.".php";
}
if (!is_writable($file)) {
if (!file_exists($file)) {
// Does the director... | [
"public",
"function",
"createLanguageFile",
"(",
"$",
"language",
")",
"{",
"if",
"(",
"$",
"language",
"==",
"\"default\"",
")",
"{",
"$",
"file",
"=",
"ROOT_PATH",
".",
"$",
"this",
"->",
"i18nMessagePath",
".",
"\"message.php\"",
";",
"}",
"else",
"{",
... | Creates the file for specified language.
If the file already exists, the function does nothing.
@param string $language | [
"Creates",
"the",
"file",
"for",
"specified",
"language",
".",
"If",
"the",
"file",
"already",
"exists",
"the",
"function",
"does",
"nothing",
"."
] | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php#L522-L554 |
3,959 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php | FinePHPArrayTranslationService.setMessage | public function setMessage($key, $value, $language) {
$messageFile = $this->getMessageLanguageForLanguage($language);
$messageFile->setMessage($key, $value);
$messageFile->save();
} | php | public function setMessage($key, $value, $language) {
$messageFile = $this->getMessageLanguageForLanguage($language);
$messageFile->setMessage($key, $value);
$messageFile->save();
} | [
"public",
"function",
"setMessage",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"language",
")",
"{",
"$",
"messageFile",
"=",
"$",
"this",
"->",
"getMessageLanguageForLanguage",
"(",
"$",
"language",
")",
";",
"$",
"messageFile",
"->",
"setMessage",
"("... | Sets and saves a new message translation.
@param string $key
@param string $value
@param string $language | [
"Sets",
"and",
"saves",
"a",
"new",
"message",
"translation",
"."
] | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php#L563-L567 |
3,960 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php | FinePHPArrayTranslationService.setMessages | public function setMessages(array $messages, $language) {
$messageFile = $this->getMessageLanguageForLanguage($language);
$messageFile->setMessages($messages);
$messageFile->save();
} | php | public function setMessages(array $messages, $language) {
$messageFile = $this->getMessageLanguageForLanguage($language);
$messageFile->setMessages($messages);
$messageFile->save();
} | [
"public",
"function",
"setMessages",
"(",
"array",
"$",
"messages",
",",
"$",
"language",
")",
"{",
"$",
"messageFile",
"=",
"$",
"this",
"->",
"getMessageLanguageForLanguage",
"(",
"$",
"language",
")",
";",
"$",
"messageFile",
"->",
"setMessages",
"(",
"$"... | Sets and saves many messages at once for a given language.
@param array $messages
@param string $language | [
"Sets",
"and",
"saves",
"many",
"messages",
"at",
"once",
"for",
"a",
"given",
"language",
"."
] | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php#L575-L579 |
3,961 | thecodingmachine/utils.i18n.fine | src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php | FinePHPArrayTranslationService.deleteMessage | public function deleteMessage($key, $language) {
$messageFile = $this->getMessageLanguageForLanguage($language);
$messageFile->deleteMessage($key);
$messageFile->save();
} | php | public function deleteMessage($key, $language) {
$messageFile = $this->getMessageLanguageForLanguage($language);
$messageFile->deleteMessage($key);
$messageFile->save();
} | [
"public",
"function",
"deleteMessage",
"(",
"$",
"key",
",",
"$",
"language",
")",
"{",
"$",
"messageFile",
"=",
"$",
"this",
"->",
"getMessageLanguageForLanguage",
"(",
"$",
"language",
")",
";",
"$",
"messageFile",
"->",
"deleteMessage",
"(",
"$",
"key",
... | Deletes a message translation.
@param string $key
@param string $language | [
"Deletes",
"a",
"message",
"translation",
"."
] | 69c165497bc5c202892fdc8022591eddbb8e0e3b | https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Translate/FinePHPArrayTranslationService.php#L587-L591 |
3,962 | phossa2/libs | src/Phossa2/Di/Service.php | Service.__callstatic | public static function __callstatic(/*# string */ $method, array $params)
{
if (static::$container) {
// append scope if provided
if (!isset($params[0])) {
$method .= '@' . $params[0];
}
return static::$container->get($method);
}
... | php | public static function __callstatic(/*# string */ $method, array $params)
{
if (static::$container) {
// append scope if provided
if (!isset($params[0])) {
$method .= '@' . $params[0];
}
return static::$container->get($method);
}
... | [
"public",
"static",
"function",
"__callstatic",
"(",
"/*# string */",
"$",
"method",
",",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"static",
"::",
"$",
"container",
")",
"{",
"// append scope if provided",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"... | Locate a service from the container
```php
// the global config object
$config = Service::config();
// the container
$container = Service::container();
```
@param string $method object id actually
@param array $params
@return object
@throws NotFoundException if container not set or object not found
@throws Runtime... | [
"Locate",
"a",
"service",
"from",
"the",
"container"
] | 921e485c8cc29067f279da2cdd06f47a9bddd115 | https://github.com/phossa2/libs/blob/921e485c8cc29067f279da2cdd06f47a9bddd115/src/Phossa2/Di/Service.php#L61-L76 |
3,963 | getconnect/connect-php | src/Connect.php | Connect.initialize | public static function initialize($projectId, $apiKey) {
if(!isset(self::$client)) {
self::$client = new Client($projectId, $apiKey);
}
return self::$client;
} | php | public static function initialize($projectId, $apiKey) {
if(!isset(self::$client)) {
self::$client = new Client($projectId, $apiKey);
}
return self::$client;
} | [
"public",
"static",
"function",
"initialize",
"(",
"$",
"projectId",
",",
"$",
"apiKey",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"client",
")",
")",
"{",
"self",
"::",
"$",
"client",
"=",
"new",
"Client",
"(",
"$",
"projectId",
"... | Initializes the Connect client singleton instance
@param $projectId
@param $apiKey
@return Client | [
"Initializes",
"the",
"Connect",
"client",
"singleton",
"instance"
] | cbce3daae58eca16450df811ac6f1280fc1ef6b1 | https://github.com/getconnect/connect-php/blob/cbce3daae58eca16450df811ac6f1280fc1ef6b1/src/Connect.php#L18-L23 |
3,964 | bishopb/vanilla | applications/conversations/controllers/class.messagescontroller.php | MessagesController.Add | public function Add($Recipient = '') {
$this->Form->SetModel($this->ConversationModel);
if ($this->Form->AuthenticatedPostBack()) {
$RecipientUserIDs = array();
$To = explode(',', $this->Form->GetFormValue('To', ''));
$UserModel = new UserModel();
foreach ($To as $... | php | public function Add($Recipient = '') {
$this->Form->SetModel($this->ConversationModel);
if ($this->Form->AuthenticatedPostBack()) {
$RecipientUserIDs = array();
$To = explode(',', $this->Form->GetFormValue('To', ''));
$UserModel = new UserModel();
foreach ($To as $... | [
"public",
"function",
"Add",
"(",
"$",
"Recipient",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"Form",
"->",
"SetModel",
"(",
"$",
"this",
"->",
"ConversationModel",
")",
";",
"if",
"(",
"$",
"this",
"->",
"Form",
"->",
"AuthenticatedPostBack",
"(",
")",
... | Start a new conversation.
@since 2.0.0
@access public
@param string $Recipient Username of the recipient. | [
"Start",
"a",
"new",
"conversation",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/conversations/controllers/class.messagescontroller.php#L75-L111 |
3,965 | bishopb/vanilla | applications/conversations/controllers/class.messagescontroller.php | MessagesController.AddMessage | public function AddMessage($ConversationID = '') {
$this->Form->SetModel($this->ConversationMessageModel);
if (is_numeric($ConversationID) && $ConversationID > 0)
$this->Form->AddHidden('ConversationID', $ConversationID);
if ($this->Form->AuthenticatedPostBack()) {
$Conversati... | php | public function AddMessage($ConversationID = '') {
$this->Form->SetModel($this->ConversationMessageModel);
if (is_numeric($ConversationID) && $ConversationID > 0)
$this->Form->AddHidden('ConversationID', $ConversationID);
if ($this->Form->AuthenticatedPostBack()) {
$Conversati... | [
"public",
"function",
"AddMessage",
"(",
"$",
"ConversationID",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"Form",
"->",
"SetModel",
"(",
"$",
"this",
"->",
"ConversationMessageModel",
")",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"ConversationID",
")",
"&&",
... | Add a message to a conversation.
@since 2.0.0
@access public
@param int $ConversationID Unique ID of the conversation. | [
"Add",
"a",
"message",
"to",
"a",
"conversation",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/conversations/controllers/class.messagescontroller.php#L121-L160 |
3,966 | bishopb/vanilla | applications/conversations/controllers/class.messagescontroller.php | MessagesController.All | public function All($Page = '') {
$Session = Gdn::Session();
$this->Title(T('Inbox'));
Gdn_Theme::Section('ConversationList');
list($Offset, $Limit) = OffsetLimit($Page, C('Conversations.Conversations.PerPage', 50));
// Calculate offset
$this->Offset = $Offset;
$... | php | public function All($Page = '') {
$Session = Gdn::Session();
$this->Title(T('Inbox'));
Gdn_Theme::Section('ConversationList');
list($Offset, $Limit) = OffsetLimit($Page, C('Conversations.Conversations.PerPage', 50));
// Calculate offset
$this->Offset = $Offset;
$... | [
"public",
"function",
"All",
"(",
"$",
"Page",
"=",
"''",
")",
"{",
"$",
"Session",
"=",
"Gdn",
"::",
"Session",
"(",
")",
";",
"$",
"this",
"->",
"Title",
"(",
"T",
"(",
"'Inbox'",
")",
")",
";",
"Gdn_Theme",
"::",
"Section",
"(",
"'ConversationLi... | Show all conversations for the currently authenticated user.
@since 2.0.0
@access public
@param string $Page | [
"Show",
"all",
"conversations",
"for",
"the",
"currently",
"authenticated",
"user",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/conversations/controllers/class.messagescontroller.php#L170-L211 |
3,967 | bishopb/vanilla | applications/conversations/controllers/class.messagescontroller.php | MessagesController.Clear | public function Clear($ConversationID = FALSE, $TransientKey = '') {
$Session = Gdn::Session();
// Yes/No response
$this->_DeliveryType = DELIVERY_TYPE_BOOL;
$ValidID = (is_numeric($ConversationID) && $ConversationID > 0);
$ValidSession = ($Session->UserID > 0 && $Session->Va... | php | public function Clear($ConversationID = FALSE, $TransientKey = '') {
$Session = Gdn::Session();
// Yes/No response
$this->_DeliveryType = DELIVERY_TYPE_BOOL;
$ValidID = (is_numeric($ConversationID) && $ConversationID > 0);
$ValidSession = ($Session->UserID > 0 && $Session->Va... | [
"public",
"function",
"Clear",
"(",
"$",
"ConversationID",
"=",
"FALSE",
",",
"$",
"TransientKey",
"=",
"''",
")",
"{",
"$",
"Session",
"=",
"Gdn",
"::",
"Session",
"(",
")",
";",
"// Yes/No response",
"$",
"this",
"->",
"_DeliveryType",
"=",
"DELIVERY_TYP... | Clear the message history for a specific conversation & user.
@since 2.0.0
@access public
@param int $ConversationID Unique ID of conversation to clear. | [
"Clear",
"the",
"message",
"history",
"for",
"a",
"specific",
"conversation",
"&",
"user",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/conversations/controllers/class.messagescontroller.php#L221-L238 |
3,968 | bishopb/vanilla | applications/conversations/controllers/class.messagescontroller.php | MessagesController.Bookmark | public function Bookmark($ConversationID = '', $TransientKey = '') {
$Session = Gdn::Session();
$Success = FALSE;
$Star = FALSE;
// Validate & do bookmarking
if (
is_numeric($ConversationID)
&& $ConversationID > 0
&& $Session->UserID > 0
&& $Sessi... | php | public function Bookmark($ConversationID = '', $TransientKey = '') {
$Session = Gdn::Session();
$Success = FALSE;
$Star = FALSE;
// Validate & do bookmarking
if (
is_numeric($ConversationID)
&& $ConversationID > 0
&& $Session->UserID > 0
&& $Sessi... | [
"public",
"function",
"Bookmark",
"(",
"$",
"ConversationID",
"=",
"''",
",",
"$",
"TransientKey",
"=",
"''",
")",
"{",
"$",
"Session",
"=",
"Gdn",
"::",
"Session",
"(",
")",
";",
"$",
"Success",
"=",
"FALSE",
";",
"$",
"Star",
"=",
"FALSE",
";",
"... | Allows users to bookmark conversations.
@since 2.0.0
@access public
@param int $ConversationID Unique ID of conversation to view.
@param string $TransientKey Single-use hash to prove intent. | [
"Allows",
"users",
"to",
"bookmark",
"conversations",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/conversations/controllers/class.messagescontroller.php#L475-L501 |
3,969 | pletfix/core | src/Services/PDOs/Schemas/Schema.php | Schema.extractTypeHintFromComment | protected function extractTypeHintFromComment($comment)
{
if (empty($comment)) {
return [null, null];
}
if (!preg_match('(\(DC2Type:(\w+)\))', $comment, $match)) {
return [null, $comment];
}
$type = $match[1];
$comment = trim(str_replace('... | php | protected function extractTypeHintFromComment($comment)
{
if (empty($comment)) {
return [null, null];
}
if (!preg_match('(\(DC2Type:(\w+)\))', $comment, $match)) {
return [null, $comment];
}
$type = $match[1];
$comment = trim(str_replace('... | [
"protected",
"function",
"extractTypeHintFromComment",
"(",
"$",
"comment",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"comment",
")",
")",
"{",
"return",
"[",
"null",
",",
"null",
"]",
";",
"}",
"if",
"(",
"!",
"preg_match",
"(",
"'(\\(DC2Type:(\\w+)\\))'",
... | Split a type-hint for Database Access Layer from comment.
The type-hint is compatible with Doctrine 2.
@param string $comment
@return array | [
"Split",
"a",
"type",
"-",
"hint",
"for",
"Database",
"Access",
"Layer",
"from",
"comment",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Schemas/Schema.php#L62-L80 |
3,970 | pletfix/core | src/Services/PDOs/Schemas/Schema.php | Schema.compileColumnDefinition | protected function compileColumnDefinition(array $options)
{
$options = array_merge([
'type' => null,
'size' => null,
'scale' => null,
'nullable' => false,
'default' => null,
'collation' => null,
'comment' ... | php | protected function compileColumnDefinition(array $options)
{
$options = array_merge([
'type' => null,
'size' => null,
'scale' => null,
'nullable' => false,
'default' => null,
'collation' => null,
'comment' ... | [
"protected",
"function",
"compileColumnDefinition",
"(",
"array",
"$",
"options",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'type'",
"=>",
"null",
",",
"'size'",
"=>",
"null",
",",
"'scale'",
"=>",
"null",
",",
"'nullable'",
"=>",
"false",
"... | Compile the column definitions.
This function is used by createTable() and addColumn().
Options have following properties:
- type: (string) The column data type. Data types are as reported by the database.
- size: (int) The column size (the maximum number of digits).
- scale: (int) The number of d... | [
"Compile",
"the",
"column",
"definitions",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Schemas/Schema.php#L243-L297 |
3,971 | pletfix/core | src/Services/PDOs/Schemas/Schema.php | Schema.compileFieldType | protected function compileFieldType($type, $size, $scale)
{
switch (strtolower($type)) {
case 'smallint': // 2 Byte
return 'SMALLINT';
case 'integer': // 4 Byte
return 'INT';
case 'unsigned': // 4 Byte
return 'IN... | php | protected function compileFieldType($type, $size, $scale)
{
switch (strtolower($type)) {
case 'smallint': // 2 Byte
return 'SMALLINT';
case 'integer': // 4 Byte
return 'INT';
case 'unsigned': // 4 Byte
return 'IN... | [
"protected",
"function",
"compileFieldType",
"(",
"$",
"type",
",",
"$",
"size",
",",
"$",
"scale",
")",
"{",
"switch",
"(",
"strtolower",
"(",
"$",
"type",
")",
")",
"{",
"case",
"'smallint'",
":",
"// 2 Byte",
"return",
"'SMALLINT'",
";",
"case",
"'int... | Compile the column type.
This function is used by compileColumnDefinition().
@param string $type by Column type supported by Database Access Layer
@param int|null $size
@param int|null $scale
@return string | [
"Compile",
"the",
"column",
"type",
"."
] | 974945500f278eb6c1779832e08bbfca1007a7b3 | https://github.com/pletfix/core/blob/974945500f278eb6c1779832e08bbfca1007a7b3/src/Services/PDOs/Schemas/Schema.php#L371-L433 |
3,972 | jpcercal/doctrine-bundle | src/DBAL/ConnectionWrapper.php | ConnectionWrapper.forceSwitch | public function forceSwitch($dbHost, $dbName, $dbUser, $dbPassword, array $dbOptions = array())
{
if ($this->getSession()->has(self::SESSION_CONNECTION_KEY)) {
$current = $this->getSession()->get(self::SESSION_CONNECTION_KEY);
if ($current[self::PARAM_HOST] === $dbHost && $current[se... | php | public function forceSwitch($dbHost, $dbName, $dbUser, $dbPassword, array $dbOptions = array())
{
if ($this->getSession()->has(self::SESSION_CONNECTION_KEY)) {
$current = $this->getSession()->get(self::SESSION_CONNECTION_KEY);
if ($current[self::PARAM_HOST] === $dbHost && $current[se... | [
"public",
"function",
"forceSwitch",
"(",
"$",
"dbHost",
",",
"$",
"dbName",
",",
"$",
"dbUser",
",",
"$",
"dbPassword",
",",
"array",
"$",
"dbOptions",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"... | Force a switch of database connection.
@param string $dbHost
@param string $dbName
@param string $dbUser
@param string $dbPassword
@param array $dbOptions
@return bool | [
"Force",
"a",
"switch",
"of",
"database",
"connection",
"."
] | 3d964353fab17978b0514d17aa0329efeeac4e03 | https://github.com/jpcercal/doctrine-bundle/blob/3d964353fab17978b0514d17aa0329efeeac4e03/src/DBAL/ConnectionWrapper.php#L158-L180 |
3,973 | jpcercal/doctrine-bundle | src/DBAL/ConnectionWrapper.php | ConnectionWrapper.getParamsKey | protected function getParamsKey()
{
return array(
self::PARAM_DRIVER_OPTIONS,
self::PARAM_HOST,
self::PARAM_DATABASE,
self::PARAM_USER,
self::PARAM_PASSWORD,
);
} | php | protected function getParamsKey()
{
return array(
self::PARAM_DRIVER_OPTIONS,
self::PARAM_HOST,
self::PARAM_DATABASE,
self::PARAM_USER,
self::PARAM_PASSWORD,
);
} | [
"protected",
"function",
"getParamsKey",
"(",
")",
"{",
"return",
"array",
"(",
"self",
"::",
"PARAM_DRIVER_OPTIONS",
",",
"self",
"::",
"PARAM_HOST",
",",
"self",
"::",
"PARAM_DATABASE",
",",
"self",
"::",
"PARAM_USER",
",",
"self",
"::",
"PARAM_PASSWORD",
",... | Get a list of parameter keys
@return array | [
"Get",
"a",
"list",
"of",
"parameter",
"keys"
] | 3d964353fab17978b0514d17aa0329efeeac4e03 | https://github.com/jpcercal/doctrine-bundle/blob/3d964353fab17978b0514d17aa0329efeeac4e03/src/DBAL/ConnectionWrapper.php#L199-L208 |
3,974 | jpcercal/doctrine-bundle | src/DBAL/ConnectionWrapper.php | ConnectionWrapper.hasNewConnectionParams | protected function hasNewConnectionParams(array $params)
{
if (!$this->getSession()->has(self::SESSION_CONNECTION_KEY)) {
return true;
}
$currentParams = $this->getSession()->get(self::SESSION_CONNECTION_KEY);
foreach ($this->getParamsKey() as $key) {
if (is... | php | protected function hasNewConnectionParams(array $params)
{
if (!$this->getSession()->has(self::SESSION_CONNECTION_KEY)) {
return true;
}
$currentParams = $this->getSession()->get(self::SESSION_CONNECTION_KEY);
foreach ($this->getParamsKey() as $key) {
if (is... | [
"protected",
"function",
"hasNewConnectionParams",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"has",
"(",
"self",
"::",
"SESSION_CONNECTION_KEY",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",... | Checks if has new connection parameters
@param array $params
@return bool | [
"Checks",
"if",
"has",
"new",
"connection",
"parameters"
] | 3d964353fab17978b0514d17aa0329efeeac4e03 | https://github.com/jpcercal/doctrine-bundle/blob/3d964353fab17978b0514d17aa0329efeeac4e03/src/DBAL/ConnectionWrapper.php#L217-L232 |
3,975 | watoki/collections | src/watoki/collections/Map.php | Map.remove | public function remove($key) {
$value = $this->elements[$this->hash($key)];
unset($this->elements[$this->hash($key)]);
$this->fire(new MapRemoveEvent($key, $value));
return $value;
} | php | public function remove($key) {
$value = $this->elements[$this->hash($key)];
unset($this->elements[$this->hash($key)]);
$this->fire(new MapRemoveEvent($key, $value));
return $value;
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"elements",
"[",
"$",
"this",
"->",
"hash",
"(",
"$",
"key",
")",
"]",
";",
"unset",
"(",
"$",
"this",
"->",
"elements",
"[",
"$",
"this",
"->",
"h... | Removes element with given key.
@param mixed $key
@return mixed The value of the removed key | [
"Removes",
"element",
"with",
"given",
"key",
"."
] | ff9c866020c7f2daff1b9bc24fe6d64e218af157 | https://github.com/watoki/collections/blob/ff9c866020c7f2daff1b9bc24fe6d64e218af157/src/watoki/collections/Map.php#L43-L48 |
3,976 | mvccore/ext-view-helper-formatnumber | src/MvcCore/Ext/Views/Helpers/FormatNumberHelper.php | FormatNumberHelper.& | protected function & getIntlNumberFormatter (
$langAndLocale = NULL,
$style = NULL,
$pattern = NULL,
$attributes = [],
$textAttributes = []
) {
$key = implode('_', [
'number',
serialize(func_get_args())
]);
if (!isset($this->intlFormatters[$key])) {
$formatter = \numfmt_create(
$this->lang... | php | protected function & getIntlNumberFormatter (
$langAndLocale = NULL,
$style = NULL,
$pattern = NULL,
$attributes = [],
$textAttributes = []
) {
$key = implode('_', [
'number',
serialize(func_get_args())
]);
if (!isset($this->intlFormatters[$key])) {
$formatter = \numfmt_create(
$this->lang... | [
"protected",
"function",
"&",
"getIntlNumberFormatter",
"(",
"$",
"langAndLocale",
"=",
"NULL",
",",
"$",
"style",
"=",
"NULL",
",",
"$",
"pattern",
"=",
"NULL",
",",
"$",
"attributes",
"=",
"[",
"]",
",",
"$",
"textAttributes",
"=",
"[",
"]",
")",
"{"... | Get stored `\NumberFormatter` instance or create new one.
@param string|NULL $langAndLocale
@param int|NULL $style
@param int|NULL $pattern
@param array $attributes
@param array $textAttributes
@return \NumberFormatter | [
"Get",
"stored",
"\\",
"NumberFormatter",
"instance",
"or",
"create",
"new",
"one",
"."
] | 283d641638947544ecd4f5c075ebe0f3bcf0c07d | https://github.com/mvccore/ext-view-helper-formatnumber/blob/283d641638947544ecd4f5c075ebe0f3bcf0c07d/src/MvcCore/Ext/Views/Helpers/FormatNumberHelper.php#L369-L391 |
3,977 | mvccore/ext-view-helper-formatnumber | src/MvcCore/Ext/Views/Helpers/FormatNumberHelper.php | FormatNumberHelper.setUpLocaleConventions | protected function setUpLocaleConventions () {
$this->localeConventions = NULL;
if ($this->systemEncoding !== NULL) {
$this->localeConventions = (object) localeconv();
}
if (!$this->localeConventions || $this->localeConventions->frac_digits == 127)
// something wrong - use default values for en_US:-(
$... | php | protected function setUpLocaleConventions () {
$this->localeConventions = NULL;
if ($this->systemEncoding !== NULL) {
$this->localeConventions = (object) localeconv();
}
if (!$this->localeConventions || $this->localeConventions->frac_digits == 127)
// something wrong - use default values for en_US:-(
$... | [
"protected",
"function",
"setUpLocaleConventions",
"(",
")",
"{",
"$",
"this",
"->",
"localeConventions",
"=",
"NULL",
";",
"if",
"(",
"$",
"this",
"->",
"systemEncoding",
"!==",
"NULL",
")",
"{",
"$",
"this",
"->",
"localeConventions",
"=",
"(",
"object",
... | Try to set up local conventions by system locale settings
only if there was any success with setting up system locale.
If system locale is not set up properly - use default formatting conventions.
@see http://php.net/manual/en/function.localeconv.php
@return void | [
"Try",
"to",
"set",
"up",
"local",
"conventions",
"by",
"system",
"locale",
"settings",
"only",
"if",
"there",
"was",
"any",
"success",
"with",
"setting",
"up",
"system",
"locale",
".",
"If",
"system",
"locale",
"is",
"not",
"set",
"up",
"properly",
"-",
... | 283d641638947544ecd4f5c075ebe0f3bcf0c07d | https://github.com/mvccore/ext-view-helper-formatnumber/blob/283d641638947544ecd4f5c075ebe0f3bcf0c07d/src/MvcCore/Ext/Views/Helpers/FormatNumberHelper.php#L482-L493 |
3,978 | SymBB/symbb | src/Symbb/Core/SiteBundle/Api/NavigationApi.php | NavigationApi.save | public function save($object)
{
if (is_array($object)) {
$objectData = $object;
if ($object['id'] > 0) {
$object = $this->find($object['id']);
} else {
$object = new Navigation();
$site = $this->siteManager->find($objectDat... | php | public function save($object)
{
if (is_array($object)) {
$objectData = $object;
if ($object['id'] > 0) {
$object = $this->find($object['id']);
} else {
$object = new Navigation();
$site = $this->siteManager->find($objectDat... | [
"public",
"function",
"save",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"object",
")",
")",
"{",
"$",
"objectData",
"=",
"$",
"object",
";",
"if",
"(",
"$",
"object",
"[",
"'id'",
"]",
">",
"0",
")",
"{",
"$",
"object",
"="... | save a Navigation
you can pass the Navigation object or an array with the fields
if you pass an array the keys must be with underscore and not with CamelCase
@param Navigation|array $object
@return Navigation | [
"save",
"a",
"Navigation",
"you",
"can",
"pass",
"the",
"Navigation",
"object",
"or",
"an",
"array",
"with",
"the",
"fields",
"if",
"you",
"pass",
"an",
"array",
"the",
"keys",
"must",
"be",
"with",
"underscore",
"and",
"not",
"with",
"CamelCase"
] | be25357502e6a51016fa0b128a46c2dc87fa8fb2 | https://github.com/SymBB/symbb/blob/be25357502e6a51016fa0b128a46c2dc87fa8fb2/src/Symbb/Core/SiteBundle/Api/NavigationApi.php#L67-L95 |
3,979 | fabsgc/framework | Core/Url/Url.php | Url.get | public static function get($name, $var = [], $absolute = false) {
$routes = self::resolveStatic(RESOLVE_ROUTE, $name);
if (isset($routes[0]['' . $routes[1] . ''])) {
$route = $routes[0]['' . $routes[1] . ''];
$url = preg_replace('#\((.*)\)#isU', '<($1)>', $route['url']);
... | php | public static function get($name, $var = [], $absolute = false) {
$routes = self::resolveStatic(RESOLVE_ROUTE, $name);
if (isset($routes[0]['' . $routes[1] . ''])) {
$route = $routes[0]['' . $routes[1] . ''];
$url = preg_replace('#\((.*)\)#isU', '<($1)>', $route['url']);
... | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"var",
"=",
"[",
"]",
",",
"$",
"absolute",
"=",
"false",
")",
"{",
"$",
"routes",
"=",
"self",
"::",
"resolveStatic",
"(",
"RESOLVE_ROUTE",
",",
"$",
"name",
")",
";",
"if",
"(",
... | get an url
@access public
@param string $name : name of the url. With .app. before, it use the default route file. Width .x., it use the module x
@param array $var
@param boolean $absolute : add absolute link
@return string
@since 3.0 | [
"get",
"an",
"url"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Url/Url.php#L25-L88 |
3,980 | tekkla/core-security | Core/Security/Ban/BanCheck.php | BanCheck.countBanLogEntries | public function countBanLogEntries(): int
{
$this->db->qb([
'table' => 'core_bans',
'fields' => 'COUNT(ip)',
'filter' => 'ip=:ip AND logstamp+:ttl > :expires AND code>0',
'params' => [
':ip' => $this->ip,
':ttl' => $this->ttl_ba... | php | public function countBanLogEntries(): int
{
$this->db->qb([
'table' => 'core_bans',
'fields' => 'COUNT(ip)',
'filter' => 'ip=:ip AND logstamp+:ttl > :expires AND code>0',
'params' => [
':ip' => $this->ip,
':ttl' => $this->ttl_ba... | [
"public",
"function",
"countBanLogEntries",
"(",
")",
":",
"int",
"{",
"$",
"this",
"->",
"db",
"->",
"qb",
"(",
"[",
"'table'",
"=>",
"'core_bans'",
",",
"'fields'",
"=>",
"'COUNT(ip)'",
",",
"'filter'",
"=>",
"'ip=:ip AND logstamp+:ttl > :expires AND code>0'",
... | Returns the number of ban entires in the log for an IP address within the set duration.
@return int | [
"Returns",
"the",
"number",
"of",
"ban",
"entires",
"in",
"the",
"log",
"for",
"an",
"IP",
"address",
"within",
"the",
"set",
"duration",
"."
] | 66a09ca63a2f5a2239ea7537d2d6bdaa89b0a582 | https://github.com/tekkla/core-security/blob/66a09ca63a2f5a2239ea7537d2d6bdaa89b0a582/Core/Security/Ban/BanCheck.php#L147-L161 |
3,981 | tekkla/core-security | Core/Security/Ban/BanCheck.php | BanCheck.getBanActiveTimestamp | public function getBanActiveTimestamp(): int
{
$this->db->qb([
'table' => 'core_bans',
'fields' => 'logstamp',
'filter' => 'ip=:ip AND code=0',
'params' => [
':ip' => $this->ip
],
'order' => 'logstamp DESC',
... | php | public function getBanActiveTimestamp(): int
{
$this->db->qb([
'table' => 'core_bans',
'fields' => 'logstamp',
'filter' => 'ip=:ip AND code=0',
'params' => [
':ip' => $this->ip
],
'order' => 'logstamp DESC',
... | [
"public",
"function",
"getBanActiveTimestamp",
"(",
")",
":",
"int",
"{",
"$",
"this",
"->",
"db",
"->",
"qb",
"(",
"[",
"'table'",
"=>",
"'core_bans'",
",",
"'fields'",
"=>",
"'logstamp'",
",",
"'filter'",
"=>",
"'ip=:ip AND code=0'",
",",
"'params'",
"=>",... | Returns the timestamp from log when ban got active for this ip
@return int | [
"Returns",
"the",
"timestamp",
"from",
"log",
"when",
"ban",
"got",
"active",
"for",
"this",
"ip"
] | 66a09ca63a2f5a2239ea7537d2d6bdaa89b0a582 | https://github.com/tekkla/core-security/blob/66a09ca63a2f5a2239ea7537d2d6bdaa89b0a582/Core/Security/Ban/BanCheck.php#L168-L184 |
3,982 | wasabi-cms/core | src/View/Widget/ToggleSwitchWidget.php | ToggleSwitchWidget.render | public function render(array $data, ContextInterface $context)
{
$data += [
'value' => 1,
'val' => null,
'disabled' => false,
'onLabel' => 'on',
'offLabel' => 'off',
'class' => ''
];
if ($this->_isChecked($data)) {
... | php | public function render(array $data, ContextInterface $context)
{
$data += [
'value' => 1,
'val' => null,
'disabled' => false,
'onLabel' => 'on',
'offLabel' => 'off',
'class' => ''
];
if ($this->_isChecked($data)) {
... | [
"public",
"function",
"render",
"(",
"array",
"$",
"data",
",",
"ContextInterface",
"$",
"context",
")",
"{",
"$",
"data",
"+=",
"[",
"'value'",
"=>",
"1",
",",
"'val'",
"=>",
"null",
",",
"'disabled'",
"=>",
"false",
",",
"'onLabel'",
"=>",
"'on'",
",... | Render a switchToggle element.
Data supports the following keys:
- `name` - The name of the input.
- `value` - The value attribute. Defaults to '1'.
- `val` - The current value. If it matches `value` the checkbox will be checked.
You can also use the 'checked' attribute to make the checkbox checked.
- `disabled` - Wh... | [
"Render",
"a",
"switchToggle",
"element",
"."
] | 0eadbb64d2fc201bacc63c93814adeca70e08f90 | https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/View/Widget/ToggleSwitchWidget.php#L36-L83 |
3,983 | FiveLab/Exception | src/UnexpectedTypeException.php | UnexpectedTypeException.create | public static function create($actual, $expected, $code = 0, \Exception $prev = null)
{
$message = sprintf(
'The value must be a type of %s, %s given.',
is_object($expected) ? get_class($expected) : (is_scalar($expected) ? $expected : gettype($expected)),
is_object($actua... | php | public static function create($actual, $expected, $code = 0, \Exception $prev = null)
{
$message = sprintf(
'The value must be a type of %s, %s given.',
is_object($expected) ? get_class($expected) : (is_scalar($expected) ? $expected : gettype($expected)),
is_object($actua... | [
"public",
"static",
"function",
"create",
"(",
"$",
"actual",
",",
"$",
"expected",
",",
"$",
"code",
"=",
"0",
",",
"\\",
"Exception",
"$",
"prev",
"=",
"null",
")",
"{",
"$",
"message",
"=",
"sprintf",
"(",
"'The value must be a type of %s, %s given.'",
... | Create a new exception
@param string|object $actual
@param string|object $expected
@param int $code
@param \Exception $prev
@return UnexpectedTypeException | [
"Create",
"a",
"new",
"exception"
] | 6fc8bb53fe8f70b32e3cf71840799179893220a7 | https://github.com/FiveLab/Exception/blob/6fc8bb53fe8f70b32e3cf71840799179893220a7/src/UnexpectedTypeException.php#L31-L40 |
3,984 | AlcyZ/Alcys-ORM | src/Core/Db/Service/AlcysDb.php | AlcysDb.select | public function select($tableName, $tableAlias = null)
{
return $this->dbFactory->facade('Select', $this->pdo, $tableName, $tableAlias);
} | php | public function select($tableName, $tableAlias = null)
{
return $this->dbFactory->facade('Select', $this->pdo, $tableName, $tableAlias);
} | [
"public",
"function",
"select",
"(",
"$",
"tableName",
",",
"$",
"tableAlias",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"dbFactory",
"->",
"facade",
"(",
"'Select'",
",",
"$",
"this",
"->",
"pdo",
",",
"$",
"tableName",
",",
"$",
"tableAlias... | Get an prepare instance of a select facade for an easy access to the database.
@param string $tableName The name of the table from which should select.
@param string|null $tableAlias (Optional) If exists an alias name.
@return SelectFacade An object with helper method to communicate with your database. | [
"Get",
"an",
"prepare",
"instance",
"of",
"a",
"select",
"facade",
"for",
"an",
"easy",
"access",
"to",
"the",
"database",
"."
] | dd30946ad35ab06cba2167cf6dfa02b733614720 | https://github.com/AlcyZ/Alcys-ORM/blob/dd30946ad35ab06cba2167cf6dfa02b733614720/src/Core/Db/Service/AlcysDb.php#L67-L70 |
3,985 | WellCommerce/Form | Validator/ConstraintViolationMapper.php | ConstraintViolationMapper.mapErrorsToForm | public function mapErrorsToForm(ConstraintViolationListInterface $errors, FormInterface $form)
{
$messages = $this->extractMessages($errors);
$this->mapMessagesToElementCollection($messages, $form->getChildren());
} | php | public function mapErrorsToForm(ConstraintViolationListInterface $errors, FormInterface $form)
{
$messages = $this->extractMessages($errors);
$this->mapMessagesToElementCollection($messages, $form->getChildren());
} | [
"public",
"function",
"mapErrorsToForm",
"(",
"ConstraintViolationListInterface",
"$",
"errors",
",",
"FormInterface",
"$",
"form",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"extractMessages",
"(",
"$",
"errors",
")",
";",
"$",
"this",
"->",
"mapMessa... | Maps errors messages to all form elements
@param ConstraintViolationListInterface $errors
@param FormInterface $form | [
"Maps",
"errors",
"messages",
"to",
"all",
"form",
"elements"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/Validator/ConstraintViolationMapper.php#L49-L54 |
3,986 | WellCommerce/Form | Validator/ConstraintViolationMapper.php | ConstraintViolationMapper.mapMessagesToElementCollection | protected function mapMessagesToElementCollection(array $messages, ElementCollection $children)
{
$children->forAll(function (ElementInterface $element) use ($messages) {
$this->mapMessagesToElement($messages, $element);
});
} | php | protected function mapMessagesToElementCollection(array $messages, ElementCollection $children)
{
$children->forAll(function (ElementInterface $element) use ($messages) {
$this->mapMessagesToElement($messages, $element);
});
} | [
"protected",
"function",
"mapMessagesToElementCollection",
"(",
"array",
"$",
"messages",
",",
"ElementCollection",
"$",
"children",
")",
"{",
"$",
"children",
"->",
"forAll",
"(",
"function",
"(",
"ElementInterface",
"$",
"element",
")",
"use",
"(",
"$",
"messa... | Maps errors to elements children
@param array $messages
@param ElementCollection $children | [
"Maps",
"errors",
"to",
"elements",
"children"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/Validator/ConstraintViolationMapper.php#L100-L105 |
3,987 | WellCommerce/Form | Validator/ConstraintViolationMapper.php | ConstraintViolationMapper.mapMessagesToElement | protected function mapMessagesToElement(array $messages, ElementInterface $element)
{
if ($element->hasPropertyPath()) {
$propertyPathParts = explode('.', $element->getPropertyPath(false));
$propertyPath = $this->buildPath($propertyPathParts);
if ($this->propertyAcce... | php | protected function mapMessagesToElement(array $messages, ElementInterface $element)
{
if ($element->hasPropertyPath()) {
$propertyPathParts = explode('.', $element->getPropertyPath(false));
$propertyPath = $this->buildPath($propertyPathParts);
if ($this->propertyAcce... | [
"protected",
"function",
"mapMessagesToElement",
"(",
"array",
"$",
"messages",
",",
"ElementInterface",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element",
"->",
"hasPropertyPath",
"(",
")",
")",
"{",
"$",
"propertyPathParts",
"=",
"explode",
"(",
"'.'",
"... | Sets errors on element
@param array $messages
@param ElementInterface $element | [
"Sets",
"errors",
"on",
"element"
] | dad15dbdcf1d13f927fa86f5198bcb6abed1974a | https://github.com/WellCommerce/Form/blob/dad15dbdcf1d13f927fa86f5198bcb6abed1974a/Validator/ConstraintViolationMapper.php#L113-L129 |
3,988 | n0m4dz/laracasa | Zend/Gdata/Docs.php | Zend_Gdata_Docs.getDocumentListFeed | public function getDocumentListFeed($location = null)
{
if ($location === null) {
$uri = self::DOCUMENTS_LIST_FEED_URI;
} else if ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
}
return... | php | public function getDocumentListFeed($location = null)
{
if ($location === null) {
$uri = self::DOCUMENTS_LIST_FEED_URI;
} else if ($location instanceof Zend_Gdata_Query) {
$uri = $location->getQueryUrl();
} else {
$uri = $location;
}
return... | [
"public",
"function",
"getDocumentListFeed",
"(",
"$",
"location",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"location",
"===",
"null",
")",
"{",
"$",
"uri",
"=",
"self",
"::",
"DOCUMENTS_LIST_FEED_URI",
";",
"}",
"else",
"if",
"(",
"$",
"location",
"instan... | Retreive feed object containing entries for the user's documents.
@param mixed $location The location for the feed, as a URL or Query
@return Zend_Gdata_Docs_DocumentListFeed | [
"Retreive",
"feed",
"object",
"containing",
"entries",
"for",
"the",
"user",
"s",
"documents",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Docs.php#L129-L139 |
3,989 | n0m4dz/laracasa | Zend/Gdata/Docs.php | Zend_Gdata_Docs.getDocumentListEntry | public function getDocumentListEntry($location = null)
{
if ($location === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null'
);
} else if ($locatio... | php | public function getDocumentListEntry($location = null)
{
if ($location === null) {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException(
'Location must not be null'
);
} else if ($locatio... | [
"public",
"function",
"getDocumentListEntry",
"(",
"$",
"location",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"location",
"===",
"null",
")",
"{",
"require_once",
"'Zend/Gdata/App/InvalidArgumentException.php'",
";",
"throw",
"new",
"Zend_Gdata_App_InvalidArgumentException... | Retreive entry object representing a single document.
@param mixed $location The location for the entry, as a URL or Query
@return Zend_Gdata_Docs_DocumentListEntry
@throws Zend_Gdata_App_InvalidArgumentException | [
"Retreive",
"entry",
"object",
"representing",
"a",
"single",
"document",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Docs.php#L148-L161 |
3,990 | n0m4dz/laracasa | Zend/Gdata/Docs.php | Zend_Gdata_Docs.uploadFile | public function uploadFile($fileLocation, $title = null, $mimeType = null,
$uri = null
)
{
// Set the URI to which the file will be uploaded.
if ($uri === null) {
$uri = $this->_defaultPostUri;
}
// Create the media source which describes the file.
$f... | php | public function uploadFile($fileLocation, $title = null, $mimeType = null,
$uri = null
)
{
// Set the URI to which the file will be uploaded.
if ($uri === null) {
$uri = $this->_defaultPostUri;
}
// Create the media source which describes the file.
$f... | [
"public",
"function",
"uploadFile",
"(",
"$",
"fileLocation",
",",
"$",
"title",
"=",
"null",
",",
"$",
"mimeType",
"=",
"null",
",",
"$",
"uri",
"=",
"null",
")",
"{",
"// Set the URI to which the file will be uploaded.",
"if",
"(",
"$",
"uri",
"===",
"null... | Upload a local file to create a new Google Document entry.
@param string $fileLocation The full or relative path of the file to
be uploaded.
@param string $title The name that this document should have on the
server. If set, the title is used as the slug header in the
POST request. If no title is provided, the locatio... | [
"Upload",
"a",
"local",
"file",
"to",
"create",
"a",
"new",
"Google",
"Document",
"entry",
"."
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Docs.php#L237-L271 |
3,991 | n0m4dz/laracasa | Zend/Gdata/Docs.php | Zend_Gdata_Docs.createFolder | public function createFolder($folderName, $folderResourceId = null)
{
$category = new Zend_Gdata_App_Extension_Category(
self::DOCUMENTS_CATEGORY_TERM,
self::DOCUMENTS_CATEGORY_SCHEMA
);
$title = new Zend_Gdata_App_Extension_Title($folderName);
$entry = ... | php | public function createFolder($folderName, $folderResourceId = null)
{
$category = new Zend_Gdata_App_Extension_Category(
self::DOCUMENTS_CATEGORY_TERM,
self::DOCUMENTS_CATEGORY_SCHEMA
);
$title = new Zend_Gdata_App_Extension_Title($folderName);
$entry = ... | [
"public",
"function",
"createFolder",
"(",
"$",
"folderName",
",",
"$",
"folderResourceId",
"=",
"null",
")",
"{",
"$",
"category",
"=",
"new",
"Zend_Gdata_App_Extension_Category",
"(",
"self",
"::",
"DOCUMENTS_CATEGORY_TERM",
",",
"self",
"::",
"DOCUMENTS_CATEGORY_... | Creates a new folder in Google Docs
@param string $folderName The folder name to create
@param string|null $folderResourceId The parent folder to create it in
("folder%3Amy_parent_folder")
@return Zend_Gdata_Entry The folder entry created.
@todo ZF-8732: This should return a *subclass* of Zend_Gdata_Entry, but
the app... | [
"Creates",
"a",
"new",
"folder",
"in",
"Google",
"Docs"
] | 6141f0c16c7d4453275e3b74be5041f336085c91 | https://github.com/n0m4dz/laracasa/blob/6141f0c16c7d4453275e3b74be5041f336085c91/Zend/Gdata/Docs.php#L283-L301 |
3,992 | fluxbb/commonmark | src/Common/Text.php | Text.encodeUrl | public function encodeUrl()
{
$ignore = [
'%21' => '!',
'%23' => '#',
'%24' => '$',
'%26' => '&',
'%27' => '\'',
'%28' => '(',
'%29' => ')',
'%2A' => '*',
'%2B' => '+',
'%2C' => ',',
... | php | public function encodeUrl()
{
$ignore = [
'%21' => '!',
'%23' => '#',
'%24' => '$',
'%26' => '&',
'%27' => '\'',
'%28' => '(',
'%29' => ')',
'%2A' => '*',
'%2B' => '+',
'%2C' => ',',
... | [
"public",
"function",
"encodeUrl",
"(",
")",
"{",
"$",
"ignore",
"=",
"[",
"'%21'",
"=>",
"'!'",
",",
"'%23'",
"=>",
"'#'",
",",
"'%24'",
"=>",
"'$'",
",",
"'%26'",
"=>",
"'&'",
",",
"'%27'",
"=>",
"'\\''",
",",
"'%28'",
"=>",
"'('",
",",
"'%29'",
... | Escape special characters for use in an URL.
@return Text | [
"Escape",
"special",
"characters",
"for",
"use",
"in",
"an",
"URL",
"."
] | a61795a074aac19d8509f5673d5ee230dca292bc | https://github.com/fluxbb/commonmark/blob/a61795a074aac19d8509f5673d5ee230dca292bc/src/Common/Text.php#L218-L246 |
3,993 | fluxbb/commonmark | src/Common/Text.php | Text.handle | public function handle($pattern, $resultHandler, $partHandler)
{
$nodes = [];
$text = preg_replace_callback($pattern, function ($matches) use (&$nodes) {
$nodes[] = $matches;
return "\0";
}, $this->text);
$parts = explode("\0", $text);
$match = 0;
... | php | public function handle($pattern, $resultHandler, $partHandler)
{
$nodes = [];
$text = preg_replace_callback($pattern, function ($matches) use (&$nodes) {
$nodes[] = $matches;
return "\0";
}, $this->text);
$parts = explode("\0", $text);
$match = 0;
... | [
"public",
"function",
"handle",
"(",
"$",
"pattern",
",",
"$",
"resultHandler",
",",
"$",
"partHandler",
")",
"{",
"$",
"nodes",
"=",
"[",
"]",
";",
"$",
"text",
"=",
"preg_replace_callback",
"(",
"$",
"pattern",
",",
"function",
"(",
"$",
"matches",
"... | Find the given regular expression and execute callbacks on it and its surroundings.
@param string $pattern The pattern to search for. It can be either a string or an array with strings.
@param callable $resultHandler A callback that will be passed an array of matched elements in the subject string.
@param call... | [
"Find",
"the",
"given",
"regular",
"expression",
"and",
"execute",
"callbacks",
"on",
"it",
"and",
"its",
"surroundings",
"."
] | a61795a074aac19d8509f5673d5ee230dca292bc | https://github.com/fluxbb/commonmark/blob/a61795a074aac19d8509f5673d5ee230dca292bc/src/Common/Text.php#L283-L311 |
3,994 | graze/xml-utils | src/XmlConverter.php | XmlConverter.addArrayAsChildren | public function addArrayAsChildren(array $array, SimpleXMLElement $xmlElement, $ignoreEmptyElements = true)
{
// Keep an array of children that are added to $xmlElement
$children = [];
// Add each element of the array as a child to $xmlElement
foreach ($array as $key => $value) {
... | php | public function addArrayAsChildren(array $array, SimpleXMLElement $xmlElement, $ignoreEmptyElements = true)
{
// Keep an array of children that are added to $xmlElement
$children = [];
// Add each element of the array as a child to $xmlElement
foreach ($array as $key => $value) {
... | [
"public",
"function",
"addArrayAsChildren",
"(",
"array",
"$",
"array",
",",
"SimpleXMLElement",
"$",
"xmlElement",
",",
"$",
"ignoreEmptyElements",
"=",
"true",
")",
"{",
"// Keep an array of children that are added to $xmlElement",
"$",
"children",
"=",
"[",
"]",
";... | Convert an array into XML and adds the whole structure as a child of the existing SimpleXMLElement given.
An array of inserted children is returned so you can add further children to them if necessary.
@param array $array
@param SimpleXMLElement $xmlElement
@param bool $ignoreEmptyElements
@return SimpleXMLElement[]|a... | [
"Convert",
"an",
"array",
"into",
"XML",
"and",
"adds",
"the",
"whole",
"structure",
"as",
"a",
"child",
"of",
"the",
"existing",
"SimpleXMLElement",
"given",
".",
"An",
"array",
"of",
"inserted",
"children",
"is",
"returned",
"so",
"you",
"can",
"add",
"f... | 0527e312518bc41e44018c29ea394bc4c6a2e7d7 | https://github.com/graze/xml-utils/blob/0527e312518bc41e44018c29ea394bc4c6a2e7d7/src/XmlConverter.php#L30-L95 |
3,995 | Silvestra/Silvestra | src/Silvestra/Component/Media/Extension/Image/GdImageCropper.php | GdImageCropper.getBox | private function getBox(array $coordinates)
{
$height = abs($coordinates['y1'] - $coordinates['y2']);
$width = abs($coordinates['x1'] - $coordinates['x2']);
return new Box($width, $height);
} | php | private function getBox(array $coordinates)
{
$height = abs($coordinates['y1'] - $coordinates['y2']);
$width = abs($coordinates['x1'] - $coordinates['x2']);
return new Box($width, $height);
} | [
"private",
"function",
"getBox",
"(",
"array",
"$",
"coordinates",
")",
"{",
"$",
"height",
"=",
"abs",
"(",
"$",
"coordinates",
"[",
"'y1'",
"]",
"-",
"$",
"coordinates",
"[",
"'y2'",
"]",
")",
";",
"$",
"width",
"=",
"abs",
"(",
"$",
"coordinates",... | Get box.
@param array $coordinates
@return Box | [
"Get",
"box",
"."
] | b7367601b01495ae3c492b42042f804dee13ab06 | https://github.com/Silvestra/Silvestra/blob/b7367601b01495ae3c492b42042f804dee13ab06/src/Silvestra/Component/Media/Extension/Image/GdImageCropper.php#L90-L96 |
3,996 | ekyna/UserBundle | Controller/AddressController.php | AddressController.listAction | public function listAction()
{
$user = $this->getUser();
$repository = $this->get('ekyna_user.address.repository');
$addresses = $repository->findByUser($user);
return $this->render('EkynaUserBundle:Address:list.html.twig', [
'addresses' => $addresses
]);
} | php | public function listAction()
{
$user = $this->getUser();
$repository = $this->get('ekyna_user.address.repository');
$addresses = $repository->findByUser($user);
return $this->render('EkynaUserBundle:Address:list.html.twig', [
'addresses' => $addresses
]);
} | [
"public",
"function",
"listAction",
"(",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getUser",
"(",
")",
";",
"$",
"repository",
"=",
"$",
"this",
"->",
"get",
"(",
"'ekyna_user.address.repository'",
")",
";",
"$",
"addresses",
"=",
"$",
"repository"... | List address action.
@return \Symfony\Component\HttpFoundation\Response | [
"List",
"address",
"action",
"."
] | e38d56aee978148a312a923b9e70bdaad1a381bf | https://github.com/ekyna/UserBundle/blob/e38d56aee978148a312a923b9e70bdaad1a381bf/Controller/AddressController.php#L22-L32 |
3,997 | ekyna/UserBundle | Controller/AddressController.php | AddressController.newAction | public function newAction(Request $request)
{
$user = $this->getUser();
$repository = $this->get('ekyna_user.address.repository');
$address = $repository->createNew();
$address->setUser($user);
$cancelPath = $this->generateUrl('ekyna_user_address_list');
/** @var \... | php | public function newAction(Request $request)
{
$user = $this->getUser();
$repository = $this->get('ekyna_user.address.repository');
$address = $repository->createNew();
$address->setUser($user);
$cancelPath = $this->generateUrl('ekyna_user_address_list');
/** @var \... | [
"public",
"function",
"newAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getUser",
"(",
")",
";",
"$",
"repository",
"=",
"$",
"this",
"->",
"get",
"(",
"'ekyna_user.address.repository'",
")",
";",
"$",
"address"... | New address action.
@param Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"New",
"address",
"action",
"."
] | e38d56aee978148a312a923b9e70bdaad1a381bf | https://github.com/ekyna/UserBundle/blob/e38d56aee978148a312a923b9e70bdaad1a381bf/Controller/AddressController.php#L41-L99 |
3,998 | ekyna/UserBundle | Controller/AddressController.php | AddressController.editAction | public function editAction(Request $request)
{
$user = $this->getUser();
$repository = $this->get('ekyna_user.address.repository');
if (null === $address = $repository->find($request->attributes->get('addressId'))) {
throw new NotFoundHttpException('Address not found.');
... | php | public function editAction(Request $request)
{
$user = $this->getUser();
$repository = $this->get('ekyna_user.address.repository');
if (null === $address = $repository->find($request->attributes->get('addressId'))) {
throw new NotFoundHttpException('Address not found.');
... | [
"public",
"function",
"editAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getUser",
"(",
")",
";",
"$",
"repository",
"=",
"$",
"this",
"->",
"get",
"(",
"'ekyna_user.address.repository'",
")",
";",
"if",
"(",
... | Edit address action.
@param Request $request
@return \Symfony\Component\HttpFoundation\Response
@throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
@throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException | [
"Edit",
"address",
"action",
"."
] | e38d56aee978148a312a923b9e70bdaad1a381bf | https://github.com/ekyna/UserBundle/blob/e38d56aee978148a312a923b9e70bdaad1a381bf/Controller/AddressController.php#L111-L174 |
3,999 | hametuha/hametwoo | src/Hametuha/HametWoo/Pattern/Validator.php | Validator.validate | public static function validate() {
$instance = static::get_instance();
$error = new \WP_Error();
foreach ( get_class_methods( $instance ) as $method ) {
$repl = new \ReflectionMethod( get_called_class(), $method );
// Check if method is public.
if ( ! $repl->isPublic() ) {
continue;
}
// Check... | php | public static function validate() {
$instance = static::get_instance();
$error = new \WP_Error();
foreach ( get_class_methods( $instance ) as $method ) {
$repl = new \ReflectionMethod( get_called_class(), $method );
// Check if method is public.
if ( ! $repl->isPublic() ) {
continue;
}
// Check... | [
"public",
"static",
"function",
"validate",
"(",
")",
"{",
"$",
"instance",
"=",
"static",
"::",
"get_instance",
"(",
")",
";",
"$",
"error",
"=",
"new",
"\\",
"WP_Error",
"(",
")",
";",
"foreach",
"(",
"get_class_methods",
"(",
"$",
"instance",
")",
"... | Validate all method
@return bool|\WP_Error | [
"Validate",
"all",
"method"
] | bcd5948ea53d6ca2181873a9f9d0d221c346592e | https://github.com/hametuha/hametwoo/blob/bcd5948ea53d6ca2181873a9f9d0d221c346592e/src/Hametuha/HametWoo/Pattern/Validator.php#L33-L52 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.