repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
4devs/ElfinderPhpConnector | Driver/PhotatoesDriver.php | PhotatoesDriver.getGallery | private function getGallery(Response $response, $target = '')
{
if ($target && $gallery = $this->manager->getGallery(basename($target))) {
$response->setCwd($this->prepareGallery($gallery));
$images = $gallery->getImages(true);
foreach ($images as $img) {
... | php | private function getGallery(Response $response, $target = '')
{
if ($target && $gallery = $this->manager->getGallery(basename($target))) {
$response->setCwd($this->prepareGallery($gallery));
$images = $gallery->getImages(true);
foreach ($images as $img) {
... | [
"private",
"function",
"getGallery",
"(",
"Response",
"$",
"response",
",",
"$",
"target",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"target",
"&&",
"$",
"gallery",
"=",
"$",
"this",
"->",
"manager",
"->",
"getGallery",
"(",
"basename",
"(",
"$",
"target",
... | get Gallery.
@param Response $response
@param string $target | [
"get",
"Gallery",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Driver/PhotatoesDriver.php#L177-L190 |
4devs/ElfinderPhpConnector | Driver/PhotatoesDriver.php | PhotatoesDriver.prepareGallery | private function prepareGallery(Gallery $gallery)
{
$time = $gallery->getUpdatedAt() ? $gallery->getUpdatedAt()->getTimestamp() : time();
$file = new FileInfo($gallery->getName(), $this->driverId, $time, $this->driverOptions['rootName']);
$file->setHash(
$this->getDriverId().'_'.... | php | private function prepareGallery(Gallery $gallery)
{
$time = $gallery->getUpdatedAt() ? $gallery->getUpdatedAt()->getTimestamp() : time();
$file = new FileInfo($gallery->getName(), $this->driverId, $time, $this->driverOptions['rootName']);
$file->setHash(
$this->getDriverId().'_'.... | [
"private",
"function",
"prepareGallery",
"(",
"Gallery",
"$",
"gallery",
")",
"{",
"$",
"time",
"=",
"$",
"gallery",
"->",
"getUpdatedAt",
"(",
")",
"?",
"$",
"gallery",
"->",
"getUpdatedAt",
"(",
")",
"->",
"getTimestamp",
"(",
")",
":",
"time",
"(",
... | prepare Gallery.
@param Gallery $gallery
@return FileInfo | [
"prepare",
"Gallery",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Driver/PhotatoesDriver.php#L199-L210 |
4devs/ElfinderPhpConnector | Driver/PhotatoesDriver.php | PhotatoesDriver.addImages | private function addImages(Response $response, Image $image, $galleryId)
{
foreach ($this->driverOptions['imagesSize'] as $imageSize) {
$this->addImage($response, $image, $galleryId, $imageSize);
}
return $this;
} | php | private function addImages(Response $response, Image $image, $galleryId)
{
foreach ($this->driverOptions['imagesSize'] as $imageSize) {
$this->addImage($response, $image, $galleryId, $imageSize);
}
return $this;
} | [
"private",
"function",
"addImages",
"(",
"Response",
"$",
"response",
",",
"Image",
"$",
"image",
",",
"$",
"galleryId",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"driverOptions",
"[",
"'imagesSize'",
"]",
"as",
"$",
"imageSize",
")",
"{",
"$",
"this"... | @param Response $response
@param Image $image
@param string $galleryId
@return $this | [
"@param",
"Response",
"$response",
"@param",
"Image",
"$image",
"@param",
"string",
"$galleryId"
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Driver/PhotatoesDriver.php#L219-L226 |
4devs/ElfinderPhpConnector | Driver/PhotatoesDriver.php | PhotatoesDriver.addImage | private function addImage(Response $response, Image $image, $galleryId, $imageSize)
{
if ($image->get($imageSize)) {
$href = $image->get($imageSize)->getHref();
$file = new FileInfo(
$image->getTitle().'('.$imageSize.')',
$this->getDriverId(),
... | php | private function addImage(Response $response, Image $image, $galleryId, $imageSize)
{
if ($image->get($imageSize)) {
$href = $image->get($imageSize)->getHref();
$file = new FileInfo(
$image->getTitle().'('.$imageSize.')',
$this->getDriverId(),
... | [
"private",
"function",
"addImage",
"(",
"Response",
"$",
"response",
",",
"Image",
"$",
"image",
",",
"$",
"galleryId",
",",
"$",
"imageSize",
")",
"{",
"if",
"(",
"$",
"image",
"->",
"get",
"(",
"$",
"imageSize",
")",
")",
"{",
"$",
"href",
"=",
"... | add Image.
@param Response $response
@param Image $image
@param string $galleryId
@param string $imageSize | [
"add",
"Image",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Driver/PhotatoesDriver.php#L236-L252 |
activecollab/templateengine | src/TemplateEngine.php | TemplateEngine.fetch | public function fetch($template, array $data = [])
{
try {
ob_start();
$this->display($template, $data);
return ob_get_clean();
} catch (Exception $e) {
ob_end_clean();
throw $e;
}
} | php | public function fetch($template, array $data = [])
{
try {
ob_start();
$this->display($template, $data);
return ob_get_clean();
} catch (Exception $e) {
ob_end_clean();
throw $e;
}
} | [
"public",
"function",
"fetch",
"(",
"$",
"template",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"ob_start",
"(",
")",
";",
"$",
"this",
"->",
"display",
"(",
"$",
"template",
",",
"$",
"data",
")",
";",
"return",
"ob_get_clean"... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/templateengine/blob/eff2de29428b9d649c6f6d8ba5eb52b46c6f27e8/src/TemplateEngine.php#L40-L52 |
activecollab/templateengine | src/TemplateEngine.php | TemplateEngine.& | public function &setTemplatesPath($templates_path)
{
$templates_path = rtrim($templates_path, '/');
if (!is_dir($templates_path)) {
throw new InvalidArgumentException("Templates path '$templates_path' does not exist");
}
$this->templates_path = rtrim($templates_path, '/... | php | public function &setTemplatesPath($templates_path)
{
$templates_path = rtrim($templates_path, '/');
if (!is_dir($templates_path)) {
throw new InvalidArgumentException("Templates path '$templates_path' does not exist");
}
$this->templates_path = rtrim($templates_path, '/... | [
"public",
"function",
"&",
"setTemplatesPath",
"(",
"$",
"templates_path",
")",
"{",
"$",
"templates_path",
"=",
"rtrim",
"(",
"$",
"templates_path",
",",
"'/'",
")",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"templates_path",
")",
")",
"{",
"throw",
"new... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/templateengine/blob/eff2de29428b9d649c6f6d8ba5eb52b46c6f27e8/src/TemplateEngine.php#L105-L116 |
activecollab/templateengine | src/TemplateEngine.php | TemplateEngine.getTemplatePath | public function getTemplatePath($template)
{
$template_path = $this->templates_path . '/' . ltrim($template, '/');
if (strpos($template_path, './')) {
$template_path = realpath($template_path);
if (empty($template_path) || $this->templates_path != mb_substr($template_path, ... | php | public function getTemplatePath($template)
{
$template_path = $this->templates_path . '/' . ltrim($template, '/');
if (strpos($template_path, './')) {
$template_path = realpath($template_path);
if (empty($template_path) || $this->templates_path != mb_substr($template_path, ... | [
"public",
"function",
"getTemplatePath",
"(",
"$",
"template",
")",
"{",
"$",
"template_path",
"=",
"$",
"this",
"->",
"templates_path",
".",
"'/'",
".",
"ltrim",
"(",
"$",
"template",
",",
"'/'",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"template_path",... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/templateengine/blob/eff2de29428b9d649c6f6d8ba5eb52b46c6f27e8/src/TemplateEngine.php#L121-L138 |
qcubed/orm | src/Query/QQ.php | QQ.getVirtualAlias | static public function getVirtualAlias($strName)
{
$strName = trim($strName);
$strName = str_replace(" ", "_", $strName);
$strName = strtolower($strName);
return $strName;
} | php | static public function getVirtualAlias($strName)
{
$strName = trim($strName);
$strName = str_replace(" ", "_", $strName);
$strName = strtolower($strName);
return $strName;
} | [
"static",
"public",
"function",
"getVirtualAlias",
"(",
"$",
"strName",
")",
"{",
"$",
"strName",
"=",
"trim",
"(",
"$",
"strName",
")",
";",
"$",
"strName",
"=",
"str_replace",
"(",
"\" \"",
",",
"\"_\"",
",",
"$",
"strName",
")",
";",
"$",
"strName",... | Converts a virtual attribute name to an alias used in the query. The name is converted to an identifier
that will work on any SQL database. In the query itself, the name
will have two underscores in front of the alias name to prevent conflicts with column names.
@param $strName
@return mixed|string | [
"Converts",
"a",
"virtual",
"attribute",
"name",
"to",
"an",
"alias",
"used",
"in",
"the",
"query",
".",
"The",
"name",
"is",
"converted",
"to",
"an",
"identifier",
"that",
"will",
"work",
"on",
"any",
"SQL",
"database",
".",
"In",
"the",
"query",
"itsel... | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/QQ.php#L261-L267 |
qcubed/orm | src/Query/QQ.php | QQ.clause | static public function clause(/* parameterized list of Clause\Base objects */)
{
$objClauseArray = array();
foreach (func_get_args() as $objClause) {
if ($objClause) {
if (!($objClause instanceof Clause\ClauseInterface)) {
throw new Caller('Non-Clause... | php | static public function clause(/* parameterized list of Clause\Base objects */)
{
$objClauseArray = array();
foreach (func_get_args() as $objClause) {
if ($objClause) {
if (!($objClause instanceof Clause\ClauseInterface)) {
throw new Caller('Non-Clause... | [
"static",
"public",
"function",
"clause",
"(",
"/* parameterized list of Clause\\Base objects */",
")",
"{",
"$",
"objClauseArray",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"objClause",
")",
"{",
"if",
"(",
"$",
"objCl... | /////////////////////// | [
"///////////////////////"
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/QQ.php#L273-L288 |
qcubed/orm | src/Query/QQ.php | QQ.extractSelectClause | public static function extractSelectClause($objClauses)
{
if ($objClauses instanceof Clause\Select) {
return $objClauses;
}
if (is_array($objClauses)) {
$hasSelects = false;
$objSelect = QQ::select();
foreach ($objClauses as $objClause) {
... | php | public static function extractSelectClause($objClauses)
{
if ($objClauses instanceof Clause\Select) {
return $objClauses;
}
if (is_array($objClauses)) {
$hasSelects = false;
$objSelect = QQ::select();
foreach ($objClauses as $objClause) {
... | [
"public",
"static",
"function",
"extractSelectClause",
"(",
"$",
"objClauses",
")",
"{",
"if",
"(",
"$",
"objClauses",
"instanceof",
"Clause",
"\\",
"Select",
")",
"{",
"return",
"$",
"objClauses",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"objClauses",
"... | Searches for all the Clause\Select clauses and merges them into one clause and returns that clause.
Returns null if none found.
@param Clause\Base[]|Clause\Base|null $objClauses Clause\Base object or array of Clause\Base objects
@return Clause\Select Clause\Select clause containing all the nodes from all the Clause\Se... | [
"Searches",
"for",
"all",
"the",
"Clause",
"\\",
"Select",
"clauses",
"and",
"merges",
"them",
"into",
"one",
"clause",
"and",
"returns",
"that",
"clause",
".",
"Returns",
"null",
"if",
"none",
"found",
"."
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/QQ.php#L380-L401 |
qcubed/orm | src/Query/QQ.php | QQ.func | static public function func($strName, $param1/** ... */)
{
$args = func_get_args();
$strFunc = array_shift($args);
return new Node\FunctionNode($strFunc, $args);
} | php | static public function func($strName, $param1/** ... */)
{
$args = func_get_args();
$strFunc = array_shift($args);
return new Node\FunctionNode($strFunc, $args);
} | [
"static",
"public",
"function",
"func",
"(",
"$",
"strName",
",",
"$",
"param1",
"/** ... */",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"strFunc",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"return",
"new",
"Node",
"\\",
... | Apply an arbitrary scalar function using the given parameters. See below for functions that let you apply
common SQL functions. The list below only includes sql operations that are generic to all supported versions
of SQL. However, you can call Func directly with any named function that works in your current SQL versio... | [
"Apply",
"an",
"arbitrary",
"scalar",
"function",
"using",
"the",
"given",
"parameters",
".",
"See",
"below",
"for",
"functions",
"that",
"let",
"you",
"apply",
"common",
"SQL",
"functions",
".",
"The",
"list",
"below",
"only",
"includes",
"sql",
"operations",... | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/QQ.php#L438-L443 |
qcubed/orm | src/Query/QQ.php | QQ.mathOp | static public function mathOp($strOperation, $param1/** ... */)
{
$args = func_get_args();
$strFunc = array_shift($args);
return new Node\Math($strFunc, $args);
} | php | static public function mathOp($strOperation, $param1/** ... */)
{
$args = func_get_args();
$strFunc = array_shift($args);
return new Node\Math($strFunc, $args);
} | [
"static",
"public",
"function",
"mathOp",
"(",
"$",
"strOperation",
",",
"$",
"param1",
"/** ... */",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"strFunc",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"return",
"new",
"Node",
"... | Apply an arbitrary math operation to 2 or more operands. Operands can be scalar values, or column nodes.
@param string $strOperation The operation symbol, like + or *
@param Node\NodeBase|mixed $param1 The first parameter
@return Node\Math The resulting wrapper node | [
"Apply",
"an",
"arbitrary",
"math",
"operation",
"to",
"2",
"or",
"more",
"operands",
".",
"Operands",
"can",
"be",
"scalar",
"values",
"or",
"column",
"nodes",
"."
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Query/QQ.php#L524-L529 |
CPSB/Validation-helper | src/FormServiceProvider.php | FormServiceProvider.registerBladeDirectives | protected function registerBladeDirectives()
{
Blade::directive('form', function ($expression) {
$expression = $this->addParenthesis($expression);
return "<?php app('Activisme_BE')->model{$expression}; ?>";
});
Blade::directive('input', function ($expression) {
... | php | protected function registerBladeDirectives()
{
Blade::directive('form', function ($expression) {
$expression = $this->addParenthesis($expression);
return "<?php app('Activisme_BE')->model{$expression}; ?>";
});
Blade::directive('input', function ($expression) {
... | [
"protected",
"function",
"registerBladeDirectives",
"(",
")",
"{",
"Blade",
"::",
"directive",
"(",
"'form'",
",",
"function",
"(",
"$",
"expression",
")",
"{",
"$",
"expression",
"=",
"$",
"this",
"->",
"addParenthesis",
"(",
"$",
"expression",
")",
";",
... | Register blade directives.
@return void | [
"Register",
"blade",
"directives",
"."
] | train | https://github.com/CPSB/Validation-helper/blob/adb91cb42b7e3c1f88be059a8b4f86de5aba64cc/src/FormServiceProvider.php#L75-L111 |
yoanm/symfony-jsonrpc-http-server-doc | src/Finder/NormalizedDocFinder.php | NormalizedDocFinder.findFor | public function findFor(string $filename, $host) : array
{
foreach ($this->normalizedDocProviderList as $provider) {
if (true === $provider->supports($filename, $host)) {
return $provider->getDoc($host);
}
}
throw new \Exception(sprintf('No documentat... | php | public function findFor(string $filename, $host) : array
{
foreach ($this->normalizedDocProviderList as $provider) {
if (true === $provider->supports($filename, $host)) {
return $provider->getDoc($host);
}
}
throw new \Exception(sprintf('No documentat... | [
"public",
"function",
"findFor",
"(",
"string",
"$",
"filename",
",",
"$",
"host",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"this",
"->",
"normalizedDocProviderList",
"as",
"$",
"provider",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"provider",
"->",
... | @param string $filename
@param string|null $host
@return array
@throws \Exception In case no provider found | [
"@param",
"string",
"$filename",
"@param",
"string|null",
"$host"
] | train | https://github.com/yoanm/symfony-jsonrpc-http-server-doc/blob/7a59862f74fef29d0e2ad017188977419503ad94/src/Finder/NormalizedDocFinder.php#L30-L39 |
webforge-labs/psc-cms | lib/PHPWord/PHPWord/Style/Cell.php | PHPWord_Style_Cell.setStyleValue | public function setStyleValue($key, $value) {
if($key == '_borderSize') {
$this->setBorderSize($value);
} elseif($key == '_borderColor') {
$this->setBorderColor($value);
} else {
$this->$key = $value;
}
} | php | public function setStyleValue($key, $value) {
if($key == '_borderSize') {
$this->setBorderSize($value);
} elseif($key == '_borderColor') {
$this->setBorderColor($value);
} else {
$this->$key = $value;
}
} | [
"public",
"function",
"setStyleValue",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"key",
"==",
"'_borderSize'",
")",
"{",
"$",
"this",
"->",
"setBorderSize",
"(",
"$",
"value",
")",
";",
"}",
"elseif",
"(",
"$",
"key",
"==",
"'_b... | Set style value
@var string $key
@var mixed $value | [
"Set",
"style",
"value"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Style/Cell.php#L150-L158 |
sparwelt/imgix-lib | src/ImgixService.php | ImgixService.generateUrl | public function generateUrl($originalUrl, $filtersOrConfigurationKey = [], array $extraFilters = [])
{
$filters = $this->prepareFilterParams($filtersOrConfigurationKey, $extraFilters);
return $this->urlGenerator->generateUrl($originalUrl, $filters);
} | php | public function generateUrl($originalUrl, $filtersOrConfigurationKey = [], array $extraFilters = [])
{
$filters = $this->prepareFilterParams($filtersOrConfigurationKey, $extraFilters);
return $this->urlGenerator->generateUrl($originalUrl, $filters);
} | [
"public",
"function",
"generateUrl",
"(",
"$",
"originalUrl",
",",
"$",
"filtersOrConfigurationKey",
"=",
"[",
"]",
",",
"array",
"$",
"extraFilters",
"=",
"[",
"]",
")",
"{",
"$",
"filters",
"=",
"$",
"this",
"->",
"prepareFilterParams",
"(",
"$",
"filter... | @param string $originalUrl
@param array|string $filtersOrConfigurationKey
@param array $extraFilters
@return string
@throws \Sparwelt\ImgixLib\Exception\ResolutionException | [
"@param",
"string",
"$originalUrl",
"@param",
"array|string",
"$filtersOrConfigurationKey",
"@param",
"array",
"$extraFilters"
] | train | https://github.com/sparwelt/imgix-lib/blob/330e1db2bed71bc283e5a2da6246528f240939ec/src/ImgixService.php#L62-L67 |
sparwelt/imgix-lib | src/ImgixService.php | ImgixService.generateAttributeValue | public function generateAttributeValue($originalUrl, $filtersOrConfigurationKey = [], array $extraFilters = [])
{
$filters = $this->prepareFilterParams($filtersOrConfigurationKey, $extraFilters);
return $this->attributeGenerator->generateAttributeValue($originalUrl, $filters);
} | php | public function generateAttributeValue($originalUrl, $filtersOrConfigurationKey = [], array $extraFilters = [])
{
$filters = $this->prepareFilterParams($filtersOrConfigurationKey, $extraFilters);
return $this->attributeGenerator->generateAttributeValue($originalUrl, $filters);
} | [
"public",
"function",
"generateAttributeValue",
"(",
"$",
"originalUrl",
",",
"$",
"filtersOrConfigurationKey",
"=",
"[",
"]",
",",
"array",
"$",
"extraFilters",
"=",
"[",
"]",
")",
"{",
"$",
"filters",
"=",
"$",
"this",
"->",
"prepareFilterParams",
"(",
"$"... | @param string $originalUrl
@param array|string $filtersOrConfigurationKey
@param array $extraFilters
@return string
@throws \Sparwelt\ImgixLib\Exception\ResolutionException | [
"@param",
"string",
"$originalUrl",
"@param",
"array|string",
"$filtersOrConfigurationKey",
"@param",
"array",
"$extraFilters"
] | train | https://github.com/sparwelt/imgix-lib/blob/330e1db2bed71bc283e5a2da6246528f240939ec/src/ImgixService.php#L77-L82 |
sparwelt/imgix-lib | src/ImgixService.php | ImgixService.generateImage | public function generateImage($originalUrl, $attributesFiltersOrConfigurationKey = [], array $extraFilters = [])
{
$attributesFilters = $this->prepareFilterParams($attributesFiltersOrConfigurationKey, $extraFilters);
return $this->imageGenerator->generateImage($originalUrl, $attributesFilters);
... | php | public function generateImage($originalUrl, $attributesFiltersOrConfigurationKey = [], array $extraFilters = [])
{
$attributesFilters = $this->prepareFilterParams($attributesFiltersOrConfigurationKey, $extraFilters);
return $this->imageGenerator->generateImage($originalUrl, $attributesFilters);
... | [
"public",
"function",
"generateImage",
"(",
"$",
"originalUrl",
",",
"$",
"attributesFiltersOrConfigurationKey",
"=",
"[",
"]",
",",
"array",
"$",
"extraFilters",
"=",
"[",
"]",
")",
"{",
"$",
"attributesFilters",
"=",
"$",
"this",
"->",
"prepareFilterParams",
... | @param string $originalUrl
@param array $attributesFiltersOrConfigurationKey
@param array $extraFilters
@return string | [
"@param",
"string",
"$originalUrl",
"@param",
"array",
"$attributesFiltersOrConfigurationKey",
"@param",
"array",
"$extraFilters"
] | train | https://github.com/sparwelt/imgix-lib/blob/330e1db2bed71bc283e5a2da6246528f240939ec/src/ImgixService.php#L91-L96 |
sparwelt/imgix-lib | src/ImgixService.php | ImgixService.transformHtml | public function transformHtml($html, $attributesFiltersOrConfigurationKey = [], array $extraFilters = [])
{
$attributesFilters = $this->prepareFilterParams($attributesFiltersOrConfigurationKey, $extraFilters);
return $this->htmlTransformer->transformHtml($html, $attributesFilters);
} | php | public function transformHtml($html, $attributesFiltersOrConfigurationKey = [], array $extraFilters = [])
{
$attributesFilters = $this->prepareFilterParams($attributesFiltersOrConfigurationKey, $extraFilters);
return $this->htmlTransformer->transformHtml($html, $attributesFilters);
} | [
"public",
"function",
"transformHtml",
"(",
"$",
"html",
",",
"$",
"attributesFiltersOrConfigurationKey",
"=",
"[",
"]",
",",
"array",
"$",
"extraFilters",
"=",
"[",
"]",
")",
"{",
"$",
"attributesFilters",
"=",
"$",
"this",
"->",
"prepareFilterParams",
"(",
... | @param string $html
@param array $attributesFiltersOrConfigurationKey
@param array $extraFilters
@return string | [
"@param",
"string",
"$html",
"@param",
"array",
"$attributesFiltersOrConfigurationKey",
"@param",
"array",
"$extraFilters"
] | train | https://github.com/sparwelt/imgix-lib/blob/330e1db2bed71bc283e5a2da6246528f240939ec/src/ImgixService.php#L105-L110 |
sparwelt/imgix-lib | src/ImgixService.php | ImgixService.prepareFilterParams | private function prepareFilterParams($filtersOrConfigurationKey, array $extraFilters = [])
{
if (is_array($filtersOrConfigurationKey)) {
return array_merge($filtersOrConfigurationKey, $extraFilters);
}
if (false !== strpos($filtersOrConfigurationKey, '.')) {
list($co... | php | private function prepareFilterParams($filtersOrConfigurationKey, array $extraFilters = [])
{
if (is_array($filtersOrConfigurationKey)) {
return array_merge($filtersOrConfigurationKey, $extraFilters);
}
if (false !== strpos($filtersOrConfigurationKey, '.')) {
list($co... | [
"private",
"function",
"prepareFilterParams",
"(",
"$",
"filtersOrConfigurationKey",
",",
"array",
"$",
"extraFilters",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"filtersOrConfigurationKey",
")",
")",
"{",
"return",
"array_merge",
"(",
"$",
"fi... | @param array|string $filtersOrConfigurationKey
@param array $extraFilters
@return array | [
"@param",
"array|string",
"$filtersOrConfigurationKey",
"@param",
"array",
"$extraFilters"
] | train | https://github.com/sparwelt/imgix-lib/blob/330e1db2bed71bc283e5a2da6246528f240939ec/src/ImgixService.php#L118-L150 |
ruvents/ruwork-upload-bundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
// @formatter:off
return (new TreeBuilder())
->root('ruwork_upload')
->children()
->scalarNode('public_dir')
->cannotBeEmpty()
->defaultValue('%kernel.project_dir%... | php | public function getConfigTreeBuilder()
{
// @formatter:off
return (new TreeBuilder())
->root('ruwork_upload')
->children()
->scalarNode('public_dir')
->cannotBeEmpty()
->defaultValue('%kernel.project_dir%... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"// @formatter:off",
"return",
"(",
"new",
"TreeBuilder",
"(",
")",
")",
"->",
"root",
"(",
"'ruwork_upload'",
")",
"->",
"children",
"(",
")",
"->",
"scalarNode",
"(",
"'public_dir'",
")",
"->",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/DependencyInjection/Configuration.php#L15-L42 |
LeadPages/php_auth_package | src/Auth/LeadpagesLogin.php | LeadpagesLogin.getUser | public function getUser($username, $password)
{
$authHash = $this->hashUserNameAndPassword($username, $password);
$body = json_encode(['clientType' => 'wp-plugin']);
try {
$response = $this->client->post(
$this->loginurl, [
'headers' => ['Author... | php | public function getUser($username, $password)
{
$authHash = $this->hashUserNameAndPassword($username, $password);
$body = json_encode(['clientType' => 'wp-plugin']);
try {
$response = $this->client->post(
$this->loginurl, [
'headers' => ['Author... | [
"public",
"function",
"getUser",
"(",
"$",
"username",
",",
"$",
"password",
")",
"{",
"$",
"authHash",
"=",
"$",
"this",
"->",
"hashUserNameAndPassword",
"(",
"$",
"username",
",",
"$",
"password",
")",
";",
"$",
"body",
"=",
"json_encode",
"(",
"[",
... | get user information
@param string $username
@param string $password
@return array|\GuzzleHttp\Message\FutureResponse|\GuzzleHttp\Message\ResponseInterface|\GuzzleHttp\Ring\Future\FutureInterface|null | [
"get",
"user",
"information"
] | train | https://github.com/LeadPages/php_auth_package/blob/0294a053ce3d1a13a58fea85b0a14ffc98cf5893/src/Auth/LeadpagesLogin.php#L52-L81 |
LeadPages/php_auth_package | src/Auth/LeadpagesLogin.php | LeadpagesLogin.createApiKey | public function createApiKey()
{
if (!isset($this->token)) {
return false;
}
$authHeader = 'LP-Security-Token';
if (stripos($this->token, 'lp ') === 0) {
$authHeader = 'Authorization';
}
try {
$response = $this->client->post($this->k... | php | public function createApiKey()
{
if (!isset($this->token)) {
return false;
}
$authHeader = 'LP-Security-Token';
if (stripos($this->token, 'lp ') === 0) {
$authHeader = 'Authorization';
}
try {
$response = $this->client->post($this->k... | [
"public",
"function",
"createApiKey",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"token",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"authHeader",
"=",
"'LP-Security-Token'",
";",
"if",
"(",
"stripos",
"(",
"$",
"this",
"->... | Create an API key for account
@return string|boolean JSON encode key or false | [
"Create",
"an",
"API",
"key",
"for",
"account"
] | train | https://github.com/LeadPages/php_auth_package/blob/0294a053ce3d1a13a58fea85b0a14ffc98cf5893/src/Auth/LeadpagesLogin.php#L88-L125 |
LeadPages/php_auth_package | src/Auth/LeadpagesLogin.php | LeadpagesLogin.parseResponse | public function parseResponse($deleteTokenOnFail = false)
{
$responseArray = json_decode($this->response, true);
if (isset($responseArray['error']) && $responseArray['error']) {
// token should be unset assumed to be no longer valid
unset($this->token);
// delete ... | php | public function parseResponse($deleteTokenOnFail = false)
{
$responseArray = json_decode($this->response, true);
if (isset($responseArray['error']) && $responseArray['error']) {
// token should be unset assumed to be no longer valid
unset($this->token);
// delete ... | [
"public",
"function",
"parseResponse",
"(",
"$",
"deleteTokenOnFail",
"=",
"false",
")",
"{",
"$",
"responseArray",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"response",
",",
"true",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"responseArray",
"[",
"'error'"... | Parse response for call to Leadpages Login. If response does
not contain a error we will return a response with
HttpResponseCode and Message
@param bool $deleteTokenOnFail
@return string json encoded response for client to handle | [
"Parse",
"response",
"for",
"call",
"to",
"Leadpages",
"Login",
".",
"If",
"response",
"does",
"not",
"contain",
"a",
"error",
"we",
"will",
"return",
"a",
"response",
"with",
"HttpResponseCode",
"and",
"Message"
] | train | https://github.com/LeadPages/php_auth_package/blob/0294a053ce3d1a13a58fea85b0a14ffc98cf5893/src/Auth/LeadpagesLogin.php#L135-L149 |
tigris-php/telegram-bot-api | src/Types/Updates/Update.php | Update.detectType | protected static function detectType(array $data)
{
foreach ([
self::TYPE_MESSAGE,
self::TYPE_EDITED_MESSAGE,
self::TYPE_CHANNEL_POST,
self::TYPE_EDITED_CHANNEL_POST,
self::TYPE_INLINE_QUERY,
self::TYPE_CHOSEN_INLINE_RESULT,
... | php | protected static function detectType(array $data)
{
foreach ([
self::TYPE_MESSAGE,
self::TYPE_EDITED_MESSAGE,
self::TYPE_CHANNEL_POST,
self::TYPE_EDITED_CHANNEL_POST,
self::TYPE_INLINE_QUERY,
self::TYPE_CHOSEN_INLINE_RESULT,
... | [
"protected",
"static",
"function",
"detectType",
"(",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"[",
"self",
"::",
"TYPE_MESSAGE",
",",
"self",
"::",
"TYPE_EDITED_MESSAGE",
",",
"self",
"::",
"TYPE_CHANNEL_POST",
",",
"self",
"::",
"TYPE_EDITED_CHANNEL_POS... | Detects update type
@param $data
@return string | [
"Detects",
"update",
"type"
] | train | https://github.com/tigris-php/telegram-bot-api/blob/7350c81d571387005d58079d8c654ee44504cdcf/src/Types/Updates/Update.php#L66-L82 |
ClanCats/Core | src/classes/CCRequest.php | CCRequest.perform | public function perform()
{
// set the input
if ( !is_null( $this->input ) )
{
CCIn::instance( $this->input );
} else {
CCIn::instance( CCServer::instance() );
}
// set current request
static::$_current =& $this;
// route is invalid show 404
if ( !$this->route instanceof CCRoute )
{... | php | public function perform()
{
// set the input
if ( !is_null( $this->input ) )
{
CCIn::instance( $this->input );
} else {
CCIn::instance( CCServer::instance() );
}
// set current request
static::$_current =& $this;
// route is invalid show 404
if ( !$this->route instanceof CCRoute )
{... | [
"public",
"function",
"perform",
"(",
")",
"{",
"// set the input",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"input",
")",
")",
"{",
"CCIn",
"::",
"instance",
"(",
"$",
"this",
"->",
"input",
")",
";",
"}",
"else",
"{",
"CCIn",
"::",
"ins... | Execute the Request
@param array $action
@param array $params
@return self | [
"Execute",
"the",
"Request"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCRequest.php#L110-L199 |
VincentChalnot/SidusAdminBundle | Routing/AdminRouteLoader.php | AdminRouteLoader.load | public function load($resource, $type = null): RouteCollection
{
if (true === $this->loaded) {
throw new \RuntimeException('Do not add the "sidus_admin" loader twice');
}
$routes = new RouteCollection();
foreach ($this->adminRegistry->getAdmins() as $admin) {
... | php | public function load($resource, $type = null): RouteCollection
{
if (true === $this->loaded) {
throw new \RuntimeException('Do not add the "sidus_admin" loader twice');
}
$routes = new RouteCollection();
foreach ($this->adminRegistry->getAdmins() as $admin) {
... | [
"public",
"function",
"load",
"(",
"$",
"resource",
",",
"$",
"type",
"=",
"null",
")",
":",
"RouteCollection",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"loaded",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Do not add the \"sidus_ad... | @param mixed $resource
@param null $type
@throws \RuntimeException
@return RouteCollection | [
"@param",
"mixed",
"$resource",
"@param",
"null",
"$type"
] | train | https://github.com/VincentChalnot/SidusAdminBundle/blob/3366f3f1525435860cf275ed2f1f0b58cf6eea18/Routing/AdminRouteLoader.php#L46-L63 |
PortaText/php-sdk | src/PortaText/Command/Api/CreditCards.php | CreditCards.cardInfo | public function cardInfo($number, $expirationDate, $code)
{
$this->setArgument('card_number', $number);
$this->setArgument('card_expiration_date', $expirationDate);
return $this->setArgument('card_code', $code);
} | php | public function cardInfo($number, $expirationDate, $code)
{
$this->setArgument('card_number', $number);
$this->setArgument('card_expiration_date', $expirationDate);
return $this->setArgument('card_code', $code);
} | [
"public",
"function",
"cardInfo",
"(",
"$",
"number",
",",
"$",
"expirationDate",
",",
"$",
"code",
")",
"{",
"$",
"this",
"->",
"setArgument",
"(",
"'card_number'",
",",
"$",
"number",
")",
";",
"$",
"this",
"->",
"setArgument",
"(",
"'card_expiration_dat... | Set card information.
@param string $number The card number.
@param string $expirationDate In format: YYYY-MM.
@param string $code The card security code.
@return PortaText\Command\ICommand | [
"Set",
"card",
"information",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/CreditCards.php#L55-L60 |
PortaText/php-sdk | src/PortaText/Command/Api/CreditCards.php | CreditCards.address | public function address($streetAddress, $city, $state, $zip, $country)
{
$this->setArgument('address', $streetAddress);
$this->setArgument('city', $city);
$this->setArgument('state', $state);
$this->setArgument('zip', $zip);
return $this->setArgument('country', $country);
... | php | public function address($streetAddress, $city, $state, $zip, $country)
{
$this->setArgument('address', $streetAddress);
$this->setArgument('city', $city);
$this->setArgument('state', $state);
$this->setArgument('zip', $zip);
return $this->setArgument('country', $country);
... | [
"public",
"function",
"address",
"(",
"$",
"streetAddress",
",",
"$",
"city",
",",
"$",
"state",
",",
"$",
"zip",
",",
"$",
"country",
")",
"{",
"$",
"this",
"->",
"setArgument",
"(",
"'address'",
",",
"$",
"streetAddress",
")",
";",
"$",
"this",
"->... | Set card billing address.
@param string $streetAddress The full street address.
@param string $city The city name.
@param string $state The state name.
@param string $zip The ZIP code.
@param string $country The country name.
@return PortaText\Command\ICommand | [
"Set",
"card",
"billing",
"address",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/CreditCards.php#L73-L80 |
PortaText/php-sdk | src/PortaText/Command/Api/CreditCards.php | CreditCards.getEndpoint | protected function getEndpoint($method)
{
$endpoint = "credit_cards";
$cardId = $this->getArgument("id");
if (!is_null($cardId)) {
$endpoint .= "/$cardId";
$this->delArgument("id");
}
return $endpoint;
} | php | protected function getEndpoint($method)
{
$endpoint = "credit_cards";
$cardId = $this->getArgument("id");
if (!is_null($cardId)) {
$endpoint .= "/$cardId";
$this->delArgument("id");
}
return $endpoint;
} | [
"protected",
"function",
"getEndpoint",
"(",
"$",
"method",
")",
"{",
"$",
"endpoint",
"=",
"\"credit_cards\"",
";",
"$",
"cardId",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"\"id\"",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"cardId",
")",
")",... | Returns a string with the endpoint for the given command.
@param string $method Method for this command.
@return string | [
"Returns",
"a",
"string",
"with",
"the",
"endpoint",
"for",
"the",
"given",
"command",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/CreditCards.php#L89-L98 |
dms-org/package.blog | src/Infrastructure/Persistence/BlogAuthorMapper.php | BlogAuthorMapper.define | protected function define(MapperDefinition $map)
{
$map->type(BlogAuthor::class);
$map->toTable('authors');
$map->idToPrimaryKey('id');
$map->property(BlogAuthor::NAME)->to('name')->asVarchar(255);
$map->property(BlogAuthor::ROLE)->to('role')->asVarchar(255);
$ma... | php | protected function define(MapperDefinition $map)
{
$map->type(BlogAuthor::class);
$map->toTable('authors');
$map->idToPrimaryKey('id');
$map->property(BlogAuthor::NAME)->to('name')->asVarchar(255);
$map->property(BlogAuthor::ROLE)->to('role')->asVarchar(255);
$ma... | [
"protected",
"function",
"define",
"(",
"MapperDefinition",
"$",
"map",
")",
"{",
"$",
"map",
"->",
"type",
"(",
"BlogAuthor",
"::",
"class",
")",
";",
"$",
"map",
"->",
"toTable",
"(",
"'authors'",
")",
";",
"$",
"map",
"->",
"idToPrimaryKey",
"(",
"'... | Defines the entity mapper
@param MapperDefinition $map
@return void | [
"Defines",
"the",
"entity",
"mapper"
] | train | https://github.com/dms-org/package.blog/blob/1500f6fad20d81289a0dfa617fc1c54699f01e16/src/Infrastructure/Persistence/BlogAuthorMapper.php#L24-L49 |
spiral-modules/auth | source/Auth/Operators/HttpOperator.php | HttpOperator.fetchToken | public function fetchToken(Request $request)
{
$header = $request->getHeaderLine('Authorization');
list($username, $password) = self::parseHeader($header);
if (empty($username) || empty($password)) {
return null;
}
//Direct authentication
try {
... | php | public function fetchToken(Request $request)
{
$header = $request->getHeaderLine('Authorization');
list($username, $password) = self::parseHeader($header);
if (empty($username) || empty($password)) {
return null;
}
//Direct authentication
try {
... | [
"public",
"function",
"fetchToken",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"header",
"=",
"$",
"request",
"->",
"getHeaderLine",
"(",
"'Authorization'",
")",
";",
"list",
"(",
"$",
"username",
",",
"$",
"password",
")",
"=",
"self",
"::",
"parseH... | {@inheritdoc} | [
"{"
] | train | https://github.com/spiral-modules/auth/blob/24e2070028f7257e8192914556963a4794428a99/source/Auth/Operators/HttpOperator.php#L59-L76 |
vi-kon/laravel-auth | src/ViKon/Auth/Helper/FormRequestRouteAuthorizer.php | FormRequestRouteAuthorizer.authorize | public function authorize(Router $router)
{
/** @noinspection PhpUndefinedFieldInspection */
return $this->container->make(RouterAuth::class)->hasAccess($router->current()->getName()) !== false;
} | php | public function authorize(Router $router)
{
/** @noinspection PhpUndefinedFieldInspection */
return $this->container->make(RouterAuth::class)->hasAccess($router->current()->getName()) !== false;
} | [
"public",
"function",
"authorize",
"(",
"Router",
"$",
"router",
")",
"{",
"/** @noinspection PhpUndefinedFieldInspection */",
"return",
"$",
"this",
"->",
"container",
"->",
"make",
"(",
"RouterAuth",
"::",
"class",
")",
"->",
"hasAccess",
"(",
"$",
"router",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/vi-kon/laravel-auth/blob/501c20128f43347a2ca271a53435297f9ef7f567/src/ViKon/Auth/Helper/FormRequestRouteAuthorizer.php#L20-L24 |
periaptio/empress-generator | src/Commands/GeneratorCommand.php | GeneratorCommand.handle | public function handle()
{
if ($this->argument('tables')) {
$tables = explode(',', $this->argument('tables'));
} elseif ($this->option('tables')) {
$tables = explode(',', $this->option('tables'));
} else {
$tables = DB::getDoctrineConnection()->getSchemaMa... | php | public function handle()
{
if ($this->argument('tables')) {
$tables = explode(',', $this->argument('tables'));
} elseif ($this->option('tables')) {
$tables = explode(',', $this->option('tables'));
} else {
$tables = DB::getDoctrineConnection()->getSchemaMa... | [
"public",
"function",
"handle",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"argument",
"(",
"'tables'",
")",
")",
"{",
"$",
"tables",
"=",
"explode",
"(",
"','",
",",
"$",
"this",
"->",
"argument",
"(",
"'tables'",
")",
")",
";",
"}",
"elseif",
... | Execute the command.
@return void | [
"Execute",
"the",
"command",
"."
] | train | https://github.com/periaptio/empress-generator/blob/749fb4b12755819e9c97377ebfb446ee0822168a/src/Commands/GeneratorCommand.php#L54-L67 |
periaptio/empress-generator | src/Commands/GeneratorCommand.php | GeneratorCommand.getConfigData | public function getConfigData()
{
$viewConfigPath = config('generator.path_view', base_path('resources/views/'));
$viewBasePath = base_path('resources/views/');
if ($viewBasePath === $viewConfigPath) {
$viewPath = '';
} else {
$trans = array('/' => '.', $view... | php | public function getConfigData()
{
$viewConfigPath = config('generator.path_view', base_path('resources/views/'));
$viewBasePath = base_path('resources/views/');
if ($viewBasePath === $viewConfigPath) {
$viewPath = '';
} else {
$trans = array('/' => '.', $view... | [
"public",
"function",
"getConfigData",
"(",
")",
"{",
"$",
"viewConfigPath",
"=",
"config",
"(",
"'generator.path_view'",
",",
"base_path",
"(",
"'resources/views/'",
")",
")",
";",
"$",
"viewBasePath",
"=",
"base_path",
"(",
"'resources/views/'",
")",
";",
"if"... | get config data from config/generator.php
@return array | [
"get",
"config",
"data",
"from",
"config",
"/",
"generator",
".",
"php"
] | train | https://github.com/periaptio/empress-generator/blob/749fb4b12755819e9c97377ebfb446ee0822168a/src/Commands/GeneratorCommand.php#L104-L145 |
danrevah/shortify-punit | src/Stub/WhenChainCase.php | WhenChainCase.createChainArrayOfReturnValues | private function createChainArrayOfReturnValues($action, $response)
{
// Pop first method
$methods = $this->methods;
$firstMethod = array_pop($methods);
$lastValue = $response;
$mockClassType = get_class($this->mockClass);
if ( ! $this->mockClass instanceof MockInt... | php | private function createChainArrayOfReturnValues($action, $response)
{
// Pop first method
$methods = $this->methods;
$firstMethod = array_pop($methods);
$lastValue = $response;
$mockClassType = get_class($this->mockClass);
if ( ! $this->mockClass instanceof MockInt... | [
"private",
"function",
"createChainArrayOfReturnValues",
"(",
"$",
"action",
",",
"$",
"response",
")",
"{",
"// Pop first method",
"$",
"methods",
"=",
"$",
"this",
"->",
"methods",
";",
"$",
"firstMethod",
"=",
"array_pop",
"(",
"$",
"methods",
")",
";",
"... | Creating a chain array of return values
@param $action
@param $response | [
"Creating",
"a",
"chain",
"array",
"of",
"return",
"values"
] | train | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/Stub/WhenChainCase.php#L59-L122 |
danrevah/shortify-punit | src/Stub/WhenChainCase.php | WhenChainCase.addChainedMethodResponse | private function addChainedMethodResponse($chainedMethodsBefore, $currentMethod, $action, $lastValue, $mockClassInstanceId)
{
$response = [];
$rResponse = &$response;
$currentMethodName = key($currentMethod);
foreach ($chainedMethodsBefore as $chainedMethod)
{
$... | php | private function addChainedMethodResponse($chainedMethodsBefore, $currentMethod, $action, $lastValue, $mockClassInstanceId)
{
$response = [];
$rResponse = &$response;
$currentMethodName = key($currentMethod);
foreach ($chainedMethodsBefore as $chainedMethod)
{
$... | [
"private",
"function",
"addChainedMethodResponse",
"(",
"$",
"chainedMethodsBefore",
",",
"$",
"currentMethod",
",",
"$",
"action",
",",
"$",
"lastValue",
",",
"$",
"mockClassInstanceId",
")",
"{",
"$",
"response",
"=",
"[",
"]",
";",
"$",
"rResponse",
"=",
... | Adding chained method responses into ShortifyPunit::ReturnValues
@param $chainedMethodsBefore
@param $currentMethod
@param $action
@param $lastValue
@param $mockClassInstanceId | [
"Adding",
"chained",
"method",
"responses",
"into",
"ShortifyPunit",
"::",
"ReturnValues"
] | train | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/Stub/WhenChainCase.php#L133-L153 |
danrevah/shortify-punit | src/Stub/WhenChainCase.php | WhenChainCase.extractChainedMethodsBefore | private function extractChainedMethodsBefore($methods, $currentMethod)
{
$chainedMethodsBefore = [];
$currentMethodName = key($currentMethod);
foreach ($methods as $method)
{
$methodName = key($method);
if ($methodName == $currentMethodName) {
... | php | private function extractChainedMethodsBefore($methods, $currentMethod)
{
$chainedMethodsBefore = [];
$currentMethodName = key($currentMethod);
foreach ($methods as $method)
{
$methodName = key($method);
if ($methodName == $currentMethodName) {
... | [
"private",
"function",
"extractChainedMethodsBefore",
"(",
"$",
"methods",
",",
"$",
"currentMethod",
")",
"{",
"$",
"chainedMethodsBefore",
"=",
"[",
"]",
";",
"$",
"currentMethodName",
"=",
"key",
"(",
"$",
"currentMethod",
")",
";",
"foreach",
"(",
"$",
"... | Extracting chained methods before current method into an array
@param $methods
@param $currentMethod
@return array | [
"Extracting",
"chained",
"methods",
"before",
"current",
"method",
"into",
"an",
"array"
] | train | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/Stub/WhenChainCase.php#L162-L179 |
redaigbaria/oauth2 | src/Grant/ClientCredentialsGrant.php | ClientCredentialsGrant.completeFlow | public function completeFlow()
{
// Get the required params
$clientId = $this->server->getRequest()->request->get('client_id', $this->server->getRequest()->getUser());
if (is_null($clientId)) {
throw new Exception\InvalidRequestException('client_id');
}
$clientSe... | php | public function completeFlow()
{
// Get the required params
$clientId = $this->server->getRequest()->request->get('client_id', $this->server->getRequest()->getUser());
if (is_null($clientId)) {
throw new Exception\InvalidRequestException('client_id');
}
$clientSe... | [
"public",
"function",
"completeFlow",
"(",
")",
"{",
"// Get the required params",
"$",
"clientId",
"=",
"$",
"this",
"->",
"server",
"->",
"getRequest",
"(",
")",
"->",
"request",
"->",
"get",
"(",
"'client_id'",
",",
"$",
"this",
"->",
"server",
"->",
"g... | Complete the client credentials grant
@return array
@throws | [
"Complete",
"the",
"client",
"credentials",
"grant"
] | train | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/Grant/ClientCredentialsGrant.php#L61-L121 |
teneleven/GeolocatorBundle | Form/DataTransformer/StringToGeocodedTransformer.php | StringToGeocodedTransformer.reverseTransform | public function reverseTransform($value)
{
if (!$value) {
return null;
}
try {
$result = $this->geocoder->geocode($value);
} catch (NoResult $e) {
throw new TransformationFailedException(sprintf('%s could not be geolocated', $value));
}
... | php | public function reverseTransform($value)
{
if (!$value) {
return null;
}
try {
$result = $this->geocoder->geocode($value);
} catch (NoResult $e) {
throw new TransformationFailedException(sprintf('%s could not be geolocated', $value));
}
... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"value",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"geocoder",
"->",
"geocode",
"(",
"$",
"value",
")",
";",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/teneleven/GeolocatorBundle/blob/4ead8e783a91577f2a67aa302b79641d4b9e99ad/Form/DataTransformer/StringToGeocodedTransformer.php#L52-L69 |
ClanCats/Core | src/classes/CCCrypter.php | CCCrypter.encode | public static function encode( $data, $salt = null ) {
if ( is_null( $salt ) ) {
$salt = static::$default_salt;
}
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($salt), $data, MCRYPT_MODE_CBC, md5(md5($salt))));
} | php | public static function encode( $data, $salt = null ) {
if ( is_null( $salt ) ) {
$salt = static::$default_salt;
}
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($salt), $data, MCRYPT_MODE_CBC, md5(md5($salt))));
} | [
"public",
"static",
"function",
"encode",
"(",
"$",
"data",
",",
"$",
"salt",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"salt",
")",
")",
"{",
"$",
"salt",
"=",
"static",
"::",
"$",
"default_salt",
";",
"}",
"return",
"base64_encode",
... | Encode data
@param string $data
@param string $salt
@return string | [
"Encode",
"data"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCCrypter.php#L35-L42 |
ClanCats/Core | src/classes/CCCrypter.php | CCCrypter.decode | public static function decode( $data, $salt = null ) {
if ( is_null( $salt ) ) {
$salt = static::$default_salt;
}
return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($salt), base64_decode($data), MCRYPT_MODE_CBC, md5(md5($salt))), "\0");
} | php | public static function decode( $data, $salt = null ) {
if ( is_null( $salt ) ) {
$salt = static::$default_salt;
}
return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($salt), base64_decode($data), MCRYPT_MODE_CBC, md5(md5($salt))), "\0");
} | [
"public",
"static",
"function",
"decode",
"(",
"$",
"data",
",",
"$",
"salt",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"salt",
")",
")",
"{",
"$",
"salt",
"=",
"static",
"::",
"$",
"default_salt",
";",
"}",
"return",
"rtrim",
"(",
"... | Decde data
@param string $data
@param string $salt | [
"Decde",
"data"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCCrypter.php#L50-L57 |
yuncms/framework | src/rest/controllers/UploaderController.php | UploaderController.actionImage | public function actionImage()
{
$model = new UploaderImageForm();
$model->load(Yii::$app->getRequest()->getBodyParams(), '');
if ($model->save() != false) {
Yii::$app->getResponse()->setStatusCode(201);
return $model;
} elseif (!$model->hasErrors()) {
... | php | public function actionImage()
{
$model = new UploaderImageForm();
$model->load(Yii::$app->getRequest()->getBodyParams(), '');
if ($model->save() != false) {
Yii::$app->getResponse()->setStatusCode(201);
return $model;
} elseif (!$model->hasErrors()) {
... | [
"public",
"function",
"actionImage",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"UploaderImageForm",
"(",
")",
";",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"getRequest",
"(",
")",
"->",
"getBodyParams",
"(",
")",
",",
"''",
")",... | 图片上传
@return UploaderImageForm
@throws ServerErrorHttpException
@throws \yii\base\InvalidConfigException
@throws \Exception | [
"图片上传"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/controllers/UploaderController.php#L32-L43 |
yuncms/framework | src/rest/controllers/UploaderController.php | UploaderController.actionAudio | public function actionAudio()
{
$model = new UploaderAudioForm();
$model->load(Yii::$app->getRequest()->getBodyParams(), '');
if ($model->save() != false) {
Yii::$app->getResponse()->setStatusCode(201);
return $model;
} elseif (!$model->hasErrors()) {
... | php | public function actionAudio()
{
$model = new UploaderAudioForm();
$model->load(Yii::$app->getRequest()->getBodyParams(), '');
if ($model->save() != false) {
Yii::$app->getResponse()->setStatusCode(201);
return $model;
} elseif (!$model->hasErrors()) {
... | [
"public",
"function",
"actionAudio",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"UploaderAudioForm",
"(",
")",
";",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"getRequest",
"(",
")",
"->",
"getBodyParams",
"(",
")",
",",
"''",
")",... | 语音上传
@return UploaderAudioForm
@throws ServerErrorHttpException
@throws \yii\base\InvalidConfigException
@throws \Exception | [
"语音上传"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/controllers/UploaderController.php#L52-L63 |
yuncms/framework | src/rest/controllers/UploaderController.php | UploaderController.actionFile | public function actionFile()
{
$model = new UploaderFileForm();
$model->load(Yii::$app->getRequest()->getBodyParams(), '');
if ($model->save() != false) {
Yii::$app->getResponse()->setStatusCode(201);
return $model;
} elseif (!$model->hasErrors()) {
... | php | public function actionFile()
{
$model = new UploaderFileForm();
$model->load(Yii::$app->getRequest()->getBodyParams(), '');
if ($model->save() != false) {
Yii::$app->getResponse()->setStatusCode(201);
return $model;
} elseif (!$model->hasErrors()) {
... | [
"public",
"function",
"actionFile",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"UploaderFileForm",
"(",
")",
";",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"getRequest",
"(",
")",
"->",
"getBodyParams",
"(",
")",
",",
"''",
")",
... | 文件上传
@return UploaderFileForm
@throws ServerErrorHttpException
@throws \yii\base\InvalidConfigException
@throws \Exception | [
"文件上传"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/controllers/UploaderController.php#L72-L83 |
joomlatools/joomlatools-platform-legacy | code/base/tree.php | JTree.addChild | public function addChild(&$node, $setCurrent = false)
{
JLog::add('JTree::addChild() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current->addChild($node);
if ($setCurrent)
{
$this->_current = &$node;
}
} | php | public function addChild(&$node, $setCurrent = false)
{
JLog::add('JTree::addChild() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current->addChild($node);
if ($setCurrent)
{
$this->_current = &$node;
}
} | [
"public",
"function",
"addChild",
"(",
"&",
"$",
"node",
",",
"$",
"setCurrent",
"=",
"false",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JTree::addChild() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"$",
"this",
"->",
"_curre... | Method to add a child
@param array &$node The node to process
@param boolean $setCurrent True to set as current working node
@return mixed
@since 11.1 | [
"Method",
"to",
"add",
"a",
"child"
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/base/tree.php#L60-L70 |
joomlatools/joomlatools-platform-legacy | code/base/tree.php | JTree.getParent | public function getParent()
{
JLog::add('JTree::getParent() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current = &$this->_current->getParent();
} | php | public function getParent()
{
JLog::add('JTree::getParent() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current = &$this->_current->getParent();
} | [
"public",
"function",
"getParent",
"(",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JTree::getParent() is deprecated.'",
",",
"JLog",
"::",
"WARNING",
",",
"'deprecated'",
")",
";",
"$",
"this",
"->",
"_current",
"=",
"&",
"$",
"this",
"->",
"_current",
"->",
"g... | Method to get the parent
@return void
@since 11.1 | [
"Method",
"to",
"get",
"the",
"parent"
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/base/tree.php#L79-L84 |
CakeCMS/Core | src/Helper/Manager.php | Manager.addNamespace | public function addNamespace($name)
{
if (!Arr::in($name, self::$_namespace)) {
self::$_namespace[] = $name;
return true;
}
return false;
} | php | public function addNamespace($name)
{
if (!Arr::in($name, self::$_namespace)) {
self::$_namespace[] = $name;
return true;
}
return false;
} | [
"public",
"function",
"addNamespace",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"Arr",
"::",
"in",
"(",
"$",
"name",
",",
"self",
"::",
"$",
"_namespace",
")",
")",
"{",
"self",
"::",
"$",
"_namespace",
"[",
"]",
"=",
"$",
"name",
";",
"return"... | Add new helper group namespace.
@param string $name
@return bool | [
"Add",
"new",
"helper",
"group",
"namespace",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Helper/Manager.php#L71-L79 |
CakeCMS/Core | src/Helper/Manager.php | Manager.offsetGet | public function offsetGet($id)
{
$id = Str::low($id);
if (!Arr::key($id, self::$_loaded)) {
$className = $this->_getClassName($id);
$this->_register($id, $className);
}
return parent::offsetGet($id);
} | php | public function offsetGet($id)
{
$id = Str::low($id);
if (!Arr::key($id, self::$_loaded)) {
$className = $this->_getClassName($id);
$this->_register($id, $className);
}
return parent::offsetGet($id);
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"Str",
"::",
"low",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"Arr",
"::",
"key",
"(",
"$",
"id",
",",
"self",
"::",
"$",
"_loaded",
")",
")",
"{",
"$",
"className",... | Gets a parameter or an object.
@param string $id
@return mixed | [
"Gets",
"a",
"parameter",
"or",
"an",
"object",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Helper/Manager.php#L87-L96 |
CakeCMS/Core | src/Helper/Manager.php | Manager._register | protected function _register($id, $className)
{
$id = (string) $id;
if (class_exists($className)) {
self::$_loaded[$id] = $className;
$this[$id] = function () use ($className) {
return new $className();
};
} else {
throw new Exc... | php | protected function _register($id, $className)
{
$id = (string) $id;
if (class_exists($className)) {
self::$_loaded[$id] = $className;
$this[$id] = function () use ($className) {
return new $className();
};
} else {
throw new Exc... | [
"protected",
"function",
"_register",
"(",
"$",
"id",
",",
"$",
"className",
")",
"{",
"$",
"id",
"=",
"(",
"string",
")",
"$",
"id",
";",
"if",
"(",
"class_exists",
"(",
"$",
"className",
")",
")",
"{",
"self",
"::",
"$",
"_loaded",
"[",
"$",
"i... | Register helper class.
@param string $id
@param $className | [
"Register",
"helper",
"class",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Helper/Manager.php#L104-L115 |
CakeCMS/Core | src/Helper/Manager.php | Manager._getClassName | protected function _getClassName($class)
{
$class = Str::low($class);
list ($plugin, $className) = pluginSplit($class);
$return = self::HELPER_SUFFIX . '\\' . Inflector::camelize($className) . self::HELPER_SUFFIX;
if ($plugin !== null) {
return Inflector::camelize($plugin... | php | protected function _getClassName($class)
{
$class = Str::low($class);
list ($plugin, $className) = pluginSplit($class);
$return = self::HELPER_SUFFIX . '\\' . Inflector::camelize($className) . self::HELPER_SUFFIX;
if ($plugin !== null) {
return Inflector::camelize($plugin... | [
"protected",
"function",
"_getClassName",
"(",
"$",
"class",
")",
"{",
"$",
"class",
"=",
"Str",
"::",
"low",
"(",
"$",
"class",
")",
";",
"list",
"(",
"$",
"plugin",
",",
"$",
"className",
")",
"=",
"pluginSplit",
"(",
"$",
"class",
")",
";",
"$",... | Get current helper class name.
@param string $class
@return string | [
"Get",
"current",
"helper",
"class",
"name",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Helper/Manager.php#L123-L133 |
afrittella/back-project | src/app/Traits/Sluggable.php | Sluggable.createSlug | public function createSlug($value, $id = 0)
{
$slug = str_slug($value);
$relatedSlugs = $this->getRelatedSlugs($slug, $id);
if (!$relatedSlugs->contains('slug', $slug)) {
return $slug;
}
$completed = false;
$i = 1;
while ($completed == false) {... | php | public function createSlug($value, $id = 0)
{
$slug = str_slug($value);
$relatedSlugs = $this->getRelatedSlugs($slug, $id);
if (!$relatedSlugs->contains('slug', $slug)) {
return $slug;
}
$completed = false;
$i = 1;
while ($completed == false) {... | [
"public",
"function",
"createSlug",
"(",
"$",
"value",
",",
"$",
"id",
"=",
"0",
")",
"{",
"$",
"slug",
"=",
"str_slug",
"(",
"$",
"value",
")",
";",
"$",
"relatedSlugs",
"=",
"$",
"this",
"->",
"getRelatedSlugs",
"(",
"$",
"slug",
",",
"$",
"id",
... | Create a unique slug
@param $value
@param $id
@return string | [
"Create",
"a",
"unique",
"slug"
] | train | https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/app/Traits/Sluggable.php#L12-L34 |
afrittella/back-project | src/app/Traits/Sluggable.php | Sluggable.getRelatedSlugs | protected function getRelatedSlugs($slug, $id = 0)
{
return $this->select('slug')->where('slug', 'like', $slug.'%')->where('id', '<>', $id)->get();
} | php | protected function getRelatedSlugs($slug, $id = 0)
{
return $this->select('slug')->where('slug', 'like', $slug.'%')->where('id', '<>', $id)->get();
} | [
"protected",
"function",
"getRelatedSlugs",
"(",
"$",
"slug",
",",
"$",
"id",
"=",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"select",
"(",
"'slug'",
")",
"->",
"where",
"(",
"'slug'",
",",
"'like'",
",",
"$",
"slug",
".",
"'%'",
")",
"->",
"wher... | Get similar slugs
@param $slug
@param $id
@return mixed | [
"Get",
"similar",
"slugs"
] | train | https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/app/Traits/Sluggable.php#L42-L45 |
webforge-labs/psc-cms | lib/Psc/Doctrine/GenericCollectionSynchronizer.php | GenericCollectionSynchronizer.computeCUDSets | public function computeCUDSets(ArrayCollection $fromCollection, ArrayCollection $toCollection, $compareFunction = NULL, $uniqueHashFunction = NULL) {
if (!isset($compareFunction)) {
$compareFunction = ArrayCollection::COMPARE_OBJECTS;
}
return $fromCollection->computeCUDSets($toCollection, $compa... | php | public function computeCUDSets(ArrayCollection $fromCollection, ArrayCollection $toCollection, $compareFunction = NULL, $uniqueHashFunction = NULL) {
if (!isset($compareFunction)) {
$compareFunction = ArrayCollection::COMPARE_OBJECTS;
}
return $fromCollection->computeCUDSets($toCollection, $compa... | [
"public",
"function",
"computeCUDSets",
"(",
"ArrayCollection",
"$",
"fromCollection",
",",
"ArrayCollection",
"$",
"toCollection",
",",
"$",
"compareFunction",
"=",
"NULL",
",",
"$",
"uniqueHashFunction",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"... | Berechnet die Updates / Inserts / Deletes zwischen den beiden Collections
wird keine $compareFunction angegeben, werden die Elemente der Collection als Objekte behandelt
wird keine $uniqueHashFunction angegeben werden diese mit spl_object_hash() gehashed
@return list($inserts, $updates, $deletes) | [
"Berechnet",
"die",
"Updates",
"/",
"Inserts",
"/",
"Deletes",
"zwischen",
"den",
"beiden",
"Collections"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/GenericCollectionSynchronizer.php#L90-L96 |
yuncms/framework | src/admin/controllers/UserController.php | UserController.actionUpdateProfile | public function actionUpdateProfile($id)
{
Url::remember('', 'actions-redirect');
$model = $this->findModel($id);
$profile = $model->profile;
if ($profile == null) {
$profile = Yii::createObject(UserProfile::class);
$profile->link('user', $model);
}
... | php | public function actionUpdateProfile($id)
{
Url::remember('', 'actions-redirect');
$model = $this->findModel($id);
$profile = $model->profile;
if ($profile == null) {
$profile = Yii::createObject(UserProfile::class);
$profile->link('user', $model);
}
... | [
"public",
"function",
"actionUpdateProfile",
"(",
"$",
"id",
")",
"{",
"Url",
"::",
"remember",
"(",
"''",
",",
"'actions-redirect'",
")",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"profile",
"=",
"$",
"mo... | Updates an existing profile.
@param int $id
@return mixed
@throws NotFoundHttpException
@throws \yii\base\InvalidConfigException | [
"Updates",
"an",
"existing",
"profile",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/controllers/UserController.php#L135-L157 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.setUserId | public function setUserId($v)
{
if ($v !== null && is_numeric($v)) {
$v = (int) $v;
}
if ($this->user_id !== $v) {
$this->user_id = $v;
$this->modifiedColumns[] = UserRolePeer::USER_ID;
}
if ($this->aUser !== null && $this->aUser->getId()... | php | public function setUserId($v)
{
if ($v !== null && is_numeric($v)) {
$v = (int) $v;
}
if ($this->user_id !== $v) {
$this->user_id = $v;
$this->modifiedColumns[] = UserRolePeer::USER_ID;
}
if ($this->aUser !== null && $this->aUser->getId()... | [
"public",
"function",
"setUserId",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
"&&",
"is_numeric",
"(",
"$",
"v",
")",
")",
"{",
"$",
"v",
"=",
"(",
"int",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"user_id",
"... | Set the value of [user_id] column.
@param int $v new value
@return UserRole The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"user_id",
"]",
"column",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L113-L130 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.setRoleId | public function setRoleId($v)
{
if ($v !== null && is_numeric($v)) {
$v = (int) $v;
}
if ($this->role_id !== $v) {
$this->role_id = $v;
$this->modifiedColumns[] = UserRolePeer::ROLE_ID;
}
if ($this->aRole !== null && $this->aRole->getId()... | php | public function setRoleId($v)
{
if ($v !== null && is_numeric($v)) {
$v = (int) $v;
}
if ($this->role_id !== $v) {
$this->role_id = $v;
$this->modifiedColumns[] = UserRolePeer::ROLE_ID;
}
if ($this->aRole !== null && $this->aRole->getId()... | [
"public",
"function",
"setRoleId",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
"&&",
"is_numeric",
"(",
"$",
"v",
")",
")",
"{",
"$",
"v",
"=",
"(",
"int",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"role_id",
"... | Set the value of [role_id] column.
@param int $v new value
@return UserRole The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"role_id",
"]",
"column",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L138-L155 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.hydrate | public function hydrate($row, $startcol = 0, $rehydrate = false)
{
try {
$this->user_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->role_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->resetModified();
... | php | public function hydrate($row, $startcol = 0, $rehydrate = false)
{
try {
$this->user_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->role_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->resetModified();
... | [
"public",
"function",
"hydrate",
"(",
"$",
"row",
",",
"$",
"startcol",
"=",
"0",
",",
"$",
"rehydrate",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"user_id",
"=",
"(",
"$",
"row",
"[",
"$",
"startcol",
"+",
"0",
"]",
"!==",
"null",
... | Hydrates (populates) the object variables with values from the database resultset.
An offset (0-based "start column") is specified so that objects can be hydrated
with a subset of the columns in the resultset rows. This is needed, for example,
for results of JOIN queries where the resultset row includes columns from ... | [
"Hydrates",
"(",
"populates",
")",
"the",
"object",
"variables",
"with",
"values",
"from",
"the",
"database",
"resultset",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L185-L205 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.doInsert | protected function doInsert(PropelPDO $con)
{
$modifiedColumns = array();
$index = 0;
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(UserRolePeer::USER_ID)) {
$modifiedColumns[':p' . $index++] = '`user_id`';
}
... | php | protected function doInsert(PropelPDO $con)
{
$modifiedColumns = array();
$index = 0;
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(UserRolePeer::USER_ID)) {
$modifiedColumns[':p' . $index++] = '`user_id`';
}
... | [
"protected",
"function",
"doInsert",
"(",
"PropelPDO",
"$",
"con",
")",
"{",
"$",
"modifiedColumns",
"=",
"array",
"(",
")",
";",
"$",
"index",
"=",
"0",
";",
"// check the columns in natural order for more readable SQL queries",
"if",
"(",
"$",
"this",
"->",
"i... | Insert the row in the database.
@param PropelPDO $con
@throws PropelException
@see doSave() | [
"Insert",
"the",
"row",
"in",
"the",
"database",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L428-L467 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.doValidate | protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
// We call the validate method on the following object(s) if they
// were passed to thi... | php | protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
// We call the validate method on the following object(s) if they
// were passed to thi... | [
"protected",
"function",
"doValidate",
"(",
"$",
"columns",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"alreadyInValidation",
")",
"{",
"$",
"this",
"->",
"alreadyInValidation",
"=",
"true",
";",
"$",
"retval",
"=",
"null",
";",
"$",
"fa... | This function performs the validation work for complex object models.
In addition to checking the current object, all related objects will
also be validated. If all pass then <code>true</code> is returned; otherwise
an aggregated array of ValidationFailed objects will be returned.
@param array $columns Array of colu... | [
"This",
"function",
"performs",
"the",
"validation",
"work",
"for",
"complex",
"object",
"models",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L536-L573 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.toArray | public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['UserRole'][serialize($this->getPrimaryKey())])) {
return '*RECURSION*';
}
$alreadyDumpedO... | php | public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['UserRole'][serialize($this->getPrimaryKey())])) {
return '*RECURSION*';
}
$alreadyDumpedO... | [
"public",
"function",
"toArray",
"(",
"$",
"keyType",
"=",
"BasePeer",
"::",
"TYPE_PHPNAME",
",",
"$",
"includeLazyLoadColumns",
"=",
"true",
",",
"$",
"alreadyDumpedObjects",
"=",
"array",
"(",
")",
",",
"$",
"includeForeignObjects",
"=",
"false",
")",
"{",
... | Exports the object as an array.
You can specify the key type of the array by passing one of the class
type constants.
@param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
Defau... | [
"Exports",
"the",
"object",
"as",
"an",
"array",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L630-L656 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.setByPosition | public function setByPosition($pos, $value)
{
switch ($pos) {
case 0:
$this->setUserId($value);
break;
case 1:
$this->setRoleId($value);
break;
} // switch()
} | php | public function setByPosition($pos, $value)
{
switch ($pos) {
case 0:
$this->setUserId($value);
break;
case 1:
$this->setRoleId($value);
break;
} // switch()
} | [
"public",
"function",
"setByPosition",
"(",
"$",
"pos",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"pos",
")",
"{",
"case",
"0",
":",
"$",
"this",
"->",
"setUserId",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"1",
":",
"$",
"this",
... | Sets a field from the object by Position as specified in the xml schema.
Zero-based.
@param int $pos position in xml schema
@param mixed $value field value
@return void | [
"Sets",
"a",
"field",
"from",
"the",
"object",
"by",
"Position",
"as",
"specified",
"in",
"the",
"xml",
"schema",
".",
"Zero",
"-",
"based",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L684-L694 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.fromArray | public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = UserRolePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setUserId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setRoleId($arr[$keys[1]]);
} | php | public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = UserRolePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setUserId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setRoleId($arr[$keys[1]]);
} | [
"public",
"function",
"fromArray",
"(",
"$",
"arr",
",",
"$",
"keyType",
"=",
"BasePeer",
"::",
"TYPE_PHPNAME",
")",
"{",
"$",
"keys",
"=",
"UserRolePeer",
"::",
"getFieldNames",
"(",
"$",
"keyType",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"ke... | Populates the object using an array.
This is particularly useful when populating an object from one of the
request arrays (e.g. $_POST). This method goes through the column
names, checking to see whether a matching key exists in populated
array. If so the setByName() method is called for that column.
You can specify... | [
"Populates",
"the",
"object",
"using",
"an",
"array",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L713-L719 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.buildCriteria | public function buildCriteria()
{
$criteria = new Criteria(UserRolePeer::DATABASE_NAME);
if ($this->isColumnModified(UserRolePeer::USER_ID)) $criteria->add(UserRolePeer::USER_ID, $this->user_id);
if ($this->isColumnModified(UserRolePeer::ROLE_ID)) $criteria->add(UserRolePeer::ROLE_ID, $this... | php | public function buildCriteria()
{
$criteria = new Criteria(UserRolePeer::DATABASE_NAME);
if ($this->isColumnModified(UserRolePeer::USER_ID)) $criteria->add(UserRolePeer::USER_ID, $this->user_id);
if ($this->isColumnModified(UserRolePeer::ROLE_ID)) $criteria->add(UserRolePeer::ROLE_ID, $this... | [
"public",
"function",
"buildCriteria",
"(",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"UserRolePeer",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isColumnModified",
"(",
"UserRolePeer",
"::",
"USER_ID",
")",
")",
"$",
"cri... | Build a Criteria object containing the values of all modified columns in this object.
@return Criteria The Criteria object containing all modified values. | [
"Build",
"a",
"Criteria",
"object",
"containing",
"the",
"values",
"of",
"all",
"modified",
"columns",
"in",
"this",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L726-L734 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.buildPkeyCriteria | public function buildPkeyCriteria()
{
$criteria = new Criteria(UserRolePeer::DATABASE_NAME);
$criteria->add(UserRolePeer::USER_ID, $this->user_id);
$criteria->add(UserRolePeer::ROLE_ID, $this->role_id);
return $criteria;
} | php | public function buildPkeyCriteria()
{
$criteria = new Criteria(UserRolePeer::DATABASE_NAME);
$criteria->add(UserRolePeer::USER_ID, $this->user_id);
$criteria->add(UserRolePeer::ROLE_ID, $this->role_id);
return $criteria;
} | [
"public",
"function",
"buildPkeyCriteria",
"(",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"UserRolePeer",
"::",
"DATABASE_NAME",
")",
";",
"$",
"criteria",
"->",
"add",
"(",
"UserRolePeer",
"::",
"USER_ID",
",",
"$",
"this",
"->",
"user_id",
... | Builds a Criteria object containing the primary key for this object.
Unlike buildCriteria() this method includes the primary key values regardless
of whether or not they have been modified.
@return Criteria The Criteria object containing value(s) for primary key(s). | [
"Builds",
"a",
"Criteria",
"object",
"containing",
"the",
"primary",
"key",
"for",
"this",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L744-L751 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.copyInto | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setUserId($this->getUserId());
$copyObj->setRoleId($this->getRoleId());
if ($deepCopy && !$this->startCopy) {
// important: temporarily setNew(false) because this affects the behavior of
... | php | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setUserId($this->getUserId());
$copyObj->setRoleId($this->getRoleId());
if ($deepCopy && !$this->startCopy) {
// important: temporarily setNew(false) because this affects the behavior of
... | [
"public",
"function",
"copyInto",
"(",
"$",
"copyObj",
",",
"$",
"deepCopy",
"=",
"false",
",",
"$",
"makeNew",
"=",
"true",
")",
"{",
"$",
"copyObj",
"->",
"setUserId",
"(",
"$",
"this",
"->",
"getUserId",
"(",
")",
")",
";",
"$",
"copyObj",
"->",
... | Sets contents of passed object to values from current object.
If desired, this method can also make copies of all associated (fkey referrers)
objects.
@param object $copyObj An object of UserRole (or compatible) type.
@param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
@par... | [
"Sets",
"contents",
"of",
"passed",
"object",
"to",
"values",
"from",
"current",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L800-L819 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.setUser | public function setUser(User $v = null)
{
if ($v === null) {
$this->setUserId(NULL);
} else {
$this->setUserId($v->getId());
}
$this->aUser = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been ... | php | public function setUser(User $v = null)
{
if ($v === null) {
$this->setUserId(NULL);
} else {
$this->setUserId($v->getId());
}
$this->aUser = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been ... | [
"public",
"function",
"setUser",
"(",
"User",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setUserId",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setUserId",
"(",
"$",
"v",... | Declares an association between this object and a User object.
@param User $v
@return UserRole The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"User",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L868-L886 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.getUser | public function getUser(PropelPDO $con = null, $doQuery = true)
{
if ($this->aUser === null && ($this->user_id !== null) && $doQuery) {
$this->aUser = UserQuery::create()->findPk($this->user_id, $con);
/* The following can be used additionally to
guarantee the related... | php | public function getUser(PropelPDO $con = null, $doQuery = true)
{
if ($this->aUser === null && ($this->user_id !== null) && $doQuery) {
$this->aUser = UserQuery::create()->findPk($this->user_id, $con);
/* The following can be used additionally to
guarantee the related... | [
"public",
"function",
"getUser",
"(",
"PropelPDO",
"$",
"con",
"=",
"null",
",",
"$",
"doQuery",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aUser",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"user_id",
"!==",
"null",
")",
"&&",
"$",
... | Get the associated User object
@param PropelPDO $con Optional Connection object.
@param $doQuery Executes a query to get the object if required
@return User The associated User object.
@throws PropelException | [
"Get",
"the",
"associated",
"User",
"object"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L897-L911 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.setRole | public function setRole(Role $v = null)
{
if ($v === null) {
$this->setRoleId(NULL);
} else {
$this->setRoleId($v->getId());
}
$this->aRole = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been ... | php | public function setRole(Role $v = null)
{
if ($v === null) {
$this->setRoleId(NULL);
} else {
$this->setRoleId($v->getId());
}
$this->aRole = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been ... | [
"public",
"function",
"setRole",
"(",
"Role",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setRoleId",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setRoleId",
"(",
"$",
"v",... | Declares an association between this object and a Role object.
@param Role $v
@return UserRole The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"Role",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L920-L938 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.getRole | public function getRole(PropelPDO $con = null, $doQuery = true)
{
if ($this->aRole === null && ($this->role_id !== null) && $doQuery) {
$this->aRole = RoleQuery::create()->findPk($this->role_id, $con);
/* The following can be used additionally to
guarantee the related... | php | public function getRole(PropelPDO $con = null, $doQuery = true)
{
if ($this->aRole === null && ($this->role_id !== null) && $doQuery) {
$this->aRole = RoleQuery::create()->findPk($this->role_id, $con);
/* The following can be used additionally to
guarantee the related... | [
"public",
"function",
"getRole",
"(",
"PropelPDO",
"$",
"con",
"=",
"null",
",",
"$",
"doQuery",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aRole",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"role_id",
"!==",
"null",
")",
"&&",
"$",
... | Get the associated Role object
@param PropelPDO $con Optional Connection object.
@param $doQuery Executes a query to get the object if required
@return Role The associated Role object.
@throws PropelException | [
"Get",
"the",
"associated",
"Role",
"object"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L949-L963 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.clear | public function clear()
{
$this->user_id = null;
$this->role_id = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->alreadyInClearAllReferencesDeep = false;
$this->clearAllReferences();
$this->resetModified();
$this->setNew... | php | public function clear()
{
$this->user_id = null;
$this->role_id = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->alreadyInClearAllReferencesDeep = false;
$this->clearAllReferences();
$this->resetModified();
$this->setNew... | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"user_id",
"=",
"null",
";",
"$",
"this",
"->",
"role_id",
"=",
"null",
";",
"$",
"this",
"->",
"alreadyInSave",
"=",
"false",
";",
"$",
"this",
"->",
"alreadyInValidation",
"=",
"false",... | Clears the current object and sets all attributes to their default values | [
"Clears",
"the",
"current",
"object",
"and",
"sets",
"all",
"attributes",
"to",
"their",
"default",
"values"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L968-L979 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserRole.php | BaseUserRole.clearAllReferences | public function clearAllReferences($deep = false)
{
if ($deep && !$this->alreadyInClearAllReferencesDeep) {
$this->alreadyInClearAllReferencesDeep = true;
if ($this->aUser instanceof Persistent) {
$this->aUser->clearAllReferences($deep);
}
if ($t... | php | public function clearAllReferences($deep = false)
{
if ($deep && !$this->alreadyInClearAllReferencesDeep) {
$this->alreadyInClearAllReferencesDeep = true;
if ($this->aUser instanceof Persistent) {
$this->aUser->clearAllReferences($deep);
}
if ($t... | [
"public",
"function",
"clearAllReferences",
"(",
"$",
"deep",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"deep",
"&&",
"!",
"$",
"this",
"->",
"alreadyInClearAllReferencesDeep",
")",
"{",
"$",
"this",
"->",
"alreadyInClearAllReferencesDeep",
"=",
"true",
";",
"... | Resets all references to other model objects or collections of model objects.
This method is a user-space workaround for PHP's inability to garbage collect
objects with circular references (even in PHP 5.3). This is currently necessary
when using Propel in certain daemon or large-volume/high-memory operations.
@param... | [
"Resets",
"all",
"references",
"to",
"other",
"model",
"objects",
"or",
"collections",
"of",
"model",
"objects",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserRole.php#L990-L1006 |
dashifen/wordpress-php7-plugin-boilerplate | src/Controller/ControllerTraits/PostTypesTrait.php | PostTypesTrait.getPostType | final public function getPostType(int $index): string {
$types = $this->getPostTypes();
if (!isset($types[$index])) {
throw new ControllerException("Unknown type.",
ControllerException::UNKNOWN_TYPE);
}
return $types[$index];
} | php | final public function getPostType(int $index): string {
$types = $this->getPostTypes();
if (!isset($types[$index])) {
throw new ControllerException("Unknown type.",
ControllerException::UNKNOWN_TYPE);
}
return $types[$index];
} | [
"final",
"public",
"function",
"getPostType",
"(",
"int",
"$",
"index",
")",
":",
"string",
"{",
"$",
"types",
"=",
"$",
"this",
"->",
"getPostTypes",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"types",
"[",
"$",
"index",
"]",
")",
")",
"{... | given an $index, returns that post type from the array returned by
getPostTypes().
@param int $index
@return string
@throws ControllerException | [
"given",
"an",
"$index",
"returns",
"that",
"post",
"type",
"from",
"the",
"array",
"returned",
"by",
"getPostTypes",
"()",
"."
] | train | https://github.com/dashifen/wordpress-php7-plugin-boilerplate/blob/c7875deb403d311efca72dc3c8beb566972a56cb/src/Controller/ControllerTraits/PostTypesTrait.php#L25-L33 |
dashifen/wordpress-php7-plugin-boilerplate | src/Controller/ControllerTraits/PostTypesTrait.php | PostTypesTrait.initPostTypesTrait | final protected function initPostTypesTrait() {
add_action("init", function () {
$postTypes = $this->getPostTypes();
foreach ($postTypes as $postType) {
$this->registerPostType($postType);
}
});
} | php | final protected function initPostTypesTrait() {
add_action("init", function () {
$postTypes = $this->getPostTypes();
foreach ($postTypes as $postType) {
$this->registerPostType($postType);
}
});
} | [
"final",
"protected",
"function",
"initPostTypesTrait",
"(",
")",
"{",
"add_action",
"(",
"\"init\"",
",",
"function",
"(",
")",
"{",
"$",
"postTypes",
"=",
"$",
"this",
"->",
"getPostTypes",
"(",
")",
";",
"foreach",
"(",
"$",
"postTypes",
"as",
"$",
"p... | Called automatically when the plugins are loaded, this method
registers our post types for the users of this boilerplate.
@return void | [
"Called",
"automatically",
"when",
"the",
"plugins",
"are",
"loaded",
"this",
"method",
"registers",
"our",
"post",
"types",
"for",
"the",
"users",
"of",
"this",
"boilerplate",
"."
] | train | https://github.com/dashifen/wordpress-php7-plugin-boilerplate/blob/c7875deb403d311efca72dc3c8beb566972a56cb/src/Controller/ControllerTraits/PostTypesTrait.php#L82-L89 |
dashifen/wordpress-php7-plugin-boilerplate | src/Controller/ControllerTraits/PostTypesTrait.php | PostTypesTrait.registerPostType | final public function registerPostType(string $postType): void {
// we make this a public method because we use it in our
// initialization method below but frequently from the activation
// action of the plugin itself so that we can flush permalinks
// based on our new types.
$args = $this->getPostType... | php | final public function registerPostType(string $postType): void {
// we make this a public method because we use it in our
// initialization method below but frequently from the activation
// action of the plugin itself so that we can flush permalinks
// based on our new types.
$args = $this->getPostType... | [
"final",
"public",
"function",
"registerPostType",
"(",
"string",
"$",
"postType",
")",
":",
"void",
"{",
"// we make this a public method because we use it in our",
"// initialization method below but frequently from the activation",
"// action of the plugin itself so that we can flush ... | @param string $postType
@return void | [
"@param",
"string",
"$postType"
] | train | https://github.com/dashifen/wordpress-php7-plugin-boilerplate/blob/c7875deb403d311efca72dc3c8beb566972a56cb/src/Controller/ControllerTraits/PostTypesTrait.php#L96-L109 |
danrevah/shortify-punit | src/Stub/WhenCase.php | WhenCase.setMethod | public function setMethod($args, $action, $returns)
{
ShortifyPunit::setWhenMockResponse(
$this->className,
$this->instanceId,
$this->method,
$args,
$action,
$returns
);
} | php | public function setMethod($args, $action, $returns)
{
ShortifyPunit::setWhenMockResponse(
$this->className,
$this->instanceId,
$this->method,
$args,
$action,
$returns
);
} | [
"public",
"function",
"setMethod",
"(",
"$",
"args",
",",
"$",
"action",
",",
"$",
"returns",
")",
"{",
"ShortifyPunit",
"::",
"setWhenMockResponse",
"(",
"$",
"this",
"->",
"className",
",",
"$",
"this",
"->",
"instanceId",
",",
"$",
"this",
"->",
"meth... | @desc Setting up the mock response in the ShortifyPunit Return Values array
@param $args
@param $action
@param $returns | [
"@desc",
"Setting",
"up",
"the",
"mock",
"response",
"in",
"the",
"ShortifyPunit",
"Return",
"Values",
"array"
] | train | https://github.com/danrevah/shortify-punit/blob/cedd08f31de8e7409a07d2630701ef4e924cc5f0/src/Stub/WhenCase.php#L46-L56 |
anime-db/app-bundle | src/Event/Listener/Package.php | Package.onUpdated | public function onUpdated(UpdatedEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$this->addPackage($event->getPackage());
}
} | php | public function onUpdated(UpdatedEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$this->addPackage($event->getPackage());
}
} | [
"public",
"function",
"onUpdated",
"(",
"UpdatedEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getPackage",
"(",
")",
"->",
"getType",
"(",
")",
"==",
"self",
"::",
"PLUGIN_TYPE",
")",
"{",
"$",
"this",
"->",
"addPackage",
"(",
"$",
... | Update plugin data.
@param UpdatedEvent $event | [
"Update",
"plugin",
"data",
"."
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L85-L90 |
anime-db/app-bundle | src/Event/Listener/Package.php | Package.onInstalled | public function onInstalled(InstalledEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$this->addPackage($event->getPackage());
}
} | php | public function onInstalled(InstalledEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$this->addPackage($event->getPackage());
}
} | [
"public",
"function",
"onInstalled",
"(",
"InstalledEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getPackage",
"(",
")",
"->",
"getType",
"(",
")",
"==",
"self",
"::",
"PLUGIN_TYPE",
")",
"{",
"$",
"this",
"->",
"addPackage",
"(",
"$"... | Registr plugin.
@param InstalledEvent $event | [
"Registr",
"plugin",
"."
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L97-L102 |
anime-db/app-bundle | src/Event/Listener/Package.php | Package.addPackage | protected function addPackage(ComposerPackage $package)
{
$plugin = $this->rep->find($package->getName());
// create new plugin if not exists
if (!$plugin) {
$plugin = new Plugin();
$plugin->setName($package->getName());
}
list($vendor, $package) = e... | php | protected function addPackage(ComposerPackage $package)
{
$plugin = $this->rep->find($package->getName());
// create new plugin if not exists
if (!$plugin) {
$plugin = new Plugin();
$plugin->setName($package->getName());
}
list($vendor, $package) = e... | [
"protected",
"function",
"addPackage",
"(",
"ComposerPackage",
"$",
"package",
")",
"{",
"$",
"plugin",
"=",
"$",
"this",
"->",
"rep",
"->",
"find",
"(",
"$",
"package",
"->",
"getName",
"(",
")",
")",
";",
"// create new plugin if not exists",
"if",
"(",
... | Add plugin from package.
@param ComposerPackage $package | [
"Add",
"plugin",
"from",
"package",
"."
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L109-L133 |
anime-db/app-bundle | src/Event/Listener/Package.php | Package.onRemoved | public function onRemoved(RemovedEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$plugin = $this->rep->find($event->getPackage()->getName());
if ($plugin) {
$this->em->remove($plugin);
$this->em->flush();
}
... | php | public function onRemoved(RemovedEvent $event)
{
if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
$plugin = $this->rep->find($event->getPackage()->getName());
if ($plugin) {
$this->em->remove($plugin);
$this->em->flush();
}
... | [
"public",
"function",
"onRemoved",
"(",
"RemovedEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getPackage",
"(",
")",
"->",
"getType",
"(",
")",
"==",
"self",
"::",
"PLUGIN_TYPE",
")",
"{",
"$",
"plugin",
"=",
"$",
"this",
"->",
"rep... | Unregistr plugin.
@param RemovedEvent $event | [
"Unregistr",
"plugin",
"."
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L140-L150 |
anime-db/app-bundle | src/Event/Listener/Package.php | Package.onInstalledConfigureShmop | public function onInstalledConfigureShmop(InstalledEvent $event)
{
// use Shmop as driver for Cache Time Keeper
if ($event->getPackage()->getName() == self::PACKAGE_SHMOP) {
$this->parameters->set('cache_time_keeper.driver', 'cache_time_keeper.driver.multi');
$this->parameter... | php | public function onInstalledConfigureShmop(InstalledEvent $event)
{
// use Shmop as driver for Cache Time Keeper
if ($event->getPackage()->getName() == self::PACKAGE_SHMOP) {
$this->parameters->set('cache_time_keeper.driver', 'cache_time_keeper.driver.multi');
$this->parameter... | [
"public",
"function",
"onInstalledConfigureShmop",
"(",
"InstalledEvent",
"$",
"event",
")",
"{",
"// use Shmop as driver for Cache Time Keeper",
"if",
"(",
"$",
"event",
"->",
"getPackage",
"(",
")",
"->",
"getName",
"(",
")",
"==",
"self",
"::",
"PACKAGE_SHMOP",
... | Configure shmop.
@param InstalledEvent $event | [
"Configure",
"shmop",
"."
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L157-L164 |
anime-db/app-bundle | src/Event/Listener/Package.php | Package.onRemovedShmop | public function onRemovedShmop(RemovedEvent $event)
{
if ($event->getPackage()->getName() == self::PACKAGE_SHMOP) {
$this->parameters->set('cache_time_keeper.driver', 'cache_time_keeper.driver.file');
}
} | php | public function onRemovedShmop(RemovedEvent $event)
{
if ($event->getPackage()->getName() == self::PACKAGE_SHMOP) {
$this->parameters->set('cache_time_keeper.driver', 'cache_time_keeper.driver.file');
}
} | [
"public",
"function",
"onRemovedShmop",
"(",
"RemovedEvent",
"$",
"event",
")",
"{",
"if",
"(",
"$",
"event",
"->",
"getPackage",
"(",
")",
"->",
"getName",
"(",
")",
"==",
"self",
"::",
"PACKAGE_SHMOP",
")",
"{",
"$",
"this",
"->",
"parameters",
"->",
... | Restore config on removed shmop.
@param RemovedEvent $event | [
"Restore",
"config",
"on",
"removed",
"shmop",
"."
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Package.php#L171-L176 |
SAREhub/PHP_Commons | src/SAREhub/Commons/Misc/SimpleSemafor.php | SimpleSemafor.lock | public function lock()
{
if (!$this->isLocked()) {
$file = fopen($this->getFilePath(), 'w');
if ($file) {
fwrite($file, getmypid());
fclose($file);
return true;
}
}
return false;
} | php | public function lock()
{
if (!$this->isLocked()) {
$file = fopen($this->getFilePath(), 'w');
if ($file) {
fwrite($file, getmypid());
fclose($file);
return true;
}
}
return false;
} | [
"public",
"function",
"lock",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isLocked",
"(",
")",
")",
"{",
"$",
"file",
"=",
"fopen",
"(",
"$",
"this",
"->",
"getFilePath",
"(",
")",
",",
"'w'",
")",
";",
"if",
"(",
"$",
"file",
")",
"{"... | Try create semafor file
@return bool When successful locked | [
"Try",
"create",
"semafor",
"file"
] | train | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Misc/SimpleSemafor.php#L23-L34 |
mmieluch/laravel-serve-custom-ini | src/ServeCommand.php | ServeCommand.fire | public function fire()
{
chdir($this->laravel->publicPath());
$host = $this->input->getOption('host');
$port = $this->input->getOption('port');
$base = ProcessUtils::escapeArgument($this->laravel->basePath());
$binary = ProcessUtils::escapeArgument((new PhpExecutableFinde... | php | public function fire()
{
chdir($this->laravel->publicPath());
$host = $this->input->getOption('host');
$port = $this->input->getOption('port');
$base = ProcessUtils::escapeArgument($this->laravel->basePath());
$binary = ProcessUtils::escapeArgument((new PhpExecutableFinde... | [
"public",
"function",
"fire",
"(",
")",
"{",
"chdir",
"(",
"$",
"this",
"->",
"laravel",
"->",
"publicPath",
"(",
")",
")",
";",
"$",
"host",
"=",
"$",
"this",
"->",
"input",
"->",
"getOption",
"(",
"'host'",
")",
";",
"$",
"port",
"=",
"$",
"thi... | Execute the console command.
@return void
@throws \Exception | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/mmieluch/laravel-serve-custom-ini/blob/38e547b8496a6123fe63be0901a07fd798537ad7/src/ServeCommand.php#L41-L68 |
mmieluch/laravel-serve-custom-ini | src/ServeCommand.php | ServeCommand.buildCommand | protected function buildCommand($binary, $host, $port, $base)
{
$binary = $this->handleCustomIni($binary);
$base = str_replace("'", '', $base);
$command = "{$binary} -S {$host}:{$port} {$base}/server.php";
return $command;
} | php | protected function buildCommand($binary, $host, $port, $base)
{
$binary = $this->handleCustomIni($binary);
$base = str_replace("'", '', $base);
$command = "{$binary} -S {$host}:{$port} {$base}/server.php";
return $command;
} | [
"protected",
"function",
"buildCommand",
"(",
"$",
"binary",
",",
"$",
"host",
",",
"$",
"port",
",",
"$",
"base",
")",
"{",
"$",
"binary",
"=",
"$",
"this",
"->",
"handleCustomIni",
"(",
"$",
"binary",
")",
";",
"$",
"base",
"=",
"str_replace",
"(",... | Returns a command to pass through to shell.
@param string $binary Usually full path to the PHP executable
@param string $host Hostname
@param int $port
@param string $base Full path to Laravel project root
@return string | [
"Returns",
"a",
"command",
"to",
"pass",
"through",
"to",
"shell",
"."
] | train | https://github.com/mmieluch/laravel-serve-custom-ini/blob/38e547b8496a6123fe63be0901a07fd798537ad7/src/ServeCommand.php#L80-L89 |
mmieluch/laravel-serve-custom-ini | src/ServeCommand.php | ServeCommand.handleCustomIni | protected function handleCustomIni($command)
{
// If --ini parameter was not specified, just return the command
// is at has been constructed.
if (!$this->option('ini')) {
return $command;
}
// Additional parameter will not work when escaped with single quotes.
... | php | protected function handleCustomIni($command)
{
// If --ini parameter was not specified, just return the command
// is at has been constructed.
if (!$this->option('ini')) {
return $command;
}
// Additional parameter will not work when escaped with single quotes.
... | [
"protected",
"function",
"handleCustomIni",
"(",
"$",
"command",
")",
"{",
"// If --ini parameter was not specified, just return the command",
"// is at has been constructed.",
"if",
"(",
"!",
"$",
"this",
"->",
"option",
"(",
"'ini'",
")",
")",
"{",
"return",
"$",
"c... | Adds parameter telling PHP built-in server to respect a custom
php.ini file.
@param string $command Command built up to this point.
@return string | [
"Adds",
"parameter",
"telling",
"PHP",
"built",
"-",
"in",
"server",
"to",
"respect",
"a",
"custom",
"php",
".",
"ini",
"file",
"."
] | train | https://github.com/mmieluch/laravel-serve-custom-ini/blob/38e547b8496a6123fe63be0901a07fd798537ad7/src/ServeCommand.php#L99-L130 |
mmieluch/laravel-serve-custom-ini | src/ServeCommand.php | ServeCommand.getOptions | protected function getOptions()
{
return [
['host', null, InputOption::VALUE_OPTIONAL, 'The host address to serve the application on.', 'localhost'],
['port', null, InputOption::VALUE_OPTIONAL, 'The port to serve the application on.', 8000],
['ini', null, InputOption::V... | php | protected function getOptions()
{
return [
['host', null, InputOption::VALUE_OPTIONAL, 'The host address to serve the application on.', 'localhost'],
['port', null, InputOption::VALUE_OPTIONAL, 'The port to serve the application on.', 8000],
['ini', null, InputOption::V... | [
"protected",
"function",
"getOptions",
"(",
")",
"{",
"return",
"[",
"[",
"'host'",
",",
"null",
",",
"InputOption",
"::",
"VALUE_OPTIONAL",
",",
"'The host address to serve the application on.'",
",",
"'localhost'",
"]",
",",
"[",
"'port'",
",",
"null",
",",
"I... | Get the console command options.
@return array | [
"Get",
"the",
"console",
"command",
"options",
"."
] | train | https://github.com/mmieluch/laravel-serve-custom-ini/blob/38e547b8496a6123fe63be0901a07fd798537ad7/src/ServeCommand.php#L137-L148 |
webforge-labs/psc-cms | lib/Psc/UI/Component/Base.php | Base.isBlock | protected function isBlock($componentContent = NULL) {
return $componentContent instanceof \Psc\HTML\Tag &&
$componentContent->getTag() === 'div' ||
$componentContent->getTag() === 'fieldset'
;
} | php | protected function isBlock($componentContent = NULL) {
return $componentContent instanceof \Psc\HTML\Tag &&
$componentContent->getTag() === 'div' ||
$componentContent->getTag() === 'fieldset'
;
} | [
"protected",
"function",
"isBlock",
"(",
"$",
"componentContent",
"=",
"NULL",
")",
"{",
"return",
"$",
"componentContent",
"instanceof",
"\\",
"Psc",
"\\",
"HTML",
"\\",
"Tag",
"&&",
"$",
"componentContent",
"->",
"getTag",
"(",
")",
"===",
"'div'",
"||",
... | gibt dies TRUE zurück wird z. B. in wrapHTML() kein Umbruch vor dem Hint gemacht
@return bool | [
"gibt",
"dies",
"TRUE",
"zurück",
"wird",
"z",
".",
"B",
".",
"in",
"wrapHTML",
"()",
"kein",
"Umbruch",
"vor",
"dem",
"Hint",
"gemacht"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/UI/Component/Base.php#L144-L149 |
yuncms/framework | src/user/migrations/m180223_102734Create_user_table.php | m180223_102734Create_user_table.safeUp | public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=Inn... | php | public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=Inn... | [
"public",
"function",
"safeUp",
"(",
")",
"{",
"$",
"tableOptions",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"db",
"->",
"driverName",
"===",
"'mysql'",
")",
"{",
"// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-... | {@inheritdoc} | [
"{"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/user/migrations/m180223_102734Create_user_table.php#L12-L43 |
webtown-php/KunstmaanExtensionBundle | src/User/UserEditService.php | UserEditService.getChoices | public function getChoices($username = null, $email = null, $or = false, $limit = null)
{
$qb = $this->getRepository()->createQueryBuilder('u');
$qb->orderBy('u.username');
$method = $or ? 'orWhere' : 'andWhere';
if ($username) {
$qb->$method('u.username LIKE :username');... | php | public function getChoices($username = null, $email = null, $or = false, $limit = null)
{
$qb = $this->getRepository()->createQueryBuilder('u');
$qb->orderBy('u.username');
$method = $or ? 'orWhere' : 'andWhere';
if ($username) {
$qb->$method('u.username LIKE :username');... | [
"public",
"function",
"getChoices",
"(",
"$",
"username",
"=",
"null",
",",
"$",
"email",
"=",
"null",
",",
"$",
"or",
"=",
"false",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"cr... | Find user choices
@param string $username
@param string $email
@param bool $or combine search params with OR
@param int $limit Limit the number of results
@return array | [
"Find",
"user",
"choices"
] | train | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/User/UserEditService.php#L67-L85 |
webtown-php/KunstmaanExtensionBundle | src/User/UserEditService.php | UserEditService.getChoicesAsEmailUsername | public function getChoicesAsEmailUsername(array &$choices)
{
$ret = [];
foreach ($choices as $item) {
$ret[] = sprintf('%s (%s)', $item->getEmail(), $item->getUsername());
}
return $ret;
} | php | public function getChoicesAsEmailUsername(array &$choices)
{
$ret = [];
foreach ($choices as $item) {
$ret[] = sprintf('%s (%s)', $item->getEmail(), $item->getUsername());
}
return $ret;
} | [
"public",
"function",
"getChoicesAsEmailUsername",
"(",
"array",
"&",
"$",
"choices",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"choices",
"as",
"$",
"item",
")",
"{",
"$",
"ret",
"[",
"]",
"=",
"sprintf",
"(",
"'%s (%s)'",
",",
... | Get selector choices as combined username+email
@param User[] $choices
@return string[] | [
"Get",
"selector",
"choices",
"as",
"combined",
"username",
"+",
"email"
] | train | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/User/UserEditService.php#L94-L102 |
webtown-php/KunstmaanExtensionBundle | src/User/UserEditService.php | UserEditService.getChoicesAsSeparateEmailUsername | public function getChoicesAsSeparateEmailUsername(array &$choices)
{
$ret = [];
foreach ($choices as $item) {
$ret[] = $item->getEmail();
$ret[] = $item->getUsername();
}
return $ret;
} | php | public function getChoicesAsSeparateEmailUsername(array &$choices)
{
$ret = [];
foreach ($choices as $item) {
$ret[] = $item->getEmail();
$ret[] = $item->getUsername();
}
return $ret;
} | [
"public",
"function",
"getChoicesAsSeparateEmailUsername",
"(",
"array",
"&",
"$",
"choices",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"choices",
"as",
"$",
"item",
")",
"{",
"$",
"ret",
"[",
"]",
"=",
"$",
"item",
"->",
"getEma... | User choices is separate usernames/email for autocomplete
@param User[] $choices
@return string[] | [
"User",
"choices",
"is",
"separate",
"usernames",
"/",
"email",
"for",
"autocomplete"
] | train | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/User/UserEditService.php#L111-L120 |
webtown-php/KunstmaanExtensionBundle | src/User/UserEditService.php | UserEditService.updateUser | public function updateUser(User $user, UserUpdater $up)
{
$up->updateUser($user, $this->getEncoder());
$em = $this->getRegistry()->getManager();
$em->persist($user);
$em->flush();
} | php | public function updateUser(User $user, UserUpdater $up)
{
$up->updateUser($user, $this->getEncoder());
$em = $this->getRegistry()->getManager();
$em->persist($user);
$em->flush();
} | [
"public",
"function",
"updateUser",
"(",
"User",
"$",
"user",
",",
"UserUpdater",
"$",
"up",
")",
"{",
"$",
"up",
"->",
"updateUser",
"(",
"$",
"user",
",",
"$",
"this",
"->",
"getEncoder",
"(",
")",
")",
";",
"$",
"em",
"=",
"$",
"this",
"->",
"... | Update user details
@param User $user
@param UserUpdater $up | [
"Update",
"user",
"details"
] | train | https://github.com/webtown-php/KunstmaanExtensionBundle/blob/86c656c131295fe1f3f7694fd4da1e5e454076b9/src/User/UserEditService.php#L128-L134 |
djgadd/themosis-illuminate | src/Filesystem/FilesystemServiceProvider.php | FilesystemServiceProvider.registerFlysystem | protected function registerFlysystem()
{
$this->registerManager();
$this->app->singleton('filesystem.disk', function ($app) {
return $app['filesystem']->disk($this->getDefaultDriver());
});
} | php | protected function registerFlysystem()
{
$this->registerManager();
$this->app->singleton('filesystem.disk', function ($app) {
return $app['filesystem']->disk($this->getDefaultDriver());
});
} | [
"protected",
"function",
"registerFlysystem",
"(",
")",
"{",
"$",
"this",
"->",
"registerManager",
"(",
")",
";",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'filesystem.disk'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"$",
"app",
"["... | Register the driver based filesystem.
@return void | [
"Register",
"the",
"driver",
"based",
"filesystem",
"."
] | train | https://github.com/djgadd/themosis-illuminate/blob/13ee4c3413cddd85a2f262ac361f35c81da0c53c/src/Filesystem/FilesystemServiceProvider.php#L39-L46 |
iocaste/microservice-foundation | src/Command/PostUpdate.php | PostUpdate.handle | public function handle()
{
$consoleKernel = app(\Illuminate\Contracts\Console\Kernel::class);
$consoleKernel->call('laradox:transform');
if (app()->environment() !== 'production') {
$consoleKernel->call('ide-helper:generate');
$consoleKernel->call('ide-helper:models... | php | public function handle()
{
$consoleKernel = app(\Illuminate\Contracts\Console\Kernel::class);
$consoleKernel->call('laradox:transform');
if (app()->environment() !== 'production') {
$consoleKernel->call('ide-helper:generate');
$consoleKernel->call('ide-helper:models... | [
"public",
"function",
"handle",
"(",
")",
"{",
"$",
"consoleKernel",
"=",
"app",
"(",
"\\",
"Illuminate",
"\\",
"Contracts",
"\\",
"Console",
"\\",
"Kernel",
"::",
"class",
")",
";",
"$",
"consoleKernel",
"->",
"call",
"(",
"'laradox:transform'",
")",
";",... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/iocaste/microservice-foundation/blob/274a154de4299e8a57314bab972e09f6d8cdae9e/src/Command/PostUpdate.php#L29-L44 |
Double-Opt-in/php-client-api | src/Guzzle/Plugin/AccessTokenCache.php | AccessTokenCache.get | public function get()
{
if ( ! file_exists($this->file))
return array();
$data = unserialize(base64_decode(file_get_contents($this->file)));
return $data ?: array();
} | php | public function get()
{
if ( ! file_exists($this->file))
return array();
$data = unserialize(base64_decode(file_get_contents($this->file)));
return $data ?: array();
} | [
"public",
"function",
"get",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"file",
")",
")",
"return",
"array",
"(",
")",
";",
"$",
"data",
"=",
"unserialize",
"(",
"base64_decode",
"(",
"file_get_contents",
"(",
"$",
"this",
... | returns the cached access token
@return array | [
"returns",
"the",
"cached",
"access",
"token"
] | train | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Guzzle/Plugin/AccessTokenCache.php#L32-L40 |
Double-Opt-in/php-client-api | src/Guzzle/Plugin/AccessTokenCache.php | AccessTokenCache.put | public function put($accessToken)
{
if ($accessToken === null)
return unlink($this->file);
file_put_contents($this->file, base64_encode(serialize($accessToken)));
return file_exists($this->file);
} | php | public function put($accessToken)
{
if ($accessToken === null)
return unlink($this->file);
file_put_contents($this->file, base64_encode(serialize($accessToken)));
return file_exists($this->file);
} | [
"public",
"function",
"put",
"(",
"$",
"accessToken",
")",
"{",
"if",
"(",
"$",
"accessToken",
"===",
"null",
")",
"return",
"unlink",
"(",
"$",
"this",
"->",
"file",
")",
";",
"file_put_contents",
"(",
"$",
"this",
"->",
"file",
",",
"base64_encode",
... | store the access token
@param array $accessToken
@return bool | [
"store",
"the",
"access",
"token"
] | train | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Guzzle/Plugin/AccessTokenCache.php#L49-L57 |
ClanCats/Core | src/bundles/Database/Model.php | Model._prepare | protected static function _prepare( $settings, $class )
{
$settings = parent::_prepare( $settings, $class );
// Next step the table name. If not set we use the
// class name appending an 's' in the hope that it
// makes sense like Model_User = users
if ( property_exists( $class, '_table') )
{
$setti... | php | protected static function _prepare( $settings, $class )
{
$settings = parent::_prepare( $settings, $class );
// Next step the table name. If not set we use the
// class name appending an 's' in the hope that it
// makes sense like Model_User = users
if ( property_exists( $class, '_table') )
{
$setti... | [
"protected",
"static",
"function",
"_prepare",
"(",
"$",
"settings",
",",
"$",
"class",
")",
"{",
"$",
"settings",
"=",
"parent",
"::",
"_prepare",
"(",
"$",
"settings",
",",
"$",
"class",
")",
";",
"// Next step the table name. If not set we use the ",
"// clas... | Prepare the model
@param string $settings The model properties
@param string $class The class name.
@return array | [
"Prepare",
"the",
"model"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L41-L118 |
ClanCats/Core | src/bundles/Database/Model.php | Model._fetch_handler | public static function _fetch_handler( &$query )
{
// because the model is an object we force the fetch
// arguments to obj so that we can still make use of
// the group by and forward key functions
$query->fetch_arguments = array( 'obj' );
// Run the query and assign the reults
// here we force the fetch... | php | public static function _fetch_handler( &$query )
{
// because the model is an object we force the fetch
// arguments to obj so that we can still make use of
// the group by and forward key functions
$query->fetch_arguments = array( 'obj' );
// Run the query and assign the reults
// here we force the fetch... | [
"public",
"static",
"function",
"_fetch_handler",
"(",
"&",
"$",
"query",
")",
"{",
"// because the model is an object we force the fetch",
"// arguments to obj so that we can still make use of",
"// the group by and forward key functions",
"$",
"query",
"->",
"fetch_arguments",
"=... | Fetch from the databse and created models out of the reults
@param DB\Query_Select $query
@return array | [
"Fetch",
"from",
"the",
"databse",
"and",
"created",
"models",
"out",
"of",
"the",
"reults"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L126-L137 |
ClanCats/Core | src/bundles/Database/Model.php | Model.find | public static function find( $param = null, $param2 = null )
{
$settings = static::_model();
$query = DB::select( $settings['table'] );
// Do we have a find modifier?
if ( !is_null( $settings['find_modifier'] ) )
{
$callbacks = $settings['find_modifier'];
if ( !\CCArr::is_collection( $callbacks ) ... | php | public static function find( $param = null, $param2 = null )
{
$settings = static::_model();
$query = DB::select( $settings['table'] );
// Do we have a find modifier?
if ( !is_null( $settings['find_modifier'] ) )
{
$callbacks = $settings['find_modifier'];
if ( !\CCArr::is_collection( $callbacks ) ... | [
"public",
"static",
"function",
"find",
"(",
"$",
"param",
"=",
"null",
",",
"$",
"param2",
"=",
"null",
")",
"{",
"$",
"settings",
"=",
"static",
"::",
"_model",
"(",
")",
";",
"$",
"query",
"=",
"DB",
"::",
"select",
"(",
"$",
"settings",
"[",
... | Model finder
This function allows you direct access to your records.
@param mixed $param
@param mixed $param2
@return CCModel | [
"Model",
"finder",
"This",
"function",
"allows",
"you",
"direct",
"access",
"to",
"your",
"records",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Database/Model.php#L157-L219 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.