id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
230,900 | DevGroup-ru/yii2-jstree-widget | src/actions/nestedset/NodeMoveAction.php | NodeMoveAction.getCount | protected function getCount($condition)
{
$class = $this->className;
return $class::find()
->select(['id', $this->leftAttribute, $this->rightAttribute, $this->rootAttribute])
->where($condition)
->count();
} | php | protected function getCount($condition)
{
$class = $this->className;
return $class::find()
->select(['id', $this->leftAttribute, $this->rightAttribute, $this->rootAttribute])
->where($condition)
->count();
} | [
"protected",
"function",
"getCount",
"(",
"$",
"condition",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"className",
";",
"return",
"$",
"class",
"::",
"find",
"(",
")",
"->",
"select",
"(",
"[",
"'id'",
",",
"$",
"this",
"->",
"leftAttribute",
"... | Returns count of records to be modified while reordering
@param array $condition
@return int|string | [
"Returns",
"count",
"of",
"records",
"to",
"be",
"modified",
"while",
"reordering"
] | 6ae0311254eb757a13fc5c318d6a15544d84b105 | https://github.com/DevGroup-ru/yii2-jstree-widget/blob/6ae0311254eb757a13fc5c318d6a15544d84b105/src/actions/nestedset/NodeMoveAction.php#L496-L503 |
230,901 | DevGroup-ru/yii2-jstree-widget | src/actions/nestedset/NodeMoveAction.php | NodeMoveAction.applyRootCondition | protected function applyRootCondition(&$condition)
{
if (false !== $this->rootAttribute) {
$condition[] = [$this->rootAttribute => $this->node->{$this->rootAttribute}];
}
} | php | protected function applyRootCondition(&$condition)
{
if (false !== $this->rootAttribute) {
$condition[] = [$this->rootAttribute => $this->node->{$this->rootAttribute}];
}
} | [
"protected",
"function",
"applyRootCondition",
"(",
"&",
"$",
"condition",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"rootAttribute",
")",
"{",
"$",
"condition",
"[",
"]",
"=",
"[",
"$",
"this",
"->",
"rootAttribute",
"=>",
"$",
"this",
"... | Applies tree root condition if multi root
@param $condition | [
"Applies",
"tree",
"root",
"condition",
"if",
"multi",
"root"
] | 6ae0311254eb757a13fc5c318d6a15544d84b105 | https://github.com/DevGroup-ru/yii2-jstree-widget/blob/6ae0311254eb757a13fc5c318d6a15544d84b105/src/actions/nestedset/NodeMoveAction.php#L526-L531 |
230,902 | jpunanua/yii2-seotools | Component.php | Component.getRoute | public function getRoute() {
if (is_null($this->route)) {
$this->route = Yii::$app->request->getHostInfo() . '/' . Yii::$app->request->getPathInfo();
}
return $this->route;
} | php | public function getRoute() {
if (is_null($this->route)) {
$this->route = Yii::$app->request->getHostInfo() . '/' . Yii::$app->request->getPathInfo();
}
return $this->route;
} | [
"public",
"function",
"getRoute",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"route",
")",
")",
"{",
"$",
"this",
"->",
"route",
"=",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"getHostInfo",
"(",
")",
".",
"'/'",
".",
"Yii... | Devuelve la url absoluta con el path
@return string | [
"Devuelve",
"la",
"url",
"absoluta",
"con",
"el",
"path"
] | 076c18a9ddad2db795fd2248009d9f1db1cf6033 | https://github.com/jpunanua/yii2-seotools/blob/076c18a9ddad2db795fd2248009d9f1db1cf6033/Component.php#L68-L73 |
230,903 | jpunanua/yii2-seotools | Component.php | Component.setAuthor | public function setAuthor($author)
{
if (!empty($author)) {
Yii::$app->view->registerMetaTag(['name' => 'author', 'content' => $author], 'author');
}
return $this;
} | php | public function setAuthor($author)
{
if (!empty($author)) {
Yii::$app->view->registerMetaTag(['name' => 'author', 'content' => $author], 'author');
}
return $this;
} | [
"public",
"function",
"setAuthor",
"(",
"$",
"author",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"author",
")",
")",
"{",
"Yii",
"::",
"$",
"app",
"->",
"view",
"->",
"registerMetaTag",
"(",
"[",
"'name'",
"=>",
"'author'",
",",
"'content'",
"=>",... | Register the author meta
@param string $author | [
"Register",
"the",
"author",
"meta"
] | 076c18a9ddad2db795fd2248009d9f1db1cf6033 | https://github.com/jpunanua/yii2-seotools/blob/076c18a9ddad2db795fd2248009d9f1db1cf6033/Component.php#L147-L153 |
230,904 | jpunanua/yii2-seotools | Component.php | Component.setOpenGraphType | public function setOpenGraphType($type)
{
if (!empty($type)) {
Yii::$app->view->registerMetaTag(['name' => 'og:type', 'content' => $type], 'og:type');
}
return $this;
} | php | public function setOpenGraphType($type)
{
if (!empty($type)) {
Yii::$app->view->registerMetaTag(['name' => 'og:type', 'content' => $type], 'og:type');
}
return $this;
} | [
"public",
"function",
"setOpenGraphType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"type",
")",
")",
"{",
"Yii",
"::",
"$",
"app",
"->",
"view",
"->",
"registerMetaTag",
"(",
"[",
"'name'",
"=>",
"'og:type'",
",",
"'content'",
"... | Register Open Graph Type meta
@param string $type | [
"Register",
"Open",
"Graph",
"Type",
"meta"
] | 076c18a9ddad2db795fd2248009d9f1db1cf6033 | https://github.com/jpunanua/yii2-seotools/blob/076c18a9ddad2db795fd2248009d9f1db1cf6033/Component.php#L159-L165 |
230,905 | jpunanua/yii2-seotools | Component.php | Component.setTitle | public function setTitle($title)
{
if (!empty($title)) {
Yii::$app->view->registerMetaTag(['name' => 'title', 'content' => $title], 'title');
Yii::$app->view->registerMetaTag(['name' => 'og:title', 'content' => $title], 'og:title');
Yii::$app->view->title = $title;
... | php | public function setTitle($title)
{
if (!empty($title)) {
Yii::$app->view->registerMetaTag(['name' => 'title', 'content' => $title], 'title');
Yii::$app->view->registerMetaTag(['name' => 'og:title', 'content' => $title], 'og:title');
Yii::$app->view->title = $title;
... | [
"public",
"function",
"setTitle",
"(",
"$",
"title",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"title",
")",
")",
"{",
"Yii",
"::",
"$",
"app",
"->",
"view",
"->",
"registerMetaTag",
"(",
"[",
"'name'",
"=>",
"'title'",
",",
"'content'",
"=>",
"... | Register title meta and open graph title meta
@param string $title | [
"Register",
"title",
"meta",
"and",
"open",
"graph",
"title",
"meta"
] | 076c18a9ddad2db795fd2248009d9f1db1cf6033 | https://github.com/jpunanua/yii2-seotools/blob/076c18a9ddad2db795fd2248009d9f1db1cf6033/Component.php#L171-L179 |
230,906 | jpunanua/yii2-seotools | Component.php | Component.setDescription | public function setDescription($description)
{
if (!empty($description)) {
Yii::$app->view->registerMetaTag(['name' => 'description', 'content' => $description], 'description');
Yii::$app->view->registerMetaTag(['name' => 'og:description', 'content' => $description], 'og:description'... | php | public function setDescription($description)
{
if (!empty($description)) {
Yii::$app->view->registerMetaTag(['name' => 'description', 'content' => $description], 'description');
Yii::$app->view->registerMetaTag(['name' => 'og:description', 'content' => $description], 'og:description'... | [
"public",
"function",
"setDescription",
"(",
"$",
"description",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"description",
")",
")",
"{",
"Yii",
"::",
"$",
"app",
"->",
"view",
"->",
"registerMetaTag",
"(",
"[",
"'name'",
"=>",
"'description'",
",",
... | Register description meta and open graph description meta
@param string $description | [
"Register",
"description",
"meta",
"and",
"open",
"graph",
"description",
"meta"
] | 076c18a9ddad2db795fd2248009d9f1db1cf6033 | https://github.com/jpunanua/yii2-seotools/blob/076c18a9ddad2db795fd2248009d9f1db1cf6033/Component.php#L185-L192 |
230,907 | jpunanua/yii2-seotools | Component.php | Component.setKeywords | public function setKeywords($keywords)
{
if (!empty($keywords)) {
Yii::$app->view->registerMetaTag(['name' => 'keywords', 'content' => $keywords], 'keywords');
}
return $this;
} | php | public function setKeywords($keywords)
{
if (!empty($keywords)) {
Yii::$app->view->registerMetaTag(['name' => 'keywords', 'content' => $keywords], 'keywords');
}
return $this;
} | [
"public",
"function",
"setKeywords",
"(",
"$",
"keywords",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"keywords",
")",
")",
"{",
"Yii",
"::",
"$",
"app",
"->",
"view",
"->",
"registerMetaTag",
"(",
"[",
"'name'",
"=>",
"'keywords'",
",",
"'content'",... | Register keywords meta
@param string $keywords | [
"Register",
"keywords",
"meta"
] | 076c18a9ddad2db795fd2248009d9f1db1cf6033 | https://github.com/jpunanua/yii2-seotools/blob/076c18a9ddad2db795fd2248009d9f1db1cf6033/Component.php#L198-L204 |
230,908 | cygnite/framework | src/Cygnite/Console/Command/MigrationCommand.php | MigrationCommand.process | public function process()
{
// Migrate init - to create migration table
$type = $this->argument('type');
$migration = Migrator::instance($this);
$migration->getLatestMigration()
->setMigrationClassName();
if ($type == '' || $type == 'up') {
$mi... | php | public function process()
{
// Migrate init - to create migration table
$type = $this->argument('type');
$migration = Migrator::instance($this);
$migration->getLatestMigration()
->setMigrationClassName();
if ($type == '' || $type == 'up') {
$mi... | [
"public",
"function",
"process",
"(",
")",
"{",
"// Migrate init - to create migration table",
"$",
"type",
"=",
"$",
"this",
"->",
"argument",
"(",
"'type'",
")",
";",
"$",
"migration",
"=",
"Migrator",
"::",
"instance",
"(",
"$",
"this",
")",
";",
"$",
"... | Execute Command To Run Migration.
@return mixed|void | [
"Execute",
"Command",
"To",
"Run",
"Migration",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Console/Command/MigrationCommand.php#L83-L99 |
230,909 | cygnite/framework | src/Cygnite/Console/Command/ControllerGeneratorCommand.php | ControllerGeneratorCommand.process | public function process()
{
// Your controller name
$this->controller = Inflector::classify($this->argument('name')).'Controller';
// By default we will generate basic controller, if resource set then we will generate
// REST-ful Resource controller
$this->setControllerType(... | php | public function process()
{
// Your controller name
$this->controller = Inflector::classify($this->argument('name')).'Controller';
// By default we will generate basic controller, if resource set then we will generate
// REST-ful Resource controller
$this->setControllerType(... | [
"public",
"function",
"process",
"(",
")",
"{",
"// Your controller name",
"$",
"this",
"->",
"controller",
"=",
"Inflector",
"::",
"classify",
"(",
"$",
"this",
"->",
"argument",
"(",
"'name'",
")",
")",
".",
"'Controller'",
";",
"// By default we will generate... | We will execute the controller command and generate classes.
@throws \Exception
@return mixed|void | [
"We",
"will",
"execute",
"the",
"controller",
"command",
"and",
"generate",
"classes",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Console/Command/ControllerGeneratorCommand.php#L87-L103 |
230,910 | johnstevenson/winbox-args | src/Args.php | Args.escapeCommand | public static function escapeCommand(array $args, $meta = true)
{
$cmd = self::escape(array_shift($args), $meta, true);
foreach ($args as $arg) {
$cmd .= ' '.self::escape($arg, $meta);
}
return $cmd;
} | php | public static function escapeCommand(array $args, $meta = true)
{
$cmd = self::escape(array_shift($args), $meta, true);
foreach ($args as $arg) {
$cmd .= ' '.self::escape($arg, $meta);
}
return $cmd;
} | [
"public",
"static",
"function",
"escapeCommand",
"(",
"array",
"$",
"args",
",",
"$",
"meta",
"=",
"true",
")",
"{",
"$",
"cmd",
"=",
"self",
"::",
"escape",
"(",
"array_shift",
"(",
"$",
"args",
")",
",",
"$",
"meta",
",",
"true",
")",
";",
"forea... | Escapes an array of arguments that make up a shell command
The first argument must be the module (executable) to be invoked.
@param array $args A list of arguments, with the module name first
@param bool $meta Additionally escape cmd.exe meta characters
@return string The escaped command line | [
"Escapes",
"an",
"array",
"of",
"arguments",
"that",
"make",
"up",
"a",
"shell",
"command"
] | e46a6a190e99d07933175319c112d2f5c10cc2b5 | https://github.com/johnstevenson/winbox-args/blob/e46a6a190e99d07933175319c112d2f5c10cc2b5/src/Args.php#L85-L93 |
230,911 | cygnite/framework | src/Cygnite/Cache/Storage/Redis.php | Redis.get | public function get($key)
{
$data = $this->connection()->get($this->prefix.$key);
if (!is_null($data)) {
return (is_numeric($data)) ? $data : unserialize($data);
}
} | php | public function get($key)
{
$data = $this->connection()->get($this->prefix.$key);
if (!is_null($data)) {
return (is_numeric($data)) ? $data : unserialize($data);
}
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"connection",
"(",
")",
"->",
"get",
"(",
"$",
"this",
"->",
"prefix",
".",
"$",
"key",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"data",
")",
"... | Get the item from redis memory.
@param $key
@return int|mixed|null|string | [
"Get",
"the",
"item",
"from",
"redis",
"memory",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Cache/Storage/Redis.php#L102-L109 |
230,912 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_compile_shared_inheritance.php | Smarty_Internal_Compile_Shared_Inheritance.registerInit | public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
{
if ($initChildSequence || !isset($compiler->_cache['inheritanceInit'])) {
$compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'),
... | php | public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
{
if ($initChildSequence || !isset($compiler->_cache['inheritanceInit'])) {
$compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'),
... | [
"public",
"function",
"registerInit",
"(",
"Smarty_Internal_TemplateCompilerBase",
"$",
"compiler",
",",
"$",
"initChildSequence",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"initChildSequence",
"||",
"!",
"isset",
"(",
"$",
"compiler",
"->",
"_cache",
"[",
"'inher... | Register post compile callback to compile inheritance initialization code
@param \Smarty_Internal_TemplateCompilerBase $compiler
@param bool|false $initChildSequence if true force child template | [
"Register",
"post",
"compile",
"callback",
"to",
"compile",
"inheritance",
"initialization",
"code"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_compile_shared_inheritance.php#L25-L33 |
230,913 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_compile_shared_inheritance.php | Smarty_Internal_Compile_Shared_Inheritance.postCompile | static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
{
$compiler->prefixCompiledCode .= "<?php \$_smarty_tpl->ext->_inheritance->init(\$_smarty_tpl, " .
var_export($initChildSequence, true) . ");\n?>\n";
} | php | static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
{
$compiler->prefixCompiledCode .= "<?php \$_smarty_tpl->ext->_inheritance->init(\$_smarty_tpl, " .
var_export($initChildSequence, true) . ");\n?>\n";
} | [
"static",
"function",
"postCompile",
"(",
"Smarty_Internal_TemplateCompilerBase",
"$",
"compiler",
",",
"$",
"initChildSequence",
"=",
"false",
")",
"{",
"$",
"compiler",
"->",
"prefixCompiledCode",
".=",
"\"<?php \\$_smarty_tpl->ext->_inheritance->init(\\$_smarty_tpl, \"",
"... | Compile inheritance initialization code as prefix
@param \Smarty_Internal_TemplateCompilerBase $compiler
@param bool|false $initChildSequence if true force child template | [
"Compile",
"inheritance",
"initialization",
"code",
"as",
"prefix"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_compile_shared_inheritance.php#L41-L45 |
230,914 | inetprocess/libsugarcrm | src/Installer.php | Installer.deletePath | public function deletePath()
{
$this->getLogger()->info("Removing installation path {$this->getPath()}...");
$this->fs->remove($this->getPath());
$this->getLogger()->info("Path {$this->getPath()} was successfully removed.");
} | php | public function deletePath()
{
$this->getLogger()->info("Removing installation path {$this->getPath()}...");
$this->fs->remove($this->getPath());
$this->getLogger()->info("Path {$this->getPath()} was successfully removed.");
} | [
"public",
"function",
"deletePath",
"(",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"\"Removing installation path {$this->getPath()}...\"",
")",
";",
"$",
"this",
"->",
"fs",
"->",
"remove",
"(",
"$",
"this",
"->",
"getPath",
"(",... | Remove sugar installation path | [
"Remove",
"sugar",
"installation",
"path"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Installer.php#L66-L71 |
230,915 | inetprocess/libsugarcrm | src/Installer.php | Installer.runSugarInstaller | public function runSugarInstaller()
{
$installer_res = $this->runSubProcessInstaller();
// find the bottle message
if (preg_match('/<bottle>(.*)<\/bottle>/s', $installer_res, $msg) === 1) {
$this->getLogger()->info('The web installer was successfully completed.');
$th... | php | public function runSugarInstaller()
{
$installer_res = $this->runSubProcessInstaller();
// find the bottle message
if (preg_match('/<bottle>(.*)<\/bottle>/s', $installer_res, $msg) === 1) {
$this->getLogger()->info('The web installer was successfully completed.');
$th... | [
"public",
"function",
"runSugarInstaller",
"(",
")",
"{",
"$",
"installer_res",
"=",
"$",
"this",
"->",
"runSubProcessInstaller",
"(",
")",
";",
"// find the bottle message",
"if",
"(",
"preg_match",
"(",
"'/<bottle>(.*)<\\/bottle>/s'",
",",
"$",
"installer_res",
",... | Run the sugar install script. This doesn't require a web server. | [
"Run",
"the",
"sugar",
"install",
"script",
".",
"This",
"doesn",
"t",
"require",
"a",
"web",
"server",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Installer.php#L189-L207 |
230,916 | inetprocess/libsugarcrm | src/Installer.php | Installer.run | public function run($force = false)
{
if (!is_readable($this->config)) {
throw new InstallerException("Missing or unreadable config_si file {$this->config}.");
}
$this->getLogger()->notice("Installing SugarCRM into {$this->getPath()}...");
if ($this->fs->exists($this->get... | php | public function run($force = false)
{
if (!is_readable($this->config)) {
throw new InstallerException("Missing or unreadable config_si file {$this->config}.");
}
$this->getLogger()->notice("Installing SugarCRM into {$this->getPath()}...");
if ($this->fs->exists($this->get... | [
"public",
"function",
"run",
"(",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"this",
"->",
"config",
")",
")",
"{",
"throw",
"new",
"InstallerException",
"(",
"\"Missing or unreadable config_si file {$this->config}.\"",
")",
... | Run the complete installation process.
@param force If true then remove install directory first. | [
"Run",
"the",
"complete",
"installation",
"process",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Installer.php#L214-L241 |
230,917 | ARCANEDEV/GeoIP | src/Cache.php | Cache.store | private function store()
{
return empty($this->tags) ? $this->store : $this->store->tags($this->tags);
} | php | private function store()
{
return empty($this->tags) ? $this->store : $this->store->tags($this->tags);
} | [
"private",
"function",
"store",
"(",
")",
"{",
"return",
"empty",
"(",
"$",
"this",
"->",
"tags",
")",
"?",
"$",
"this",
"->",
"store",
":",
"$",
"this",
"->",
"store",
"->",
"tags",
"(",
"$",
"this",
"->",
"tags",
")",
";",
"}"
] | Get the store instance.
@return \Illuminate\Contracts\Cache\Repository | [
"Get",
"the",
"store",
"instance",
"."
] | 2b7b5590cbbbb99e9d1a3a2c85ce9e39dd39b318 | https://github.com/ARCANEDEV/GeoIP/blob/2b7b5590cbbbb99e9d1a3a2c85ce9e39dd39b318/src/Cache.php#L57-L60 |
230,918 | ARCANEDEV/GeoIP | src/Cache.php | Cache.set | public function set($key, array $location)
{
$this->store()->put($key, $location, $this->expires);
} | php | public function set($key, array $location)
{
$this->store()->put($key, $location, $this->expires);
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"array",
"$",
"location",
")",
"{",
"$",
"this",
"->",
"store",
"(",
")",
"->",
"put",
"(",
"$",
"key",
",",
"$",
"location",
",",
"$",
"this",
"->",
"expires",
")",
";",
"}"
] | Set an item in cache.
@param string $key
@param array $location | [
"Set",
"an",
"item",
"in",
"cache",
"."
] | 2b7b5590cbbbb99e9d1a3a2c85ce9e39dd39b318 | https://github.com/ARCANEDEV/GeoIP/blob/2b7b5590cbbbb99e9d1a3a2c85ce9e39dd39b318/src/Cache.php#L85-L88 |
230,919 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_method_configload.php | Smarty_Internal_Method_ConfigLoad._loadConfigVars | public function _loadConfigVars(Smarty_Internal_Template $tpl, $_config_vars)
{
$this->_assignConfigVars($tpl->parent, $tpl, $_config_vars);
$scope = $tpl->source->scope;
if (!$scope && !$tpl->scope) {
return;
}
foreach (array($scope, $tpl->scope) as $s) {
... | php | public function _loadConfigVars(Smarty_Internal_Template $tpl, $_config_vars)
{
$this->_assignConfigVars($tpl->parent, $tpl, $_config_vars);
$scope = $tpl->source->scope;
if (!$scope && !$tpl->scope) {
return;
}
foreach (array($scope, $tpl->scope) as $s) {
... | [
"public",
"function",
"_loadConfigVars",
"(",
"Smarty_Internal_Template",
"$",
"tpl",
",",
"$",
"_config_vars",
")",
"{",
"$",
"this",
"->",
"_assignConfigVars",
"(",
"$",
"tpl",
"->",
"parent",
",",
"$",
"tpl",
",",
"$",
"_config_vars",
")",
";",
"$",
"sc... | load config variables into template object
@param \Smarty_Internal_Template $tpl
@param array $_config_vars | [
"load",
"config",
"variables",
"into",
"template",
"object"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_method_configload.php#L82-L118 |
230,920 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_method_configload.php | Smarty_Internal_Method_ConfigLoad._assignConfigVars | public function _assignConfigVars(Smarty_Internal_Data $scope_ptr, Smarty_Internal_Template $tpl, $_config_vars)
{
// copy global config vars
foreach ($_config_vars['vars'] as $variable => $value) {
if ($tpl->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
... | php | public function _assignConfigVars(Smarty_Internal_Data $scope_ptr, Smarty_Internal_Template $tpl, $_config_vars)
{
// copy global config vars
foreach ($_config_vars['vars'] as $variable => $value) {
if ($tpl->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
... | [
"public",
"function",
"_assignConfigVars",
"(",
"Smarty_Internal_Data",
"$",
"scope_ptr",
",",
"Smarty_Internal_Template",
"$",
"tpl",
",",
"$",
"_config_vars",
")",
"{",
"// copy global config vars",
"foreach",
"(",
"$",
"_config_vars",
"[",
"'vars'",
"]",
"as",
"$... | Assign all config variables in given scope
@param \Smarty_Internal_Data $scope_ptr
@param \Smarty_Internal_Template $tpl
@param array $_config_vars | [
"Assign",
"all",
"config",
"variables",
"in",
"given",
"scope"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_method_configload.php#L127-L154 |
230,921 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_method_configload.php | Smarty_Internal_Method_ConfigLoad._getConfigVariable | public function _getConfigVariable(Smarty_Internal_Template $tpl, $varName, $errorEnable = true)
{
$_ptr = $tpl;
while ($_ptr !== null) {
if (isset($_ptr->config_vars[$varName])) {
// found it, return it
return $_ptr->config_vars[$varName];
}
... | php | public function _getConfigVariable(Smarty_Internal_Template $tpl, $varName, $errorEnable = true)
{
$_ptr = $tpl;
while ($_ptr !== null) {
if (isset($_ptr->config_vars[$varName])) {
// found it, return it
return $_ptr->config_vars[$varName];
}
... | [
"public",
"function",
"_getConfigVariable",
"(",
"Smarty_Internal_Template",
"$",
"tpl",
",",
"$",
"varName",
",",
"$",
"errorEnable",
"=",
"true",
")",
"{",
"$",
"_ptr",
"=",
"$",
"tpl",
";",
"while",
"(",
"$",
"_ptr",
"!==",
"null",
")",
"{",
"if",
"... | gets a config variable value
@param \Smarty_Internal_Template $tpl template object
@param string $varName the name of the config variable
@param bool $errorEnable
@return mixed the value of the config variable | [
"gets",
"a",
"config",
"variable",
"value"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_method_configload.php#L165-L181 |
230,922 | jpunanua/yii2-seotools | controllers/ManageController.php | ManageController.actionCreate | public function actionCreate()
{
$model = new Meta();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_meta]);
} else {
return $this->render('create', [
'model' => $model,
... | php | public function actionCreate()
{
$model = new Meta();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_meta]);
} else {
return $this->render('create', [
'model' => $model,
... | [
"public",
"function",
"actionCreate",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"Meta",
"(",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post",
"(",
")",
")",
"&&",
"$",
"model",
"->",
"... | Creates a new MetaBase model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed | [
"Creates",
"a",
"new",
"MetaBase",
"model",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 076c18a9ddad2db795fd2248009d9f1db1cf6033 | https://github.com/jpunanua/yii2-seotools/blob/076c18a9ddad2db795fd2248009d9f1db1cf6033/controllers/ManageController.php#L80-L91 |
230,923 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.on | public function on($connection)
{
$this->setDatabase($connection);
$this->_connection = null;
$this->setDatabaseConnection($this->getDatabase());
return $this;
} | php | public function on($connection)
{
$this->setDatabase($connection);
$this->_connection = null;
$this->setDatabaseConnection($this->getDatabase());
return $this;
} | [
"public",
"function",
"on",
"(",
"$",
"connection",
")",
"{",
"$",
"this",
"->",
"setDatabase",
"(",
"$",
"connection",
")",
";",
"$",
"this",
"->",
"_connection",
"=",
"null",
";",
"$",
"this",
"->",
"setDatabaseConnection",
"(",
"$",
"this",
"->",
"g... | Set the connection object.
@param $connection
@return $this | [
"Set",
"the",
"connection",
"object",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L112-L120 |
230,924 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.make | public static function make($table, Closure $closure)
{
if (is_array($table)) {
$table = isset($table['table']) ? $table['table'] : $table;
$database = isset($table['database']) ? $table['database'] : null;
$schema = new static($table, $database);
} else {
... | php | public static function make($table, Closure $closure)
{
if (is_array($table)) {
$table = isset($table['table']) ? $table['table'] : $table;
$database = isset($table['database']) ? $table['database'] : null;
$schema = new static($table, $database);
} else {
... | [
"public",
"static",
"function",
"make",
"(",
"$",
"table",
",",
"Closure",
"$",
"closure",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"table",
")",
")",
"{",
"$",
"table",
"=",
"isset",
"(",
"$",
"table",
"[",
"'table'",
"]",
")",
"?",
"$",
"tabl... | Create database schema and return the schema instance.
@param $table
@param callable $closure
@return mixed | [
"Create",
"database",
"schema",
"and",
"return",
"the",
"schema",
"instance",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L168-L186 |
230,925 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.drop | public function drop($table = '')
{
$tableName = '';
$tableName = ($table !== '') ?
$table : $this->tableName;
$this->schema = strtoupper(__FUNCTION__).' TABLE IF EXISTS
`'.$this->database.'`.`'.$tableName.'`'.PHP_EOL;
return $this;
} | php | public function drop($table = '')
{
$tableName = '';
$tableName = ($table !== '') ?
$table : $this->tableName;
$this->schema = strtoupper(__FUNCTION__).' TABLE IF EXISTS
`'.$this->database.'`.`'.$tableName.'`'.PHP_EOL;
return $this;
} | [
"public",
"function",
"drop",
"(",
"$",
"table",
"=",
"''",
")",
"{",
"$",
"tableName",
"=",
"''",
";",
"$",
"tableName",
"=",
"(",
"$",
"table",
"!==",
"''",
")",
"?",
"$",
"table",
":",
"$",
"this",
"->",
"tableName",
";",
"$",
"this",
"->",
... | Drop table if exists.
@param string $table
@return $this | [
"Drop",
"table",
"if",
"exists",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L315-L326 |
230,926 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.rename | public function rename($tableNames = [])
{
$schema = '';
$schema .= strtoupper(__FUNCTION__).' TABLE '.PHP_EOL;
if (is_array($tableNames)) {
$i = 0;
$arrCount = count($tableNames);
foreach ($tableNames as $key => $value) {
$schema .= '`... | php | public function rename($tableNames = [])
{
$schema = '';
$schema .= strtoupper(__FUNCTION__).' TABLE '.PHP_EOL;
if (is_array($tableNames)) {
$i = 0;
$arrCount = count($tableNames);
foreach ($tableNames as $key => $value) {
$schema .= '`... | [
"public",
"function",
"rename",
"(",
"$",
"tableNames",
"=",
"[",
"]",
")",
"{",
"$",
"schema",
"=",
"''",
";",
"$",
"schema",
".=",
"strtoupper",
"(",
"__FUNCTION__",
")",
".",
"' TABLE '",
".",
"PHP_EOL",
";",
"if",
"(",
"is_array",
"(",
"$",
"tabl... | Rename the database table.
@param array|string $tableNames
@return this pointer | [
"Rename",
"the",
"database",
"table",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L335-L360 |
230,927 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.hasTable | public function hasTable($table = '')
{
$tableName = '';
$tableName = ($table !== '') ?
$table : $this->tableName;
$this->schema = "SHOW TABLES LIKE '".$tableName."'";
$this->checkSchemaExistence = true;
return $this;
} | php | public function hasTable($table = '')
{
$tableName = '';
$tableName = ($table !== '') ?
$table : $this->tableName;
$this->schema = "SHOW TABLES LIKE '".$tableName."'";
$this->checkSchemaExistence = true;
return $this;
} | [
"public",
"function",
"hasTable",
"(",
"$",
"table",
"=",
"''",
")",
"{",
"$",
"tableName",
"=",
"''",
";",
"$",
"tableName",
"=",
"(",
"$",
"table",
"!==",
"''",
")",
"?",
"$",
"table",
":",
"$",
"this",
"->",
"tableName",
";",
"$",
"this",
"->"... | Check table Existence.
@param string $table
@return $this | [
"Check",
"table",
"Existence",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L369-L380 |
230,928 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.hasColumn | public function hasColumn($column)
{
$this->schema = self::SELECT.' COUNT(COLUMN_NAME) FROM
'.$this->getSchemaQuery()."
AND COLUMN_NAME = '".$column."' ";
$this->checkSchemaExistence = true;
return $this;
} | php | public function hasColumn($column)
{
$this->schema = self::SELECT.' COUNT(COLUMN_NAME) FROM
'.$this->getSchemaQuery()."
AND COLUMN_NAME = '".$column."' ";
$this->checkSchemaExistence = true;
return $this;
} | [
"public",
"function",
"hasColumn",
"(",
"$",
"column",
")",
"{",
"$",
"this",
"->",
"schema",
"=",
"self",
"::",
"SELECT",
".",
"' COUNT(COLUMN_NAME) FROM\n '",
".",
"$",
"this",
"->",
"getSchemaQuery",
"(",
")",
".",
"\"\n ... | Check if column exists.
@param $column
@return $this | [
"Check",
"if",
"column",
"exists",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L524-L533 |
230,929 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.addPrimaryKey | public function addPrimaryKey($columns)
{
$schema = self::SELECT.' EXISTS
(
'.self::SELECT.' * FROM '.$this->_informationSchema.'.COLUMNS
WHERE '.$this->_tableSchema."= '".$this->database."' AND
TABLE_NAME ='".$this->tab... | php | public function addPrimaryKey($columns)
{
$schema = self::SELECT.' EXISTS
(
'.self::SELECT.' * FROM '.$this->_informationSchema.'.COLUMNS
WHERE '.$this->_tableSchema."= '".$this->database."' AND
TABLE_NAME ='".$this->tab... | [
"public",
"function",
"addPrimaryKey",
"(",
"$",
"columns",
")",
"{",
"$",
"schema",
"=",
"self",
"::",
"SELECT",
".",
"' EXISTS\n (\n '",
".",
"self",
"::",
"SELECT",
".",
"' * FROM '",
".",
"$",
"this",
"->",
"_information... | String for single column and array for multiple column.
@param $columns
@return $this | [
"String",
"for",
"single",
"column",
"and",
"array",
"for",
"multiple",
"column",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L542-L573 |
230,930 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.unique | public function unique($column, $keyConstraint = '')
{
$alter = '';
$alter = static::ALTER_TABLE.' `'.$this->tableName.'` ADD ';
if (is_array($column)) {
// build query unique key for multiple columns
$columns = $this->commands($column);
$this->schema = ... | php | public function unique($column, $keyConstraint = '')
{
$alter = '';
$alter = static::ALTER_TABLE.' `'.$this->tableName.'` ADD ';
if (is_array($column)) {
// build query unique key for multiple columns
$columns = $this->commands($column);
$this->schema = ... | [
"public",
"function",
"unique",
"(",
"$",
"column",
",",
"$",
"keyConstraint",
"=",
"''",
")",
"{",
"$",
"alter",
"=",
"''",
";",
"$",
"alter",
"=",
"static",
"::",
"ALTER_TABLE",
".",
"' `'",
".",
"$",
"this",
"->",
"tableName",
".",
"'` ADD '",
";"... | Create unique key index.
@param $column
@param string $keyConstraint
@return $this | [
"Create",
"unique",
"key",
"index",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L622-L641 |
230,931 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.dropUnique | public function dropUnique($keyConstraint = '')
{
// ALTER TABLE Persons DROP CONSTRAINT uc_PersonID
// MYSQL QUERY
$this->schema = static::ALTER_TABLE.' `'.$this->tableName.'`
DROP INDEX
UC_'.strtoupper($this->tableName).'_'.strtoupper($keyConstraint).'_ID';
... | php | public function dropUnique($keyConstraint = '')
{
// ALTER TABLE Persons DROP CONSTRAINT uc_PersonID
// MYSQL QUERY
$this->schema = static::ALTER_TABLE.' `'.$this->tableName.'`
DROP INDEX
UC_'.strtoupper($this->tableName).'_'.strtoupper($keyConstraint).'_ID';
... | [
"public",
"function",
"dropUnique",
"(",
"$",
"keyConstraint",
"=",
"''",
")",
"{",
"// ALTER TABLE Persons DROP CONSTRAINT uc_PersonID",
"// MYSQL QUERY",
"$",
"this",
"->",
"schema",
"=",
"static",
"::",
"ALTER_TABLE",
".",
"' `'",
".",
"$",
"this",
"->",
"table... | Drop unique key index.
@param string $keyConstraint
@return $this | [
"Drop",
"unique",
"key",
"index",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L650-L659 |
230,932 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.index | public function index($columnName, $indexName = '')
{
$indexName = ($indexName !== '') ? $indexName : $columnName;
$this->schema = 'CREATE INDEX '.strtoupper($indexName).'_INDEX
ON `'.$this->tableName.'` ('.$columnName.')';
return $this;
} | php | public function index($columnName, $indexName = '')
{
$indexName = ($indexName !== '') ? $indexName : $columnName;
$this->schema = 'CREATE INDEX '.strtoupper($indexName).'_INDEX
ON `'.$this->tableName.'` ('.$columnName.')';
return $this;
} | [
"public",
"function",
"index",
"(",
"$",
"columnName",
",",
"$",
"indexName",
"=",
"''",
")",
"{",
"$",
"indexName",
"=",
"(",
"$",
"indexName",
"!==",
"''",
")",
"?",
"$",
"indexName",
":",
"$",
"columnName",
";",
"$",
"this",
"->",
"schema",
"=",
... | Create index for the column.
@param $columnName
@param string $indexName
@return $this | [
"Create",
"index",
"for",
"the",
"column",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L669-L676 |
230,933 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.dropIndex | public function dropIndex($indexName)
{
$this->schema = static::ALTER_TABLE.' `'.$this->tableName.'`
DROP INDEX '.strtoupper($indexName).'_INDEX';
return $this;
} | php | public function dropIndex($indexName)
{
$this->schema = static::ALTER_TABLE.' `'.$this->tableName.'`
DROP INDEX '.strtoupper($indexName).'_INDEX';
return $this;
} | [
"public",
"function",
"dropIndex",
"(",
"$",
"indexName",
")",
"{",
"$",
"this",
"->",
"schema",
"=",
"static",
"::",
"ALTER_TABLE",
".",
"' `'",
".",
"$",
"this",
"->",
"tableName",
".",
"'`\n DROP INDEX '",
".",
"strtoupper",
"(",
"$",
"indexNam... | Drop index from the column.
@param $indexName
@return $this | [
"Drop",
"index",
"from",
"the",
"column",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L685-L691 |
230,934 | cygnite/framework | src/Cygnite/Database/Table/Schema.php | Schema.run | public function run()
{
if (is_object($this->connection())) {
try {
$stmt = $this->connection()->prepare($this->schema);
if ($this->checkSchemaExistence) {
return $stmt->rowCount();
} elseif ($return = $stmt->execute()) {
... | php | public function run()
{
if (is_object($this->connection())) {
try {
$stmt = $this->connection()->prepare($this->schema);
if ($this->checkSchemaExistence) {
return $stmt->rowCount();
} elseif ($return = $stmt->execute()) {
... | [
"public",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"connection",
"(",
")",
")",
")",
"{",
"try",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"connection",
"(",
")",
"->",
"prepare",
"(",
"$",
"this",
"->",
... | Build schema and return result set.
@throws \Exception
@return bool | [
"Build",
"schema",
"and",
"return",
"result",
"set",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Schema.php#L761-L778 |
230,935 | AppShed/extension-api | src/AppShed/Remote/XML/DOMDocument.php | DOMDocument.createElement | public function createElement($tag, $attributes = null)
{
$node = parent::createElement($tag);
$text = false;
if (is_string($attributes)) {
$node->setAttribute('class', $attributes);
} else {
if (is_array($attributes)) {
foreach ($attributes as... | php | public function createElement($tag, $attributes = null)
{
$node = parent::createElement($tag);
$text = false;
if (is_string($attributes)) {
$node->setAttribute('class', $attributes);
} else {
if (is_array($attributes)) {
foreach ($attributes as... | [
"public",
"function",
"createElement",
"(",
"$",
"tag",
",",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"node",
"=",
"parent",
"::",
"createElement",
"(",
"$",
"tag",
")",
";",
"$",
"text",
"=",
"false",
";",
"if",
"(",
"is_string",
"(",
"$",
"... | Create a new domelement with either a class or array of attributes given
@param string $tag
@param string|array $attributes if its a string it will be the class attribute
@return \DOMElement | [
"Create",
"a",
"new",
"domelement",
"with",
"either",
"a",
"class",
"or",
"array",
"of",
"attributes",
"given"
] | c030f489e419cc5240f6e48b828b9349bb27cfaf | https://github.com/AppShed/extension-api/blob/c030f489e419cc5240f6e48b828b9349bb27cfaf/src/AppShed/Remote/XML/DOMDocument.php#L28-L52 |
230,936 | inetprocess/libsugarcrm | src/Team.php | Team.getTeamsFromTeamSet | public function getTeamsFromTeamSet($teamSetId)
{
require_once('modules/Teams/TeamSetManager.php');
$teams = \TeamSetManager::getTeamsFromSet($teamSetId);
// Fetch more details from the team
foreach ($teams as $key => $team) {
$teamFields = $this->sugarBean->getBean('Tea... | php | public function getTeamsFromTeamSet($teamSetId)
{
require_once('modules/Teams/TeamSetManager.php');
$teams = \TeamSetManager::getTeamsFromSet($teamSetId);
// Fetch more details from the team
foreach ($teams as $key => $team) {
$teamFields = $this->sugarBean->getBean('Tea... | [
"public",
"function",
"getTeamsFromTeamSet",
"(",
"$",
"teamSetId",
")",
"{",
"require_once",
"(",
"'modules/Teams/TeamSetManager.php'",
")",
";",
"$",
"teams",
"=",
"\\",
"TeamSetManager",
"::",
"getTeamsFromSet",
"(",
"$",
"teamSetId",
")",
";",
"// Fetch more det... | Returns an array of teams from a team set id
@param string $teamSetId UUID from SugarCRM.
@return array List of teams with metadata | [
"Returns",
"an",
"array",
"of",
"teams",
"from",
"a",
"team",
"set",
"id"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Team.php#L60-L72 |
230,937 | inetprocess/libsugarcrm | src/Team.php | Team.getTeamMembers | public function getTeamMembers($teamId)
{
$team = $this->sugarBean->getBean('Teams', $teamId);
$users = $team->get_team_members();
foreach ($users as $key => $user) {
$users[$key] = $user->fetched_row;
}
return $users;
} | php | public function getTeamMembers($teamId)
{
$team = $this->sugarBean->getBean('Teams', $teamId);
$users = $team->get_team_members();
foreach ($users as $key => $user) {
$users[$key] = $user->fetched_row;
}
return $users;
} | [
"public",
"function",
"getTeamMembers",
"(",
"$",
"teamId",
")",
"{",
"$",
"team",
"=",
"$",
"this",
"->",
"sugarBean",
"->",
"getBean",
"(",
"'Teams'",
",",
"$",
"teamId",
")",
";",
"$",
"users",
"=",
"$",
"team",
"->",
"get_team_members",
"(",
")",
... | Returns an array of members from a team
@param string $teamId UUID from SugarCRM.
@return array List of users with metadata | [
"Returns",
"an",
"array",
"of",
"members",
"from",
"a",
"team"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Team.php#L81-L91 |
230,938 | inetprocess/libsugarcrm | src/Database/AbstractTablesDiff.php | AbstractTablesDiff.diff | public function diff($base, $new, $mode = self::DIFF_ALL, array $field_ids = array())
{
if (!empty($field_ids)) {
$field_ids = array_flip($field_ids);
$base = array_intersect_key($base, $field_ids);
$new = array_intersect_key($new, $field_ids);
}
$res = ar... | php | public function diff($base, $new, $mode = self::DIFF_ALL, array $field_ids = array())
{
if (!empty($field_ids)) {
$field_ids = array_flip($field_ids);
$base = array_intersect_key($base, $field_ids);
$new = array_intersect_key($new, $field_ids);
}
$res = ar... | [
"public",
"function",
"diff",
"(",
"$",
"base",
",",
"$",
"new",
",",
"$",
"mode",
"=",
"self",
"::",
"DIFF_ALL",
",",
"array",
"$",
"field_ids",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"field_ids",
")",
")",
"{",
"... | Compute the difference between two metadata arrays.
@param $base Base or old array.
@param $new New array with new definitions.
@param $add If true find new fields. Default: true
@param $del If true find fields to delete. Default: true
@param $update if true find modified fields; Default: true
@param $field_ids Array f... | [
"Compute",
"the",
"difference",
"between",
"two",
"metadata",
"arrays",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Database/AbstractTablesDiff.php#L114-L145 |
230,939 | inetprocess/libsugarcrm | src/Database/AbstractTablesDiff.php | AbstractTablesDiff.createUpdateQuery | public function createUpdateQuery(array $field_data)
{
return $this->getQueryFactory()
->createUpdateQuery($this->tableName, $field_data[self::BASE]['id'], $field_data[self::MODIFIED]);
} | php | public function createUpdateQuery(array $field_data)
{
return $this->getQueryFactory()
->createUpdateQuery($this->tableName, $field_data[self::BASE]['id'], $field_data[self::MODIFIED]);
} | [
"public",
"function",
"createUpdateQuery",
"(",
"array",
"$",
"field_data",
")",
"{",
"return",
"$",
"this",
"->",
"getQueryFactory",
"(",
")",
"->",
"createUpdateQuery",
"(",
"$",
"this",
"->",
"tableName",
",",
"$",
"field_data",
"[",
"self",
"::",
"BASE",... | Build query to update fields. | [
"Build",
"query",
"to",
"update",
"fields",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Database/AbstractTablesDiff.php#L168-L172 |
230,940 | inetprocess/libsugarcrm | src/Database/AbstractTablesDiff.php | AbstractTablesDiff.generateQueries | public function generateQueries(array $diff_res)
{
$queries = array();
foreach ($diff_res[self::ADD] as $new_field) {
$queries[] = $this->createAddQuery($new_field);
}
foreach ($diff_res[self::DEL] as $del_field) {
$queries[] = $this->createDeleteQuery($del_fi... | php | public function generateQueries(array $diff_res)
{
$queries = array();
foreach ($diff_res[self::ADD] as $new_field) {
$queries[] = $this->createAddQuery($new_field);
}
foreach ($diff_res[self::DEL] as $del_field) {
$queries[] = $this->createDeleteQuery($del_fi... | [
"public",
"function",
"generateQueries",
"(",
"array",
"$",
"diff_res",
")",
"{",
"$",
"queries",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"diff_res",
"[",
"self",
"::",
"ADD",
"]",
"as",
"$",
"new_field",
")",
"{",
"$",
"queries",
"[",
"]",... | Get the queries for a diff result | [
"Get",
"the",
"queries",
"for",
"a",
"diff",
"result"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Database/AbstractTablesDiff.php#L185-L198 |
230,941 | inetprocess/libsugarcrm | src/Database/AbstractTablesDiff.php | AbstractTablesDiff.generateSqlQueries | public function generateSqlQueries(array $diff_res)
{
$queries = $this->generateQueries($diff_res);
$sql = '';
foreach ($queries as $query) {
$sql .= $this->getSqlQuery($query) . ";\n";
}
return $sql;
} | php | public function generateSqlQueries(array $diff_res)
{
$queries = $this->generateQueries($diff_res);
$sql = '';
foreach ($queries as $query) {
$sql .= $this->getSqlQuery($query) . ";\n";
}
return $sql;
} | [
"public",
"function",
"generateSqlQueries",
"(",
"array",
"$",
"diff_res",
")",
"{",
"$",
"queries",
"=",
"$",
"this",
"->",
"generateQueries",
"(",
"$",
"diff_res",
")",
";",
"$",
"sql",
"=",
"''",
";",
"foreach",
"(",
"$",
"queries",
"as",
"$",
"quer... | Get the all the sql queries for a diff result. | [
"Get",
"the",
"all",
"the",
"sql",
"queries",
"for",
"a",
"diff",
"result",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Database/AbstractTablesDiff.php#L203-L211 |
230,942 | inetprocess/libsugarcrm | src/Database/AbstractTablesDiff.php | AbstractTablesDiff.executeQueries | public function executeQueries(array $diff_res)
{
$this->getLogger()->debug('Running sql queries.');
$queries = $this->generateQueries($diff_res);
foreach ($queries as $query) {
$query->execute();
}
} | php | public function executeQueries(array $diff_res)
{
$this->getLogger()->debug('Running sql queries.');
$queries = $this->generateQueries($diff_res);
foreach ($queries as $query) {
$query->execute();
}
} | [
"public",
"function",
"executeQueries",
"(",
"array",
"$",
"diff_res",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"debug",
"(",
"'Running sql queries.'",
")",
";",
"$",
"queries",
"=",
"$",
"this",
"->",
"generateQueries",
"(",
"$",
"diff_re... | Execute DB queries for a diff result | [
"Execute",
"DB",
"queries",
"for",
"a",
"diff",
"result"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Database/AbstractTablesDiff.php#L216-L223 |
230,943 | inetprocess/libsugarcrm | src/Database/AbstractTablesDiff.php | AbstractTablesDiff.getMergedData | public function getMergedData(array $base, array $diff_res)
{
$res = $base + $diff_res[self::ADD];
$res = array_diff_key($res, $diff_res[self::DEL]);
foreach ($diff_res[self::UPDATE] as $field_id => $values) {
$new_values = array_merge($values[self::BASE], $values[self::MODIFIED]... | php | public function getMergedData(array $base, array $diff_res)
{
$res = $base + $diff_res[self::ADD];
$res = array_diff_key($res, $diff_res[self::DEL]);
foreach ($diff_res[self::UPDATE] as $field_id => $values) {
$new_values = array_merge($values[self::BASE], $values[self::MODIFIED]... | [
"public",
"function",
"getMergedData",
"(",
"array",
"$",
"base",
",",
"array",
"$",
"diff_res",
")",
"{",
"$",
"res",
"=",
"$",
"base",
"+",
"$",
"diff_res",
"[",
"self",
"::",
"ADD",
"]",
";",
"$",
"res",
"=",
"array_diff_key",
"(",
"$",
"res",
"... | Merge base metadata array with modifications from diff result | [
"Merge",
"base",
"metadata",
"array",
"with",
"modifications",
"from",
"diff",
"result"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Database/AbstractTablesDiff.php#L228-L237 |
230,944 | inetprocess/libsugarcrm | src/Database/AbstractTablesDiff.php | AbstractTablesDiff.writeFile | public function writeFile(array $diff_res)
{
$base = array();
if (is_readable($this->defFile)) {
$base = $this->loadFromFile();
}
$merged_data = $this->getMergedData($base, $diff_res);
ksort($merged_data);
$yaml = Yaml::dump(array_values($merged_data));
... | php | public function writeFile(array $diff_res)
{
$base = array();
if (is_readable($this->defFile)) {
$base = $this->loadFromFile();
}
$merged_data = $this->getMergedData($base, $diff_res);
ksort($merged_data);
$yaml = Yaml::dump(array_values($merged_data));
... | [
"public",
"function",
"writeFile",
"(",
"array",
"$",
"diff_res",
")",
"{",
"$",
"base",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_readable",
"(",
"$",
"this",
"->",
"defFile",
")",
")",
"{",
"$",
"base",
"=",
"$",
"this",
"->",
"loadFromFile",
"... | Write to file | [
"Write",
"to",
"file"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Database/AbstractTablesDiff.php#L242-L254 |
230,945 | cygnite/framework | src/Cygnite/Foundation/Bootstrappers/ViewBootstraper.php | ViewBootstraper.run | public function run()
{
// Configure view & widget class.
ViewFactory::make(\Cygnite\Mvc\View\View::class, $this->container, function ($v) {
$v->setContainer($this->container);
// Configure widget and register into container.
$widget = new \Cygnite\Mvc\View\Widge... | php | public function run()
{
// Configure view & widget class.
ViewFactory::make(\Cygnite\Mvc\View\View::class, $this->container, function ($v) {
$v->setContainer($this->container);
// Configure widget and register into container.
$widget = new \Cygnite\Mvc\View\Widge... | [
"public",
"function",
"run",
"(",
")",
"{",
"// Configure view & widget class.",
"ViewFactory",
"::",
"make",
"(",
"\\",
"Cygnite",
"\\",
"Mvc",
"\\",
"View",
"\\",
"View",
"::",
"class",
",",
"$",
"this",
"->",
"container",
",",
"function",
"(",
"$",
"v",... | Create, configure view and store view instance
in container | [
"Create",
"configure",
"view",
"and",
"store",
"view",
"instance",
"in",
"container"
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Bootstrappers/ViewBootstraper.php#L40-L50 |
230,946 | cygnite/framework | src/Cygnite/Common/SessionManager/Manager.php | Manager.get | public function get($key = null, $default = null)
{
if ($key === null) {
return $this->all();
}
return $this->getStackReference($this->storage, explode(self::SEPARATOR, $key), $default);
} | php | public function get($key = null, $default = null)
{
if ($key === null) {
return $this->all();
}
return $this->getStackReference($this->storage, explode(self::SEPARATOR, $key), $default);
} | [
"public",
"function",
"get",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"all",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"getStac... | Get value from the storage if exists.
@param string $key
@param mixed $default
@return mixed | [
"Get",
"value",
"from",
"the",
"storage",
"if",
"exists",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/SessionManager/Manager.php#L31-L38 |
230,947 | cygnite/framework | src/Cygnite/Common/SessionManager/Manager.php | Manager.set | public function set($key, $value = null)
{
if ($key === null) {
array_push($this->storage, $value);
return $this;
}
if (is_array($key)) {
foreach ($key as $key => $value) {
$this->storage[$key] = $value;
}
return ... | php | public function set($key, $value = null)
{
if ($key === null) {
array_push($this->storage, $value);
return $this;
}
if (is_array($key)) {
foreach ($key as $key => $value) {
$this->storage[$key] = $value;
}
return ... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"storage",
",",
"$",
"value",
")",
";",
"return",
"$",
"this",
";",
"}... | Sets value to session storage.
@param string $key
@param mixed $value
@return $this | [
"Sets",
"value",
"to",
"session",
"storage",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/SessionManager/Manager.php#L77-L96 |
230,948 | cygnite/framework | src/Cygnite/Common/SessionManager/Manager.php | Manager.has | public function has($key = null)
{
if ($key === null) {
return $this->count() > 0;
}
$arr = &$this->getStackByReference($key);
return is_array($arr) ? array_key_exists($key, $arr) : false;
} | php | public function has($key = null)
{
if ($key === null) {
return $this->count() > 0;
}
$arr = &$this->getStackByReference($key);
return is_array($arr) ? array_key_exists($key, $arr) : false;
} | [
"public",
"function",
"has",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"count",
"(",
")",
">",
"0",
";",
"}",
"$",
"arr",
"=",
"&",
"$",
"this",
"->",
"getStackByReferen... | We will check if session key exists
return boolean value.
@param string $key
@return bool | [
"We",
"will",
"check",
"if",
"session",
"key",
"exists",
"return",
"boolean",
"value",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/SessionManager/Manager.php#L106-L115 |
230,949 | cygnite/framework | src/Cygnite/Common/SessionManager/Manager.php | Manager.delete | public function delete($key = null)
{
if ($key === null) {
$this->reset();
return $this;
}
$arr = &$this->getStackByReference($key);
if (is_array($arr) && array_key_exists($key, $arr)) {
unset($arr[$key]);
}
return $this;
} | php | public function delete($key = null)
{
if ($key === null) {
$this->reset();
return $this;
}
$arr = &$this->getStackByReference($key);
if (is_array($arr) && array_key_exists($key, $arr)) {
unset($arr[$key]);
}
return $this;
} | [
"public",
"function",
"delete",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"reset",
"(",
")",
";",
"return",
"$",
"this",
";",
"}",
"$",
"arr",
"=",
"&",
"$",
"this",
"->",
"getS... | Remove key from the stack
if key given null we will remove all values.
@param string $key attribute to remove from
@return $this | [
"Remove",
"key",
"from",
"the",
"stack",
"if",
"key",
"given",
"null",
"we",
"will",
"remove",
"all",
"values",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/SessionManager/Manager.php#L125-L140 |
230,950 | cygnite/framework | src/Cygnite/Common/SessionManager/Manager.php | Manager.& | protected function &getStackByReference(&$key)
{
$key = explode(self::SEPARATOR, $key);
if (count($key) > 1) {
$arr = &$this->getStackReference($this->storage, array_slice($key, 0, -1), false);
} else {
$arr = &$this->storage;
}
$key = array_slice($k... | php | protected function &getStackByReference(&$key)
{
$key = explode(self::SEPARATOR, $key);
if (count($key) > 1) {
$arr = &$this->getStackReference($this->storage, array_slice($key, 0, -1), false);
} else {
$arr = &$this->storage;
}
$key = array_slice($k... | [
"protected",
"function",
"&",
"getStackByReference",
"(",
"&",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"explode",
"(",
"self",
"::",
"SEPARATOR",
",",
"$",
"key",
")",
";",
"if",
"(",
"count",
"(",
"$",
"key",
")",
">",
"1",
")",
"{",
"$",
"arr",
... | Return the array reference.
@param string $key
@return mixed | [
"Return",
"the",
"array",
"reference",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/SessionManager/Manager.php#L167-L181 |
230,951 | cygnite/framework | src/Cygnite/Common/SessionManager/Manager.php | Manager.& | protected function &getStackReference(&$array, $keys, $default = null)
{
$key = array_shift($keys);
if (!isset($array[$key])) {
return $default;
}
if (empty($keys)) {
return $array[$key];
}
return $this->getStackReference($array[$key], $keys... | php | protected function &getStackReference(&$array, $keys, $default = null)
{
$key = array_shift($keys);
if (!isset($array[$key])) {
return $default;
}
if (empty($keys)) {
return $array[$key];
}
return $this->getStackReference($array[$key], $keys... | [
"protected",
"function",
"&",
"getStackReference",
"(",
"&",
"$",
"array",
",",
"$",
"keys",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"key",
"=",
"array_shift",
"(",
"$",
"keys",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"array",
"[",
... | Returns array element matching key.
@param array $array
@param array $keys
@param mixed $default
@return string | [
"Returns",
"array",
"element",
"matching",
"key",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/SessionManager/Manager.php#L192-L205 |
230,952 | cygnite/framework | src/Cygnite/Common/Mail/Mailer.php | Mailer.compose | public static function compose($callback = null)
{
$mailer = new static();
$mailer->setSwiftMailer(new \Swift_Mailer($mailer->getTransportInstance()));
if (!is_null($callback) && $callback instanceof Closure) {
return $callback($mailer, $mailer->message());
}
re... | php | public static function compose($callback = null)
{
$mailer = new static();
$mailer->setSwiftMailer(new \Swift_Mailer($mailer->getTransportInstance()));
if (!is_null($callback) && $callback instanceof Closure) {
return $callback($mailer, $mailer->message());
}
re... | [
"public",
"static",
"function",
"compose",
"(",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"mailer",
"=",
"new",
"static",
"(",
")",
";",
"$",
"mailer",
"->",
"setSwiftMailer",
"(",
"new",
"\\",
"Swift_Mailer",
"(",
"$",
"mailer",
"->",
"getTransportIn... | Get the instance of the Mailer.
@param null $callback
@return static | [
"Get",
"the",
"instance",
"of",
"the",
"Mailer",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/Mail/Mailer.php#L83-L93 |
230,953 | cygnite/framework | src/Cygnite/Common/Mail/Mailer.php | Mailer.setSmtpConfig | public function setSmtpConfig($swiftSmtpTransport, $attributes)
{
foreach ($attributes as $key => $value) {
$method = 'set'.ucfirst($key);
$swiftSmtpTransport->{$method}($value);
}
} | php | public function setSmtpConfig($swiftSmtpTransport, $attributes)
{
foreach ($attributes as $key => $value) {
$method = 'set'.ucfirst($key);
$swiftSmtpTransport->{$method}($value);
}
} | [
"public",
"function",
"setSmtpConfig",
"(",
"$",
"swiftSmtpTransport",
",",
"$",
"attributes",
")",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"method",
"=",
"'set'",
".",
"ucfirst",
"(",
"$",
"key",
")... | Set Email configurations dynamically to SwiftMailer.
@param $swiftSmtpTransport
@param $attributes | [
"Set",
"Email",
"configurations",
"dynamically",
"to",
"SwiftMailer",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/Mail/Mailer.php#L138-L144 |
230,954 | cygnite/framework | src/Cygnite/Common/Mail/Mailer.php | Mailer.createSmtpTransport | protected function createSmtpTransport()
{
$this->smtpTransport = SmtpTransport::newInstance();
$this->setSmtpConfig($this->smtpTransport, $this->emailConfig['smtp']);
} | php | protected function createSmtpTransport()
{
$this->smtpTransport = SmtpTransport::newInstance();
$this->setSmtpConfig($this->smtpTransport, $this->emailConfig['smtp']);
} | [
"protected",
"function",
"createSmtpTransport",
"(",
")",
"{",
"$",
"this",
"->",
"smtpTransport",
"=",
"SmtpTransport",
"::",
"newInstance",
"(",
")",
";",
"$",
"this",
"->",
"setSmtpConfig",
"(",
"$",
"this",
"->",
"smtpTransport",
",",
"$",
"this",
"->",
... | Set SMTP transport.
@param null
@return void | [
"Set",
"SMTP",
"transport",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/Mail/Mailer.php#L153-L158 |
230,955 | cygnite/framework | src/Cygnite/Common/Mail/Mailer.php | Mailer.send | public function send($message)
{
if (!$message instanceof MailMessage) {
throw new \InvalidArgumentException(
sprintf('Mailer::%s expect instance of Swift_Message.', __FUNCTION__)
);
}
return $this->swift->send($message, $this->failedRecipients);
... | php | public function send($message)
{
if (!$message instanceof MailMessage) {
throw new \InvalidArgumentException(
sprintf('Mailer::%s expect instance of Swift_Message.', __FUNCTION__)
);
}
return $this->swift->send($message, $this->failedRecipients);
... | [
"public",
"function",
"send",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"$",
"message",
"instanceof",
"MailMessage",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Mailer::%s expect instance of Swift_Message.'",
",",
"__FUN... | Send email with message.
@param your $message
@throws \InvalidArgumentException
@return unknown | [
"Send",
"email",
"with",
"message",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/Mail/Mailer.php#L257-L266 |
230,956 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_method_addautoloadfilters.php | Smarty_Internal_Method_AddAutoloadFilters.addAutoloadFilters | public function addAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)
{
$smarty = isset($obj->smarty) ? $obj->smarty : $obj;
if ($type !== null) {
$this->_checkFilterType($type);
if (!empty($smarty->autoload_filters[$type])) {
$smarty->... | php | public function addAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null)
{
$smarty = isset($obj->smarty) ? $obj->smarty : $obj;
if ($type !== null) {
$this->_checkFilterType($type);
if (!empty($smarty->autoload_filters[$type])) {
$smarty->... | [
"public",
"function",
"addAutoloadFilters",
"(",
"Smarty_Internal_TemplateBase",
"$",
"obj",
",",
"$",
"filters",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"smarty",
"=",
"isset",
"(",
"$",
"obj",
"->",
"smarty",
")",
"?",
"$",
"obj",
"->",
"smarty",... | Add autoload filters
@api Smarty::setAutoloadFilters()
@param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
@param array $filters filters to load automatically
@param string $type ... | [
"Add",
"autoload",
"filters"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_method_addautoloadfilters.php#L29-L50 |
230,957 | cygnite/framework | src/Cygnite/Common/SessionManager/Native/Session.php | Session.startSession | protected function startSession()
{
if (@session_status() === \PHP_SESSION_ACTIVE) {
throw new SessionNotStartedException('Session started already!');
}
if (ini_get('session.use_cookies') && headers_sent($file, $line)) {
throw new SessionNotStartedException(sprintf('... | php | protected function startSession()
{
if (@session_status() === \PHP_SESSION_ACTIVE) {
throw new SessionNotStartedException('Session started already!');
}
if (ini_get('session.use_cookies') && headers_sent($file, $line)) {
throw new SessionNotStartedException(sprintf('... | [
"protected",
"function",
"startSession",
"(",
")",
"{",
"if",
"(",
"@",
"session_status",
"(",
")",
"===",
"\\",
"PHP_SESSION_ACTIVE",
")",
"{",
"throw",
"new",
"SessionNotStartedException",
"(",
"'Session started already!'",
")",
";",
"}",
"if",
"(",
"ini_get",... | Starts session.
@throws \RuntimeException | [
"Starts",
"session",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/SessionManager/Native/Session.php#L100-L119 |
230,958 | cygnite/framework | src/Cygnite/Common/SessionManager/Native/Session.php | Session.checkReferer | protected function checkReferer()
{
if (!empty($_SERVER['HTTP_REFERER'])) {
$url = parse_url($_SERVER['HTTP_REFERER']);
$hostUrl = (array_key_exists('port', $url)) ? $url['host'].':'.$url['port'] : $url['host'];
if ($hostUrl != $_SERVER['HTTP_HOST']) {
s... | php | protected function checkReferer()
{
if (!empty($_SERVER['HTTP_REFERER'])) {
$url = parse_url($_SERVER['HTTP_REFERER']);
$hostUrl = (array_key_exists('port', $url)) ? $url['host'].':'.$url['port'] : $url['host'];
if ($hostUrl != $_SERVER['HTTP_HOST']) {
s... | [
"protected",
"function",
"checkReferer",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"_SERVER",
"[",
"'HTTP_REFERER'",
"]",
")",
")",
"{",
"$",
"url",
"=",
"parse_url",
"(",
"$",
"_SERVER",
"[",
"'HTTP_REFERER'",
"]",
")",
";",
"$",
"hostUrl",
... | We will check referer url from the same server or not
else we will destroy the session. | [
"We",
"will",
"check",
"referer",
"url",
"from",
"the",
"same",
"server",
"or",
"not",
"else",
"we",
"will",
"destroy",
"the",
"session",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/SessionManager/Native/Session.php#L148-L159 |
230,959 | cygnite/framework | src/Cygnite/Common/SessionManager/Native/Session.php | Session.regenerate | public function regenerate()
{
// we will regenerate session ID
session_regenerate_id(true);
session_write_close();
if (isset($_SESSION)) {
$data = $_SESSION;
session_start();
$_SESSION = $data;
} else {
session_start();
... | php | public function regenerate()
{
// we will regenerate session ID
session_regenerate_id(true);
session_write_close();
if (isset($_SESSION)) {
$data = $_SESSION;
session_start();
$_SESSION = $data;
} else {
session_start();
... | [
"public",
"function",
"regenerate",
"(",
")",
"{",
"// we will regenerate session ID",
"session_regenerate_id",
"(",
"true",
")",
";",
"session_write_close",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
")",
")",
"{",
"$",
"data",
"=",
"$",
"_SES... | Regenerate the session ID.
@return $this | [
"Regenerate",
"the",
"session",
"ID",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Common/SessionManager/Native/Session.php#L166-L185 |
230,960 | inetprocess/libsugarcrm | src/Bean.php | Bean.getBean | public function getBean($module, $id = null, $params = array(), $deleted = true, $useCache = false)
{
if ($useCache && class_exists('BeanFactory')) {
return \BeanFactory::getBean($module, $id, $params, $deleted);
}
// If I use an old version of SugarCRM, do exactly what BeanFact... | php | public function getBean($module, $id = null, $params = array(), $deleted = true, $useCache = false)
{
if ($useCache && class_exists('BeanFactory')) {
return \BeanFactory::getBean($module, $id, $params, $deleted);
}
// If I use an old version of SugarCRM, do exactly what BeanFact... | [
"public",
"function",
"getBean",
"(",
"$",
"module",
",",
"$",
"id",
"=",
"null",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"deleted",
"=",
"true",
",",
"$",
"useCache",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"useCache",
"&&",
"class... | Get a Bean from SugarCRM
@param string $module Module's name
@param string $id UUID
@param array $params list of params
@param boolean $deleted Retrieve the bean even if it's deleted
@param boolean $useCache
@throws \InvalidArgumentException
@return SugarBean SugarCRM Bean | [
"Get",
"a",
"Bean",
"from",
"SugarCRM"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L170-L211 |
230,961 | inetprocess/libsugarcrm | src/Bean.php | Bean.deleteBean | public function deleteBean($module, $id, $disableSecurity = false)
{
$bean = $this->getBean($module, $id, array('disable_row_level_security' => $disableSecurity));
if ($bean === false) {
throw new \InvalidArgumentException("Can't delete that record.");
}
$bean->mark_delet... | php | public function deleteBean($module, $id, $disableSecurity = false)
{
$bean = $this->getBean($module, $id, array('disable_row_level_security' => $disableSecurity));
if ($bean === false) {
throw new \InvalidArgumentException("Can't delete that record.");
}
$bean->mark_delet... | [
"public",
"function",
"deleteBean",
"(",
"$",
"module",
",",
"$",
"id",
",",
"$",
"disableSecurity",
"=",
"false",
")",
"{",
"$",
"bean",
"=",
"$",
"this",
"->",
"getBean",
"(",
"$",
"module",
",",
"$",
"id",
",",
"array",
"(",
"'disable_row_level_secu... | Delete a bean
@param string $module Module's name
@param string $id UUID | [
"Delete",
"a",
"bean"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L232-L239 |
230,962 | inetprocess/libsugarcrm | src/Bean.php | Bean.getList | public function getList($module, $where = array(), $limit = 100, $offset = 0, $deleted = 0)
{
$this->getLogger()->debug($this->logPrefix
. "__getList : module = $module | offset = $offset | limit = $limit");
$records = array();
// Get the beans and build the WHERE
$oBean... | php | public function getList($module, $where = array(), $limit = 100, $offset = 0, $deleted = 0)
{
$this->getLogger()->debug($this->logPrefix
. "__getList : module = $module | offset = $offset | limit = $limit");
$records = array();
// Get the beans and build the WHERE
$oBean... | [
"public",
"function",
"getList",
"(",
"$",
"module",
",",
"$",
"where",
"=",
"array",
"(",
")",
",",
"$",
"limit",
"=",
"100",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"deleted",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->"... | Get a list of records directly from the database
@param string $module Module's name
@param array $where
@param integer $limit
@param integer $offset
@param integer $deleted Get Deleted Records only
@throws \InvalidArgumentException
@return array List of records found | [
"Get",
"a",
"list",
"of",
"records",
"directly",
"from",
"the",
"database"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L254-L309 |
230,963 | inetprocess/libsugarcrm | src/Bean.php | Bean.searchBeans | public function searchBeans($module, array $searchFields, $deleted = 0, $limit = 100)
{
global $db;
// Search the related record ID
$sugarBean = $this->getBean($module);
// Make sure the fields criteras are set correctly
$searchFields = array_map(function ($critera) {
... | php | public function searchBeans($module, array $searchFields, $deleted = 0, $limit = 100)
{
global $db;
// Search the related record ID
$sugarBean = $this->getBean($module);
// Make sure the fields criteras are set correctly
$searchFields = array_map(function ($critera) {
... | [
"public",
"function",
"searchBeans",
"(",
"$",
"module",
",",
"array",
"$",
"searchFields",
",",
"$",
"deleted",
"=",
"0",
",",
"$",
"limit",
"=",
"100",
")",
"{",
"global",
"$",
"db",
";",
"// Search the related record ID",
"$",
"sugarBean",
"=",
"$",
"... | Search a bean from a specific module and with WHERE criteras
@param string $module Sugar's Module name
@param array $searchFields List of fields where to search with their value
@param boolean $deleted Search for deleted record
@throws \Exception|\RuntimeException
@return array List of Records | [
"Search",
"a",
"bean",
"from",
"a",
"specific",
"module",
"and",
"with",
"WHERE",
"criteras"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L322-L363 |
230,964 | inetprocess/libsugarcrm | src/Bean.php | Bean.updateBean | public function updateBean(\SugarBean $sugarBean, array $data, $saveMode)
{
$code = self::SUGAR_NOTCHANGED;
// Save my ID
if (!empty($sugarBean->id)) {
$this->lastUpdatedId = $sugarBean->id;
}
$changedValues = $this->updateBeanFields($sugarBean, $data);
... | php | public function updateBean(\SugarBean $sugarBean, array $data, $saveMode)
{
$code = self::SUGAR_NOTCHANGED;
// Save my ID
if (!empty($sugarBean->id)) {
$this->lastUpdatedId = $sugarBean->id;
}
$changedValues = $this->updateBeanFields($sugarBean, $data);
... | [
"public",
"function",
"updateBean",
"(",
"\\",
"SugarBean",
"$",
"sugarBean",
",",
"array",
"$",
"data",
",",
"$",
"saveMode",
")",
"{",
"$",
"code",
"=",
"self",
"::",
"SUGAR_NOTCHANGED",
";",
"// Save my ID",
"if",
"(",
"!",
"empty",
"(",
"$",
"sugarBe... | Update a SugarCRM Bean
@param \SugarBean $bean
@param array $data Array of field => value
@param integer $saveMode DRY_RUN / CREATE / UPDATE / CREATE_WITH_ID
@throws Inet\SugarCRM\Exception\UpdateBeanException if trying to create or update a bean
when not in the correct mode. If trying to create an empty ... | [
"Update",
"a",
"SugarCRM",
"Bean"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L378-L446 |
230,965 | inetprocess/libsugarcrm | src/Bean.php | Bean.updateBeanFields | public function updateBeanFields(\SugarBean $sugarBean, array $fields)
{
$changedValues = 0;
$nonEmptyFields = array('date_entered');
$moduleFields = $this->getModuleFields($sugarBean->module_name);
$moduleRels = $this->getModuleRelationships($sugarBean->module_name, 'one');
... | php | public function updateBeanFields(\SugarBean $sugarBean, array $fields)
{
$changedValues = 0;
$nonEmptyFields = array('date_entered');
$moduleFields = $this->getModuleFields($sugarBean->module_name);
$moduleRels = $this->getModuleRelationships($sugarBean->module_name, 'one');
... | [
"public",
"function",
"updateBeanFields",
"(",
"\\",
"SugarBean",
"$",
"sugarBean",
",",
"array",
"$",
"fields",
")",
"{",
"$",
"changedValues",
"=",
"0",
";",
"$",
"nonEmptyFields",
"=",
"array",
"(",
"'date_entered'",
")",
";",
"$",
"moduleFields",
"=",
... | Update fields of a SugarCRM Bean
@param \SugarBean $bean
@param array $fields Array of field name => value
@return integer Number of changed fields. | [
"Update",
"fields",
"of",
"a",
"SugarCRM",
"Bean"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L457-L496 |
230,966 | inetprocess/libsugarcrm | src/Bean.php | Bean.countRecords | public function countRecords($module, array $whereCriteras = array(), $deleted = false)
{
$bean = $this->getBean($module);
// build the where
$where = ($deleted ? 'WHERE 1 = 1' : 'WHERE deleted = 0');
if (!empty($whereCriteras)) {
$where.= ' AND ' . implode(' AND ', $wher... | php | public function countRecords($module, array $whereCriteras = array(), $deleted = false)
{
$bean = $this->getBean($module);
// build the where
$where = ($deleted ? 'WHERE 1 = 1' : 'WHERE deleted = 0');
if (!empty($whereCriteras)) {
$where.= ' AND ' . implode(' AND ', $wher... | [
"public",
"function",
"countRecords",
"(",
"$",
"module",
",",
"array",
"$",
"whereCriteras",
"=",
"array",
"(",
")",
",",
"$",
"deleted",
"=",
"false",
")",
"{",
"$",
"bean",
"=",
"$",
"this",
"->",
"getBean",
"(",
"$",
"module",
")",
";",
"// build... | Count Records for a Sugar Module
@param string $module SugarCRM Module's Name
@param array $whereCriteras Search Criteras + values
@param boolean $deleted Take deleted records into account
@throws \InvalidArgumentException
@return integer Total number of records | [
"Count",
"Records",
"for",
"a",
"Sugar",
"Module"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L529-L553 |
230,967 | inetprocess/libsugarcrm | src/Bean.php | Bean.getModuleRelationships | public function getModuleRelationships($module, $type = 'all')
{
// Check in cache
if (isset($this->moduleRels[$module][$type])) {
$this->getLogger()->debug($this->logPrefix . 'Got rels for this module in cache');
return $this->moduleRels[$module][$type];
}
... | php | public function getModuleRelationships($module, $type = 'all')
{
// Check in cache
if (isset($this->moduleRels[$module][$type])) {
$this->getLogger()->debug($this->logPrefix . 'Got rels for this module in cache');
return $this->moduleRels[$module][$type];
}
... | [
"public",
"function",
"getModuleRelationships",
"(",
"$",
"module",
",",
"$",
"type",
"=",
"'all'",
")",
"{",
"// Check in cache",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"moduleRels",
"[",
"$",
"module",
"]",
"[",
"$",
"type",
"]",
")",
")",
"{",
... | Get relationships for a specific module
@param string $module SugarCRM Module's name
@param string $type Could be either 'all' or 'one'. One will give only the rels as "fields"
@throws \InvalidArgumentException
@return array List of relationships | [
"Get",
"relationships",
"for",
"a",
"specific",
"module"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L723-L778 |
230,968 | inetprocess/libsugarcrm | src/Bean.php | Bean.getModuleTable | public function getModuleTable($module)
{
$sugarBean = $this->getBean($module);
$tableName = $sugarBean->table_name;
if (empty($tableName)) {
throw new SugarException("$module returns an empty table name");
}
return $sugarBean->table_name;
} | php | public function getModuleTable($module)
{
$sugarBean = $this->getBean($module);
$tableName = $sugarBean->table_name;
if (empty($tableName)) {
throw new SugarException("$module returns an empty table name");
}
return $sugarBean->table_name;
} | [
"public",
"function",
"getModuleTable",
"(",
"$",
"module",
")",
"{",
"$",
"sugarBean",
"=",
"$",
"this",
"->",
"getBean",
"(",
"$",
"module",
")",
";",
"$",
"tableName",
"=",
"$",
"sugarBean",
"->",
"table_name",
";",
"if",
"(",
"empty",
"(",
"$",
"... | Returns the table's name for a module
@param string $module Module's name
@throws \InvalidArgumentException
@return string Returns the table name | [
"Returns",
"the",
"table",
"s",
"name",
"for",
"a",
"module"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L789-L798 |
230,969 | inetprocess/libsugarcrm | src/Bean.php | Bean.getModuleCustomTable | public function getModuleCustomTable($module)
{
$sugarBean = $this->getBean($module);
$customTable = $sugarBean->get_custom_table_name();
$data = $this->db->query("SHOW TABLES LIKE '$customTable'");
if (empty($data)) {
return '';
}
return $customTable;
... | php | public function getModuleCustomTable($module)
{
$sugarBean = $this->getBean($module);
$customTable = $sugarBean->get_custom_table_name();
$data = $this->db->query("SHOW TABLES LIKE '$customTable'");
if (empty($data)) {
return '';
}
return $customTable;
... | [
"public",
"function",
"getModuleCustomTable",
"(",
"$",
"module",
")",
"{",
"$",
"sugarBean",
"=",
"$",
"this",
"->",
"getBean",
"(",
"$",
"module",
")",
";",
"$",
"customTable",
"=",
"$",
"sugarBean",
"->",
"get_custom_table_name",
"(",
")",
";",
"$",
"... | Returns the custom table's name for a module
@param string $module Module's name
@throws \InvalidArgumentException
@return string Returns the table name | [
"Returns",
"the",
"custom",
"table",
"s",
"name",
"for",
"a",
"module"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L809-L819 |
230,970 | inetprocess/libsugarcrm | src/Bean.php | Bean.applyLabelsToField | public function applyLabelsToField($module_definition, $field_name, $value)
{
$key = $field_name;
if (array_key_exists($field_name, $module_definition)) {
$field_definition = $module_definition[$field_name];
if (isset($field_definition['vname'])) {
$field_name... | php | public function applyLabelsToField($module_definition, $field_name, $value)
{
$key = $field_name;
if (array_key_exists($field_name, $module_definition)) {
$field_definition = $module_definition[$field_name];
if (isset($field_definition['vname'])) {
$field_name... | [
"public",
"function",
"applyLabelsToField",
"(",
"$",
"module_definition",
",",
"$",
"field_name",
",",
"$",
"value",
")",
"{",
"$",
"key",
"=",
"$",
"field_name",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"field_name",
",",
"$",
"module_definition",
")"... | Return an array with the field_name and the value after replacing by a label when available.
@param $module_definition Module definition fetch with language as in getModuleFields.
@param $field_name Technical name of the field
@param $value Value fetched from db. Enums will be replaced by label from list.
@return arr... | [
"Return",
"an",
"array",
"with",
"the",
"field_name",
"and",
"the",
"value",
"after",
"replacing",
"by",
"a",
"label",
"when",
"available",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L868-L890 |
230,971 | inetprocess/libsugarcrm | src/Bean.php | Bean.beanToArray | public function beanToArray(array $fields_name, \SugarBean $bean, $pretty = false, $lang = 'en_us')
{
$module_definition = null;
if ($pretty) {
$module_definition = $this->getModuleFields($bean->module_name, $lang);
}
$fields = array();
foreach ($fields_name as $f... | php | public function beanToArray(array $fields_name, \SugarBean $bean, $pretty = false, $lang = 'en_us')
{
$module_definition = null;
if ($pretty) {
$module_definition = $this->getModuleFields($bean->module_name, $lang);
}
$fields = array();
foreach ($fields_name as $f... | [
"public",
"function",
"beanToArray",
"(",
"array",
"$",
"fields_name",
",",
"\\",
"SugarBean",
"$",
"bean",
",",
"$",
"pretty",
"=",
"false",
",",
"$",
"lang",
"=",
"'en_us'",
")",
"{",
"$",
"module_definition",
"=",
"null",
";",
"if",
"(",
"$",
"prett... | Fetch values for fields name from bean
@param $pretty if true, will return the display name from the language.
@param $lang language to use in pretty mode. Default to en_us.
@return An array of key => value pairs. | [
"Fetch",
"values",
"for",
"fields",
"name",
"from",
"bean"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L900-L916 |
230,972 | inetprocess/libsugarcrm | src/Bean.php | Bean.beanListToArray | public function beanListToArray(array $fields_name, array $bean_list, $pretty = false, $lang = 'en_us')
{
$ret = array();
foreach ($bean_list as $bean) {
$ret[] = $this->beanToArray($fields_name, $bean, $pretty, $lang);
}
return $ret;
} | php | public function beanListToArray(array $fields_name, array $bean_list, $pretty = false, $lang = 'en_us')
{
$ret = array();
foreach ($bean_list as $bean) {
$ret[] = $this->beanToArray($fields_name, $bean, $pretty, $lang);
}
return $ret;
} | [
"public",
"function",
"beanListToArray",
"(",
"array",
"$",
"fields_name",
",",
"array",
"$",
"bean_list",
",",
"$",
"pretty",
"=",
"false",
",",
"$",
"lang",
"=",
"'en_us'",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"be... | Convert an array of \SugarBean objects to an array of arrays matching the Beans.
@param $fields_name Only the fields named in this array will be present.
@param $bean_list An array of SugarBean objects.
@param $pretty If true, return the fields using the labels.
@param $lang Language to use if pretty is true. Default ... | [
"Convert",
"an",
"array",
"of",
"\\",
"SugarBean",
"objects",
"to",
"an",
"array",
"of",
"arrays",
"matching",
"the",
"Beans",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Bean.php#L928-L935 |
230,973 | marein/php-nchan-client | src/Nchan.php | Nchan.channel | public function channel(string $name): Channel
{
return new Channel(
$this->baseUrl->append($name),
$this->client
);
} | php | public function channel(string $name): Channel
{
return new Channel(
$this->baseUrl->append($name),
$this->client
);
} | [
"public",
"function",
"channel",
"(",
"string",
"$",
"name",
")",
":",
"Channel",
"{",
"return",
"new",
"Channel",
"(",
"$",
"this",
"->",
"baseUrl",
"->",
"append",
"(",
"$",
"name",
")",
",",
"$",
"this",
"->",
"client",
")",
";",
"}"
] | Create the api for the given channel name.
@param string $name
@return Channel
@throws InvalidUrlException | [
"Create",
"the",
"api",
"for",
"the",
"given",
"channel",
"name",
"."
] | 958d7ccb06e49139f3bf720ff3f1bd9dbe33caa9 | https://github.com/marein/php-nchan-client/blob/958d7ccb06e49139f3bf720ff3f1bd9dbe33caa9/src/Nchan.php#L47-L53 |
230,974 | marein/php-nchan-client | src/Nchan.php | Nchan.status | public function status(string $path): Status
{
return new Status(
$this->baseUrl->append($path),
$this->client
);
} | php | public function status(string $path): Status
{
return new Status(
$this->baseUrl->append($path),
$this->client
);
} | [
"public",
"function",
"status",
"(",
"string",
"$",
"path",
")",
":",
"Status",
"{",
"return",
"new",
"Status",
"(",
"$",
"this",
"->",
"baseUrl",
"->",
"append",
"(",
"$",
"path",
")",
",",
"$",
"this",
"->",
"client",
")",
";",
"}"
] | Create the api for the given status path. The path must be configured with the "nchan_stub_status;" directive.
@param string $path
@return Status
@throws InvalidUrlException | [
"Create",
"the",
"api",
"for",
"the",
"given",
"status",
"path",
".",
"The",
"path",
"must",
"be",
"configured",
"with",
"the",
"nchan_stub_status",
";",
"directive",
"."
] | 958d7ccb06e49139f3bf720ff3f1bd9dbe33caa9 | https://github.com/marein/php-nchan-client/blob/958d7ccb06e49139f3bf720ff3f1bd9dbe33caa9/src/Nchan.php#L63-L69 |
230,975 | franzliedke/lti | src/ToolProvider.php | ToolProvider.handleRequest | public function handleRequest(ServerRequestInterface $request)
{
$requestBody = (array) $request->getParsedBody();
// Set debug mode
$this->debugMode = isset($requestBody['custom_debug']) && (strtolower($requestBody['custom_debug']) == 'true');
// Set return URL if available
... | php | public function handleRequest(ServerRequestInterface $request)
{
$requestBody = (array) $request->getParsedBody();
// Set debug mode
$this->debugMode = isset($requestBody['custom_debug']) && (strtolower($requestBody['custom_debug']) == 'true');
// Set return URL if available
... | [
"public",
"function",
"handleRequest",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"$",
"requestBody",
"=",
"(",
"array",
")",
"$",
"request",
"->",
"getParsedBody",
"(",
")",
";",
"// Set debug mode",
"$",
"this",
"->",
"debugMode",
"=",
"isset",... | Process an incoming request
@param ServerRequestInterface $request
@return mixed Returns TRUE or FALSE, a redirection URL or HTML
@throws Exception | [
"Process",
"an",
"incoming",
"request"
] | 131cf331f2cb87fcc29049ac739c8751e9e5133b | https://github.com/franzliedke/lti/blob/131cf331f2cb87fcc29049ac739c8751e9e5133b/src/ToolProvider.php#L276-L296 |
230,976 | franzliedke/lti | src/ToolProvider.php | ToolProvider.getConsumers | public function getConsumers()
{
// Initialise data connector
$this->storage = AbstractStorage::getStorage($this->storage);
return $this->storage->toolConsumerList();
} | php | public function getConsumers()
{
// Initialise data connector
$this->storage = AbstractStorage::getStorage($this->storage);
return $this->storage->toolConsumerList();
} | [
"public",
"function",
"getConsumers",
"(",
")",
"{",
"// Initialise data connector",
"$",
"this",
"->",
"storage",
"=",
"AbstractStorage",
"::",
"getStorage",
"(",
"$",
"this",
"->",
"storage",
")",
";",
"return",
"$",
"this",
"->",
"storage",
"->",
"toolConsu... | Get an array of defined tool consumers
@return array Array of ToolConsumer objects | [
"Get",
"an",
"array",
"of",
"defined",
"tool",
"consumers"
] | 131cf331f2cb87fcc29049ac739c8751e9e5133b | https://github.com/franzliedke/lti/blob/131cf331f2cb87fcc29049ac739c8751e9e5133b/src/ToolProvider.php#L319-L325 |
230,977 | franzliedke/lti | src/ToolProvider.php | ToolProvider.sendForm | public static function sendForm($url, $params, $target = '')
{
$page = <<< EOD
<html>
<head>
<title>IMS LTI message</title>
<script type="text/javascript">
//<![CDATA[
function doOnLoad() {
document.forms[0].submit();
}
window.onload=doOnLoad;
//]]>
</script>
</head>
<body>
<form action="{$url}" method="... | php | public static function sendForm($url, $params, $target = '')
{
$page = <<< EOD
<html>
<head>
<title>IMS LTI message</title>
<script type="text/javascript">
//<![CDATA[
function doOnLoad() {
document.forms[0].submit();
}
window.onload=doOnLoad;
//]]>
</script>
</head>
<body>
<form action="{$url}" method="... | [
"public",
"static",
"function",
"sendForm",
"(",
"$",
"url",
",",
"$",
"params",
",",
"$",
"target",
"=",
"''",
")",
"{",
"$",
"page",
"=",
" <<< EOD\n<html>\n<head>\n<title>IMS LTI message</title>\n<script type=\"text/javascript\">\n//<![CDATA[\nfunction doOnLoad() {\n docu... | Generate a web page containing an auto-submitted form of parameters.
@param string $url URL to which the form should be submitted
@param array $params Array of form parameters
@param string $target Name of target (optional)
@return string | [
"Generate",
"a",
"web",
"page",
"containing",
"an",
"auto",
"-",
"submitted",
"form",
"of",
"parameters",
"."
] | 131cf331f2cb87fcc29049ac739c8751e9e5133b | https://github.com/franzliedke/lti/blob/131cf331f2cb87fcc29049ac739c8751e9e5133b/src/ToolProvider.php#L359-L396 |
230,978 | cygnite/framework | src/Cygnite/Database/Table/Seeder.php | Seeder.executeOnly | public function executeOnly($class)
{
/*
| We will check if user requesting for seeding multiple table
| Then we will filter out only those class to seed from the
| specified seeder array
*/
if ($exp = string_split($class, ',')) {
$this->seeders = $thi... | php | public function executeOnly($class)
{
/*
| We will check if user requesting for seeding multiple table
| Then we will filter out only those class to seed from the
| specified seeder array
*/
if ($exp = string_split($class, ',')) {
$this->seeders = $thi... | [
"public",
"function",
"executeOnly",
"(",
"$",
"class",
")",
"{",
"/*\n | We will check if user requesting for seeding multiple table\n | Then we will filter out only those class to seed from the\n | specified seeder array\n */",
"if",
"(",
"$",
"exp",
"=",
... | Filter out other class and set only class to seed.
@param $class | [
"Filter",
"out",
"other",
"class",
"and",
"set",
"only",
"class",
"to",
"seed",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Table/Seeder.php#L27-L43 |
230,979 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_data.php | Smarty_Internal_Data.assign | public function assign($tpl_var, $value = null, $nocache = false)
{
if (is_array($tpl_var)) {
foreach ($tpl_var as $_key => $_val) {
if ($_key != '') {
$this->tpl_vars[$_key] = new Smarty_Variable($_val, $nocache);
if ($this->_objType == 2 ... | php | public function assign($tpl_var, $value = null, $nocache = false)
{
if (is_array($tpl_var)) {
foreach ($tpl_var as $_key => $_val) {
if ($_key != '') {
$this->tpl_vars[$_key] = new Smarty_Variable($_val, $nocache);
if ($this->_objType == 2 ... | [
"public",
"function",
"assign",
"(",
"$",
"tpl_var",
",",
"$",
"value",
"=",
"null",
",",
"$",
"nocache",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"tpl_var",
")",
")",
"{",
"foreach",
"(",
"$",
"tpl_var",
"as",
"$",
"_key",
"=>",
... | assigns a Smarty variable
@param array|string $tpl_var the template variable name(s)
@param mixed $value the value to assign
@param boolean $nocache if true any output of this variable will be not cached
@return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template)... | [
"assigns",
"a",
"Smarty",
"variable"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_data.php#L90-L110 |
230,980 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_data.php | Smarty_Internal_Data.getTemplateVars | public function getTemplateVars($varName = null, Smarty_Internal_Data $_ptr = null, $searchParents = true)
{
return $this->ext->getTemplateVars->getTemplateVars($this, $varName, $_ptr, $searchParents);
} | php | public function getTemplateVars($varName = null, Smarty_Internal_Data $_ptr = null, $searchParents = true)
{
return $this->ext->getTemplateVars->getTemplateVars($this, $varName, $_ptr, $searchParents);
} | [
"public",
"function",
"getTemplateVars",
"(",
"$",
"varName",
"=",
"null",
",",
"Smarty_Internal_Data",
"$",
"_ptr",
"=",
"null",
",",
"$",
"searchParents",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"ext",
"->",
"getTemplateVars",
"->",
"getTemplat... | Returns a single or all template variables
@api Smarty::getTemplateVars()
@link http://www.smarty.net/docs/en/api.get.template.vars.tpl
@param string $varName variable name or null
@param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $_ptr opt... | [
"Returns",
"a",
"single",
"or",
"all",
"template",
"variables"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_data.php#L185-L188 |
230,981 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_data.php | Smarty_Internal_Data.getVariable | public function getVariable($variable = null, Smarty_Internal_Data $_ptr = null, $searchParents = true, $error_enable = true){
return $this->ext->getTemplateVars->_getVariable($this, $variable, $_ptr, $searchParents, $error_enable);
} | php | public function getVariable($variable = null, Smarty_Internal_Data $_ptr = null, $searchParents = true, $error_enable = true){
return $this->ext->getTemplateVars->_getVariable($this, $variable, $_ptr, $searchParents, $error_enable);
} | [
"public",
"function",
"getVariable",
"(",
"$",
"variable",
"=",
"null",
",",
"Smarty_Internal_Data",
"$",
"_ptr",
"=",
"null",
",",
"$",
"searchParents",
"=",
"true",
",",
"$",
"error_enable",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"ext",
"-... | gets the object of a Smarty variable
@param string $variable the name of the Smarty variable
@param Smarty_Internal_Data $_ptr optional pointer to data object
@param boolean $searchParents search also in parent data
@param bool $error_enable
@return Smarty_Variable|Smarty_Undefined_Variable t... | [
"gets",
"the",
"object",
"of",
"a",
"Smarty",
"variable"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_data.php#L201-L203 |
230,982 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_data.php | Smarty_Internal_Data._mergeVars | public function _mergeVars(Smarty_Internal_Data $data = null)
{
if (isset($data)) {
if (!empty($this->tpl_vars)) {
$data->tpl_vars = array_merge($this->tpl_vars, $data->tpl_vars);
}
if (!empty($this->config_vars)) {
$data->config_vars = arr... | php | public function _mergeVars(Smarty_Internal_Data $data = null)
{
if (isset($data)) {
if (!empty($this->tpl_vars)) {
$data->tpl_vars = array_merge($this->tpl_vars, $data->tpl_vars);
}
if (!empty($this->config_vars)) {
$data->config_vars = arr... | [
"public",
"function",
"_mergeVars",
"(",
"Smarty_Internal_Data",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"tpl_vars",
")",
")",
"{",
"$",
"data",
"->",... | Follow the parent chain an merge template and config variables
@param \Smarty_Internal_Data|null $data | [
"Follow",
"the",
"parent",
"chain",
"an",
"merge",
"template",
"and",
"config",
"variables"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_data.php#L210-L225 |
230,983 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_method_compilealltemplates.php | Smarty_Internal_Method_CompileAllTemplates.compileAll | protected function compileAll(Smarty $smarty, $extension, $force_compile, $time_limit, $max_errors, $isConfig = false)
{
// switch off time limit
if (function_exists('set_time_limit')) {
@set_time_limit($time_limit);
}
$_count = 0;
$_error_count = 0;
$sour... | php | protected function compileAll(Smarty $smarty, $extension, $force_compile, $time_limit, $max_errors, $isConfig = false)
{
// switch off time limit
if (function_exists('set_time_limit')) {
@set_time_limit($time_limit);
}
$_count = 0;
$_error_count = 0;
$sour... | [
"protected",
"function",
"compileAll",
"(",
"Smarty",
"$",
"smarty",
",",
"$",
"extension",
",",
"$",
"force_compile",
",",
"$",
"time_limit",
",",
"$",
"max_errors",
",",
"$",
"isConfig",
"=",
"false",
")",
"{",
"// switch off time limit",
"if",
"(",
"funct... | Compile all template or config files
@param \Smarty $smarty
@param string $extension template file name extension
@param bool $force_compile force all to recompile
@param int $time_limit set maximum execution time
@param int $max_errors set maximum allowed errors
@param bool $isConfig fla... | [
"Compile",
"all",
"template",
"or",
"config",
"files"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_method_compilealltemplates.php#L51-L110 |
230,984 | cygnite/framework | src/Cygnite/Database/Connections/Connector.php | Connector.create | public function create()
{
$pdo = null;
try {
$pdo = $this->connect();
} catch (\Exception $e) {
$pdo = null;
if ($this->isLostConnection($e)) {
$pdo = $this->reconnect();
}
throw new \LogicException('Connection los... | php | public function create()
{
$pdo = null;
try {
$pdo = $this->connect();
} catch (\Exception $e) {
$pdo = null;
if ($this->isLostConnection($e)) {
$pdo = $this->reconnect();
}
throw new \LogicException('Connection los... | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"pdo",
"=",
"null",
";",
"try",
"{",
"$",
"pdo",
"=",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"$",
"pdo",
"=",
"null",
";",
"if... | Return PDO connection object. If connection lost will try again to connect.
@return PDO | [
"Return",
"PDO",
"connection",
"object",
".",
"If",
"connection",
"lost",
"will",
"try",
"again",
"to",
"connect",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Connections/Connector.php#L47-L62 |
230,985 | inetprocess/libsugarcrm | src/Utils.php | Utils.arrayToMultiselect | public function arrayToMultiselect(array $values)
{
// First clean the array
foreach ($values as $k => $v) {
if (empty($v)) {
unset($values[$k]);
}
}
// Encode
$values = (empty($values) ? '^^' : encodeMultienumValue($values));
... | php | public function arrayToMultiselect(array $values)
{
// First clean the array
foreach ($values as $k => $v) {
if (empty($v)) {
unset($values[$k]);
}
}
// Encode
$values = (empty($values) ? '^^' : encodeMultienumValue($values));
... | [
"public",
"function",
"arrayToMultiselect",
"(",
"array",
"$",
"values",
")",
"{",
"// First clean the array",
"foreach",
"(",
"$",
"values",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"v",
")",
")",
"{",
"unset",
"(",
"$... | Encode a multienum from Sugar
@param string $multiselect MultiEnum from DB
@return array Multienum as Array | [
"Encode",
"a",
"multienum",
"from",
"Sugar"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Utils.php#L60-L74 |
230,986 | inetprocess/libsugarcrm | src/Utils.php | Utils.multiselectToArray | public function multiselectToArray($values)
{
// Unencode
$values = unencodeMultienum($values);
// First clean the array
foreach ($values as $k => $v) {
if (empty($v)) {
unset($values[$k]);
}
}
// Then return the array
... | php | public function multiselectToArray($values)
{
// Unencode
$values = unencodeMultienum($values);
// First clean the array
foreach ($values as $k => $v) {
if (empty($v)) {
unset($values[$k]);
}
}
// Then return the array
... | [
"public",
"function",
"multiselectToArray",
"(",
"$",
"values",
")",
"{",
"// Unencode",
"$",
"values",
"=",
"unencodeMultienum",
"(",
"$",
"values",
")",
";",
"// First clean the array",
"foreach",
"(",
"$",
"values",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
... | Decode a multienum from Sugar
@param string $multiselect MultiEnum from DB
@return array Multienum as Array | [
"Decode",
"a",
"multienum",
"from",
"Sugar"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Utils.php#L83-L97 |
230,987 | inetprocess/libsugarcrm | src/Utils.php | Utils.addDropdown | public function addDropdown($name, array $values, $lang)
{
require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
require_once('modules/ModuleBuilder/parsers/parser.dropdown.php');
$_REQUEST['view_package'] = 'studio'; //need this in parser.dropdown.php
$parser = new \ParserDro... | php | public function addDropdown($name, array $values, $lang)
{
require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
require_once('modules/ModuleBuilder/parsers/parser.dropdown.php');
$_REQUEST['view_package'] = 'studio'; //need this in parser.dropdown.php
$parser = new \ParserDro... | [
"public",
"function",
"addDropdown",
"(",
"$",
"name",
",",
"array",
"$",
"values",
",",
"$",
"lang",
")",
"{",
"require_once",
"(",
"'modules/ModuleBuilder/MB/ModuleBuilder.php'",
")",
";",
"require_once",
"(",
"'modules/ModuleBuilder/parsers/parser.dropdown.php'",
")"... | Add a dropdown in SugarCRM
@param string $name Dropdown's name
@param array $values Values for the dropdown
@param string $lang Language
@return void | [
"Add",
"a",
"dropdown",
"in",
"SugarCRM"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Utils.php#L144-L166 |
230,988 | inetprocess/libsugarcrm | src/Utils.php | Utils.getDropdown | public function getDropdown($name, $lang = 'fr_FR')
{
$listStrings = \return_app_list_strings_language($lang);
if (!array_key_exists($name, $listStrings)) {
return false;
}
return $listStrings[$name];
} | php | public function getDropdown($name, $lang = 'fr_FR')
{
$listStrings = \return_app_list_strings_language($lang);
if (!array_key_exists($name, $listStrings)) {
return false;
}
return $listStrings[$name];
} | [
"public",
"function",
"getDropdown",
"(",
"$",
"name",
",",
"$",
"lang",
"=",
"'fr_FR'",
")",
"{",
"$",
"listStrings",
"=",
"\\",
"return_app_list_strings_language",
"(",
"$",
"lang",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"... | Get the displayed value for a dropdown in SugarCRM
@param string $name Dropdown's name
@param string $lang Language
@return array | [
"Get",
"the",
"displayed",
"value",
"for",
"a",
"dropdown",
"in",
"SugarCRM"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/Utils.php#L176-L184 |
230,989 | cygnite/framework | src/Cygnite/Foundation/Http/Kernel.php | Kernel.setRouter | public function setRouter($request)
{
$this->container->set('request', $request);
$this->container->make(\Cygnite\Router\Router::class);
$this->container->get('router')->setRequest($request);
$this->router = $this->container->get('router');
} | php | public function setRouter($request)
{
$this->container->set('request', $request);
$this->container->make(\Cygnite\Router\Router::class);
$this->container->get('router')->setRequest($request);
$this->router = $this->container->get('router');
} | [
"public",
"function",
"setRouter",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"container",
"->",
"set",
"(",
"'request'",
",",
"$",
"request",
")",
";",
"$",
"this",
"->",
"container",
"->",
"make",
"(",
"\\",
"Cygnite",
"\\",
"Router",
"\\",
... | Set Router and Request instance into Container
@param $router
@param $request | [
"Set",
"Router",
"and",
"Request",
"instance",
"into",
"Container"
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Http/Kernel.php#L62-L68 |
230,990 | cygnite/framework | src/Cygnite/Foundation/Http/Kernel.php | Kernel.handle | public function handle($request) : ResponseInterface
{
$this->setRouter($request);
try {
$response = $this->sendRequestThroughRouter($request);
/*
* Check whether return value is a instance of Response,
* otherwise we will try to fetch the response ... | php | public function handle($request) : ResponseInterface
{
$this->setRouter($request);
try {
$response = $this->sendRequestThroughRouter($request);
/*
* Check whether return value is a instance of Response,
* otherwise we will try to fetch the response ... | [
"public",
"function",
"handle",
"(",
"$",
"request",
")",
":",
"ResponseInterface",
"{",
"$",
"this",
"->",
"setRouter",
"(",
"$",
"request",
")",
";",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"sendRequestThroughRouter",
"(",
"$",
"request",
... | Handle the request and dispatch to routes.
@param $request
@throws Exception|\Exception
@return array|ResponseInterface|mixed|static | [
"Handle",
"the",
"request",
"and",
"dispatch",
"to",
"routes",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Http/Kernel.php#L77-L100 |
230,991 | cygnite/framework | src/Cygnite/Foundation/Http/Kernel.php | Kernel.sendRequestThroughRouter | protected function sendRequestThroughRouter($request)
{
$this->app->bootApplication($request);
$this->pipeline = new Pipeline($this->container);
return $this->pipeline
->send($request)
->through($this->parseMiddlewareToPipelines($this->getMiddleware()), 'handle')
... | php | protected function sendRequestThroughRouter($request)
{
$this->app->bootApplication($request);
$this->pipeline = new Pipeline($this->container);
return $this->pipeline
->send($request)
->through($this->parseMiddlewareToPipelines($this->getMiddleware()), 'handle')
... | [
"protected",
"function",
"sendRequestThroughRouter",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bootApplication",
"(",
"$",
"request",
")",
";",
"$",
"this",
"->",
"pipeline",
"=",
"new",
"Pipeline",
"(",
"$",
"this",
"->",
"container"... | Prepare pipeline requests and send through router.
@param $request
@return mixed | [
"Prepare",
"pipeline",
"requests",
"and",
"send",
"through",
"router",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Http/Kernel.php#L146-L156 |
230,992 | cygnite/framework | src/Cygnite/Foundation/Http/Kernel.php | Kernel.parseMiddlewareToPipelines | protected function parseMiddlewareToPipelines(array $middlewares) : array
{
$pipes = [];
// check all types and store value into pipes array
foreach ($middlewares as $middleware) {
if (is_object($middleware)) {
$pipes[] = $middleware;
} elseif (string_... | php | protected function parseMiddlewareToPipelines(array $middlewares) : array
{
$pipes = [];
// check all types and store value into pipes array
foreach ($middlewares as $middleware) {
if (is_object($middleware)) {
$pipes[] = $middleware;
} elseif (string_... | [
"protected",
"function",
"parseMiddlewareToPipelines",
"(",
"array",
"$",
"middlewares",
")",
":",
"array",
"{",
"$",
"pipes",
"=",
"[",
"]",
";",
"// check all types and store value into pipes array",
"foreach",
"(",
"$",
"middlewares",
"as",
"$",
"middleware",
")"... | Parse Middlewares to pipelines
@param array $middlewares
@return array | [
"Parse",
"Middlewares",
"to",
"pipelines"
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Http/Kernel.php#L180-L195 |
230,993 | cygnite/framework | src/Cygnite/Foundation/Http/Kernel.php | Kernel.dispatchToRouter | protected function dispatchToRouter() : Closure
{
return function ($request) {
return $this->router->setContainer($this->container)->dispatch($request);
};
} | php | protected function dispatchToRouter() : Closure
{
return function ($request) {
return $this->router->setContainer($this->container)->dispatch($request);
};
} | [
"protected",
"function",
"dispatchToRouter",
"(",
")",
":",
"Closure",
"{",
"return",
"function",
"(",
"$",
"request",
")",
"{",
"return",
"$",
"this",
"->",
"router",
"->",
"setContainer",
"(",
"$",
"this",
"->",
"container",
")",
"->",
"dispatch",
"(",
... | Application booted, let's dispatch the routes.
@return callable | [
"Application",
"booted",
"let",
"s",
"dispatch",
"the",
"routes",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Http/Kernel.php#L202-L207 |
230,994 | cygnite/framework | src/Cygnite/Foundation/Http/Kernel.php | Kernel.shutdown | public function shutdown($request, $response)
{
$routeMiddlewares = $this->router->getMiddlewares();
$middlewares = array_merge(array_filter([$routeMiddlewares]), $this->getMiddleware());
foreach ($middlewares as $middleware) {
list($name, $parameters) = $this->pipeline->parseP... | php | public function shutdown($request, $response)
{
$routeMiddlewares = $this->router->getMiddlewares();
$middlewares = array_merge(array_filter([$routeMiddlewares]), $this->getMiddleware());
foreach ($middlewares as $middleware) {
list($name, $parameters) = $this->pipeline->parseP... | [
"public",
"function",
"shutdown",
"(",
"$",
"request",
",",
"$",
"response",
")",
"{",
"$",
"routeMiddlewares",
"=",
"$",
"this",
"->",
"router",
"->",
"getMiddlewares",
"(",
")",
";",
"$",
"middlewares",
"=",
"array_merge",
"(",
"array_filter",
"(",
"[",
... | Fire shutdown method of middleware class.
@param $request
@param $response | [
"Fire",
"shutdown",
"method",
"of",
"middleware",
"class",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Http/Kernel.php#L242-L257 |
230,995 | tapestry-cloud/tapestry | src/Entities/Taxonomy.php | Taxonomy.getFileList | public function getFileList($order = 'desc')
{
$order = strtolower(trim($order));
// Order Files by date newer to older
$this->items->sortMultiDimension(function ($a, $b) use ($order) {
if ($a == $b) {
return 0;
}
if ($order === 'asc') {
... | php | public function getFileList($order = 'desc')
{
$order = strtolower(trim($order));
// Order Files by date newer to older
$this->items->sortMultiDimension(function ($a, $b) use ($order) {
if ($a == $b) {
return 0;
}
if ($order === 'asc') {
... | [
"public",
"function",
"getFileList",
"(",
"$",
"order",
"=",
"'desc'",
")",
"{",
"$",
"order",
"=",
"strtolower",
"(",
"trim",
"(",
"$",
"order",
")",
")",
";",
"// Order Files by date newer to older",
"$",
"this",
"->",
"items",
"->",
"sortMultiDimension",
... | Returns an ordered list of the file uid's that have been bucketed into this taxonomy. The list is ordered by
the files date.
@param string $order
@return array | [
"Returns",
"an",
"ordered",
"list",
"of",
"the",
"file",
"uid",
"s",
"that",
"have",
"been",
"bucketed",
"into",
"this",
"taxonomy",
".",
"The",
"list",
"is",
"ordered",
"by",
"the",
"files",
"date",
"."
] | f3fc980b2484ccbe609a7f811c65b91254e8720e | https://github.com/tapestry-cloud/tapestry/blob/f3fc980b2484ccbe609a7f811c65b91254e8720e/src/Entities/Taxonomy.php#L65-L81 |
230,996 | cygnite/framework | src/Cygnite/Mvc/View/Composer.php | Composer.create | public function create($view = null, array $data = [])
{
if (is_null($view)) {
return $this;
}
return $this->render($view, $data, true)->content();
} | php | public function create($view = null, array $data = [])
{
if (is_null($view)) {
return $this;
}
return $this->render($view, $data, true)->content();
} | [
"public",
"function",
"create",
"(",
"$",
"view",
"=",
"null",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"view",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"return",
"$",
"this",
"->",
"render",
"(... | Create view and render it. This is alias of render method.
<code>
View::create('view-name', $data);
$view = View::create();
</code>
@param $view
@param array $data
@return mixed | [
"Create",
"view",
"and",
"render",
"it",
".",
"This",
"is",
"alias",
"of",
"render",
"method",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Mvc/View/Composer.php#L59-L66 |
230,997 | cygnite/framework | src/Cygnite/Mvc/View/Composer.php | Composer.compose | public function compose(string $view, array $data = [], \Closure $callback = null)
{
if ($callback instanceof \Closure) {
$content = $this->render($view, $data, true)->content();
return $callback($this, $content);
}
return $this->render($view, $data, true)->content(... | php | public function compose(string $view, array $data = [], \Closure $callback = null)
{
if ($callback instanceof \Closure) {
$content = $this->render($view, $data, true)->content();
return $callback($this, $content);
}
return $this->render($view, $data, true)->content(... | [
"public",
"function",
"compose",
"(",
"string",
"$",
"view",
",",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"\\",
"Closure",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"callback",
"instanceof",
"\\",
"Closure",
")",
"{",
"$",
"content",
... | This function is alias of create method
If user want to access render function statically.
<code>
View::compose('view-name', $data);
View::compose('view-name', $data, function ($view, $content)
{
$view->setLayout('layouts.base');
});
</code>
@param string $view
@param array $data
@param callable|\Closure $callback
@... | [
"This",
"function",
"is",
"alias",
"of",
"create",
"method",
"If",
"user",
"want",
"to",
"access",
"render",
"function",
"statically",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Mvc/View/Composer.php#L86-L95 |
230,998 | cygnite/framework | src/Cygnite/Mvc/View/Composer.php | Composer.render | public function render(string $view, array $params = [], $return = false)
{
$params = array_merge($params, ['view' => $this]);
/*
* Check if template engine is set as true
* then call template and return from here
*/
if ($this->templateEngine !== false) {
... | php | public function render(string $view, array $params = [], $return = false)
{
$params = array_merge($params, ['view' => $this]);
/*
* Check if template engine is set as true
* then call template and return from here
*/
if ($this->templateEngine !== false) {
... | [
"public",
"function",
"render",
"(",
"string",
"$",
"view",
",",
"array",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"return",
"=",
"false",
")",
"{",
"$",
"params",
"=",
"array_merge",
"(",
"$",
"params",
",",
"[",
"'view'",
"=>",
"$",
"this",
"]",
... | This function is to load requested view file.
Render PHP View With Layout:
-------------------------------
$this->render('Apps.Views.home:welcome', []);
$content = $this->render('Apps.Views.home:welcome', [], true)->content();
return Response::make($content);
Render Twig template:
---------------------
//path : View... | [
"This",
"function",
"is",
"to",
"load",
"requested",
"view",
"file",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Mvc/View/Composer.php#L123-L159 |
230,999 | cygnite/framework | src/Cygnite/Mvc/View/Composer.php | Composer.registerViewEvent | protected function registerViewEvent(string $view)
{
if ($this->has($view)) {
$class = $this->get($view);
if (is_callable($class)) {
return $class($this);
}
$this->viewShared = $this->container()->make($class);
if (!method_exists... | php | protected function registerViewEvent(string $view)
{
if ($this->has($view)) {
$class = $this->get($view);
if (is_callable($class)) {
return $class($this);
}
$this->viewShared = $this->container()->make($class);
if (!method_exists... | [
"protected",
"function",
"registerViewEvent",
"(",
"string",
"$",
"view",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"view",
")",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"view",
")",
";",
"if",
"(",
"is_call... | Firing events for the view.
@param $view
@throws ViewNotFoundException | [
"Firing",
"events",
"for",
"the",
"view",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Mvc/View/Composer.php#L167-L183 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.