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,500 | everplays/agavi-form-models-set | src/Elements/FieldsetModel.class.php | Form_Elements_FieldsetModel.html | public function html($client=null)
{
$this->setRendered(true);
$id = self::idPrefix.$this->id;
$return = '<div class="'.self::elementClass.'">';
$result = "<fieldset ".
"id=\"{$id}_container\" ".
">";
if(isset($this->title))
{
$result .= "<legend>{$this->title}</legend>";
}
// children level ... | php | public function html($client=null)
{
$this->setRendered(true);
$id = self::idPrefix.$this->id;
$return = '<div class="'.self::elementClass.'">';
$result = "<fieldset ".
"id=\"{$id}_container\" ".
">";
if(isset($this->title))
{
$result .= "<legend>{$this->title}</legend>";
}
// children level ... | [
"public",
"function",
"html",
"(",
"$",
"client",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setRendered",
"(",
"true",
")",
";",
"$",
"id",
"=",
"self",
"::",
"idPrefix",
".",
"$",
"this",
"->",
"id",
";",
"$",
"return",
"=",
"'<div class=\"'",
".... | generates html presentation of element
@return string generated html for element
@param string $client javascript client library - for validation purpose | [
"generates",
"html",
"presentation",
"of",
"element"
] | 84b76f5facc6cea686ed2872eb6f4bd499f72d0e | https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/FieldsetModel.class.php#L161-L188 |
230,501 | everplays/agavi-form-models-set | src/Elements/FieldsetModel.class.php | Form_Elements_FieldsetModel.parseChildren | public static function parseChildren($config, Form_Elements_FieldsetModel $container)
{
$contextProfile = AgaviConfig::get('core.default_context');
if(is_null($contextProfile))
{
$contextProfile = md5(microtime());
AgaviConfig::set('core.default_context', $contextProfile);
}
$context = AgaviContext::ge... | php | public static function parseChildren($config, Form_Elements_FieldsetModel $container)
{
$contextProfile = AgaviConfig::get('core.default_context');
if(is_null($contextProfile))
{
$contextProfile = md5(microtime());
AgaviConfig::set('core.default_context', $contextProfile);
}
$context = AgaviContext::ge... | [
"public",
"static",
"function",
"parseChildren",
"(",
"$",
"config",
",",
"Form_Elements_FieldsetModel",
"$",
"container",
")",
"{",
"$",
"contextProfile",
"=",
"AgaviConfig",
"::",
"get",
"(",
"'core.default_context'",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
... | parses children & adds them into given fieldset
@param object $config
@param Form_Elements_FieldsetModel $container fieldset | [
"parses",
"children",
"&",
"adds",
"them",
"into",
"given",
"fieldset"
] | 84b76f5facc6cea686ed2872eb6f4bd499f72d0e | https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/FieldsetModel.class.php#L196-L255 |
230,502 | everplays/agavi-form-models-set | src/Elements/FieldsetModel.class.php | Form_Elements_FieldsetModel.fromJson | public static function fromJson($config, Form_Elements_FieldsetModel $form=null)
{
$contextProfile = AgaviConfig::get('core.default_context');
if(is_null($contextProfile))
{
$contextProfile = md5(microtime());
AgaviConfig::set('core.default_context', $contextProfile);
}
$context = AgaviContext::getInst... | php | public static function fromJson($config, Form_Elements_FieldsetModel $form=null)
{
$contextProfile = AgaviConfig::get('core.default_context');
if(is_null($contextProfile))
{
$contextProfile = md5(microtime());
AgaviConfig::set('core.default_context', $contextProfile);
}
$context = AgaviContext::getInst... | [
"public",
"static",
"function",
"fromJson",
"(",
"$",
"config",
",",
"Form_Elements_FieldsetModel",
"$",
"form",
"=",
"null",
")",
"{",
"$",
"contextProfile",
"=",
"AgaviConfig",
"::",
"get",
"(",
"'core.default_context'",
")",
";",
"if",
"(",
"is_null",
"(",
... | parses config object from extjs
@param object $config lazy configuration of extjs
@param Form_FormModel $form
@return Form_Elements_FieldsetModel | [
"parses",
"config",
"object",
"from",
"extjs"
] | 84b76f5facc6cea686ed2872eb6f4bd499f72d0e | https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/FieldsetModel.class.php#L264-L297 |
230,503 | everplays/agavi-form-models-set | src/Elements/DateFieldModel.class.php | Form_Elements_DateFieldModel.setValue | public function setValue($value)
{
if(is_numeric($value))
$value = (int) $value;
if(is_string($value))
$value = strtotime($value);
$value = date('Y/m/d', $value);
$value = parent::setValue($value);
return $value;
} | php | public function setValue($value)
{
if(is_numeric($value))
$value = (int) $value;
if(is_string($value))
$value = strtotime($value);
$value = date('Y/m/d', $value);
$value = parent::setValue($value);
return $value;
} | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"value",
")",
")",
"$",
"value",
"=",
"(",
"int",
")",
"$",
"value",
";",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
")",
"$",
"value",
"=",
... | prepare date before checking validation
@param mixed $value
@return int | [
"prepare",
"date",
"before",
"checking",
"validation"
] | 84b76f5facc6cea686ed2872eb6f4bd499f72d0e | https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/Elements/DateFieldModel.class.php#L169-L178 |
230,504 | everplays/agavi-form-models-set | src/ElementModel.class.php | Form_ElementModel.setConfiguration | public function setConfiguration($configuration)
{
if(is_array($configuration) or is_object($configuration))
foreach($configuration as $name => $value)
{
$this->{$name} = $value;
}
} | php | public function setConfiguration($configuration)
{
if(is_array($configuration) or is_object($configuration))
foreach($configuration as $name => $value)
{
$this->{$name} = $value;
}
} | [
"public",
"function",
"setConfiguration",
"(",
"$",
"configuration",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"configuration",
")",
"or",
"is_object",
"(",
"$",
"configuration",
")",
")",
"foreach",
"(",
"$",
"configuration",
"as",
"$",
"name",
"=>",
"$"... | sets configutation by given array
@param mixed $configuration | [
"sets",
"configutation",
"by",
"given",
"array"
] | 84b76f5facc6cea686ed2872eb6f4bd499f72d0e | https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/ElementModel.class.php#L69-L76 |
230,505 | everplays/agavi-form-models-set | src/ElementModel.class.php | Form_ElementModel.addChild | public function addChild(Form_ElementModel $child)
{
if(!$this->allowChildren)
{
throw new Exception(__CLASS__." doesn't support children");
}
$this->children[] = $child;
} | php | public function addChild(Form_ElementModel $child)
{
if(!$this->allowChildren)
{
throw new Exception(__CLASS__." doesn't support children");
}
$this->children[] = $child;
} | [
"public",
"function",
"addChild",
"(",
"Form_ElementModel",
"$",
"child",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"allowChildren",
")",
"{",
"throw",
"new",
"Exception",
"(",
"__CLASS__",
".",
"\" doesn't support children\"",
")",
";",
"}",
"$",
"this",... | adds a new child to element
@param Form_ElementModel $child new child to get added | [
"adds",
"a",
"new",
"child",
"to",
"element"
] | 84b76f5facc6cea686ed2872eb6f4bd499f72d0e | https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/ElementModel.class.php#L143-L150 |
230,506 | everplays/agavi-form-models-set | src/ElementModel.class.php | Form_ElementModel.setValue | public function setValue($value)
{
// any preparation goes here, for example casting to int
$errors = $this->getValidationErrors($value);
// if specific validation existed would go here & if
// anything goes wrong will put error message into errors
if(!empty($errors))
throw $this->getContext()->getModel('... | php | public function setValue($value)
{
// any preparation goes here, for example casting to int
$errors = $this->getValidationErrors($value);
// if specific validation existed would go here & if
// anything goes wrong will put error message into errors
if(!empty($errors))
throw $this->getContext()->getModel('... | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"// any preparation goes here, for example casting to int",
"$",
"errors",
"=",
"$",
"this",
"->",
"getValidationErrors",
"(",
"$",
"value",
")",
";",
"// if specific validation existed would go here & if",
"/... | prepares given value before regular validation check, also a good place
for having element specifc validation check
@param mixed $value
@return mixed | [
"prepares",
"given",
"value",
"before",
"regular",
"validation",
"check",
"also",
"a",
"good",
"place",
"for",
"having",
"element",
"specifc",
"validation",
"check"
] | 84b76f5facc6cea686ed2872eb6f4bd499f72d0e | https://github.com/everplays/agavi-form-models-set/blob/84b76f5facc6cea686ed2872eb6f4bd499f72d0e/src/ElementModel.class.php#L196-L205 |
230,507 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_templatecompilerbase.php | Smarty_Internal_TemplateCompilerBase.postFilter | public function postFilter($code)
{
// run post filter if on code
if (!empty($code) &&
(isset($this->smarty->autoload_filters[ 'post' ]) || isset($this->smarty->registered_filters[ 'post' ]))
) {
return $this->smarty->ext->_filterHandler->runFilter('post', $code, $thi... | php | public function postFilter($code)
{
// run post filter if on code
if (!empty($code) &&
(isset($this->smarty->autoload_filters[ 'post' ]) || isset($this->smarty->registered_filters[ 'post' ]))
) {
return $this->smarty->ext->_filterHandler->runFilter('post', $code, $thi... | [
"public",
"function",
"postFilter",
"(",
"$",
"code",
")",
"{",
"// run post filter if on code",
"if",
"(",
"!",
"empty",
"(",
"$",
"code",
")",
"&&",
"(",
"isset",
"(",
"$",
"this",
"->",
"smarty",
"->",
"autoload_filters",
"[",
"'post'",
"]",
")",
"||"... | Optionally process compiled code by post filter
@param string $code compiled code
@return string
@throws \SmartyException | [
"Optionally",
"process",
"compiled",
"code",
"by",
"post",
"filter"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_templatecompilerbase.php#L423-L433 |
230,508 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_templatecompilerbase.php | Smarty_Internal_TemplateCompilerBase.preFilter | public function preFilter($_content)
{
// run pre filter if required
if ($_content != '' &&
((isset($this->smarty->autoload_filters[ 'pre' ]) || isset($this->smarty->registered_filters[ 'pre' ])))
) {
return $this->smarty->ext->_filterHandler->runFilter('pre', $_conte... | php | public function preFilter($_content)
{
// run pre filter if required
if ($_content != '' &&
((isset($this->smarty->autoload_filters[ 'pre' ]) || isset($this->smarty->registered_filters[ 'pre' ])))
) {
return $this->smarty->ext->_filterHandler->runFilter('pre', $_conte... | [
"public",
"function",
"preFilter",
"(",
"$",
"_content",
")",
"{",
"// run pre filter if required",
"if",
"(",
"$",
"_content",
"!=",
"''",
"&&",
"(",
"(",
"isset",
"(",
"$",
"this",
"->",
"smarty",
"->",
"autoload_filters",
"[",
"'pre'",
"]",
")",
"||",
... | Run optional prefilter
@param string $_content template source
@return string
@throws \SmartyException | [
"Run",
"optional",
"prefilter"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_templatecompilerbase.php#L443-L453 |
230,509 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_templatecompilerbase.php | Smarty_Internal_TemplateCompilerBase.processText | public function processText($text)
{
if ((string) $text != '') {
$store = array();
$_store = 0;
$_offset = 0;
if ($this->parser->strip) {
if (strpos($text, '<') !== false) {
// capture html elements not to be messed with
... | php | public function processText($text)
{
if ((string) $text != '') {
$store = array();
$_store = 0;
$_offset = 0;
if ($this->parser->strip) {
if (strpos($text, '<') !== false) {
// capture html elements not to be messed with
... | [
"public",
"function",
"processText",
"(",
"$",
"text",
")",
"{",
"if",
"(",
"(",
"string",
")",
"$",
"text",
"!=",
"''",
")",
"{",
"$",
"store",
"=",
"array",
"(",
")",
";",
"$",
"_store",
"=",
"0",
";",
"$",
"_offset",
"=",
"0",
";",
"if",
"... | This method is called from parser to process a text content section
- remove text from inheritance child templates as they may generate output
- strip text if strip is enabled
@param string $text
@return null|\Smarty_Internal_ParseTree_Text | [
"This",
"method",
"is",
"called",
"from",
"parser",
"to",
"process",
"a",
"text",
"content",
"section",
"-",
"remove",
"text",
"from",
"inheritance",
"child",
"templates",
"as",
"they",
"may",
"generate",
"output",
"-",
"strip",
"text",
"if",
"strip",
"is",
... | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_templatecompilerbase.php#L785-L837 |
230,510 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_parsetree_tag.php | Smarty_Internal_ParseTree_Tag.assign_to_var | public function assign_to_var(Smarty_Internal_Templateparser $parser)
{
$var = sprintf('$_tmp%d', ++ Smarty_Internal_Templateparser::$prefix_number);
$tmp = $parser->compiler->appendCode('<?php ob_start();?>', $this->data);
$tmp = $parser->compiler->appendCode($tmp, "<?php {$var}=ob_get_clea... | php | public function assign_to_var(Smarty_Internal_Templateparser $parser)
{
$var = sprintf('$_tmp%d', ++ Smarty_Internal_Templateparser::$prefix_number);
$tmp = $parser->compiler->appendCode('<?php ob_start();?>', $this->data);
$tmp = $parser->compiler->appendCode($tmp, "<?php {$var}=ob_get_clea... | [
"public",
"function",
"assign_to_var",
"(",
"Smarty_Internal_Templateparser",
"$",
"parser",
")",
"{",
"$",
"var",
"=",
"sprintf",
"(",
"'$_tmp%d'",
",",
"++",
"Smarty_Internal_Templateparser",
"::",
"$",
"prefix_number",
")",
";",
"$",
"tmp",
"=",
"$",
"parser"... | Return complied code that loads the evaluated output of buffer content into a temporary variable
@param \Smarty_Internal_Templateparser $parser
@return string template code | [
"Return",
"complied",
"code",
"that",
"loads",
"the",
"evaluated",
"output",
"of",
"buffer",
"content",
"into",
"a",
"temporary",
"variable"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_parsetree_tag.php#L60-L68 |
230,511 | inetprocess/libsugarcrm | src/System.php | System.rebuildExtensions | public function rebuildExtensions(array $modules = array(), $user_id = '1')
{
$this->setUpQuickRepair($user_id);
$repair = new \RepairAndClear();
$repair->repairAndClearAll(
array('rebuildExtensions'),
$modules
);
return $this->getMessages();
} | php | public function rebuildExtensions(array $modules = array(), $user_id = '1')
{
$this->setUpQuickRepair($user_id);
$repair = new \RepairAndClear();
$repair->repairAndClearAll(
array('rebuildExtensions'),
$modules
);
return $this->getMessages();
} | [
"public",
"function",
"rebuildExtensions",
"(",
"array",
"$",
"modules",
"=",
"array",
"(",
")",
",",
"$",
"user_id",
"=",
"'1'",
")",
"{",
"$",
"this",
"->",
"setUpQuickRepair",
"(",
"$",
"user_id",
")",
";",
"$",
"repair",
"=",
"new",
"\\",
"RepairAn... | Rebuild only Extensions.
@param array $modules Rebuild only the specified modules
@param string $user_id User id of the admin user
@return array Messages | [
"Rebuild",
"only",
"Extensions",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/System.php#L109-L118 |
230,512 | inetprocess/libsugarcrm | src/System.php | System.setUpQuickRepair | private function setUpQuickRepair($user_id = '1')
{
// Config ang language
$sugarConfig = $this->getEntryPoint()->getApplication()->getSugarConfig();
// Force setting the admin user.
$this->getEntryPoint()->setCurrentUser($user_id);
$currentLanguage = $sugarConfig['default_la... | php | private function setUpQuickRepair($user_id = '1')
{
// Config ang language
$sugarConfig = $this->getEntryPoint()->getApplication()->getSugarConfig();
// Force setting the admin user.
$this->getEntryPoint()->setCurrentUser($user_id);
$currentLanguage = $sugarConfig['default_la... | [
"private",
"function",
"setUpQuickRepair",
"(",
"$",
"user_id",
"=",
"'1'",
")",
"{",
"// Config ang language",
"$",
"sugarConfig",
"=",
"$",
"this",
"->",
"getEntryPoint",
"(",
")",
"->",
"getApplication",
"(",
")",
"->",
"getSugarConfig",
"(",
")",
";",
"/... | Prepare all the necessary thing to run a repair and rebuild
ob is also started to catch any output | [
"Prepare",
"all",
"the",
"necessary",
"thing",
"to",
"run",
"a",
"repair",
"and",
"rebuild",
"ob",
"is",
"also",
"started",
"to",
"catch",
"any",
"output"
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/System.php#L135-L147 |
230,513 | inetprocess/libsugarcrm | src/System.php | System.parseOutput | public function parseOutput($message)
{
$message = preg_replace('#<script.*</script>#i', '', $message);
$message = preg_replace('#<(br\s*/?|/h3)>#i', PHP_EOL, $message);
$message = trim(strip_tags($message));
$message = preg_replace('#'.PHP_EOL.'{2,}#', PHP_EOL, $message);
$t... | php | public function parseOutput($message)
{
$message = preg_replace('#<script.*</script>#i', '', $message);
$message = preg_replace('#<(br\s*/?|/h3)>#i', PHP_EOL, $message);
$message = trim(strip_tags($message));
$message = preg_replace('#'.PHP_EOL.'{2,}#', PHP_EOL, $message);
$t... | [
"public",
"function",
"parseOutput",
"(",
"$",
"message",
")",
"{",
"$",
"message",
"=",
"preg_replace",
"(",
"'#<script.*</script>#i'",
",",
"''",
",",
"$",
"message",
")",
";",
"$",
"message",
"=",
"preg_replace",
"(",
"'#<(br\\s*/?|/h3)>#i'",
",",
"PHP_EOL"... | Parse ouput of ob to remove html
and store messages. | [
"Parse",
"ouput",
"of",
"ob",
"to",
"remove",
"html",
"and",
"store",
"messages",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/System.php#L153-L161 |
230,514 | cygnite/framework | src/Cygnite/Alias/Manager.php | Manager.getInstance | public static function getInstance(array $aliases = []) : Manager
{
if (is_null(static::$instance)) {
return static::$instance = new static($aliases);
}
static::$instance->alias($aliases);
return static::$instance;
} | php | public static function getInstance(array $aliases = []) : Manager
{
if (is_null(static::$instance)) {
return static::$instance = new static($aliases);
}
static::$instance->alias($aliases);
return static::$instance;
} | [
"public",
"static",
"function",
"getInstance",
"(",
"array",
"$",
"aliases",
"=",
"[",
"]",
")",
":",
"Manager",
"{",
"if",
"(",
"is_null",
"(",
"static",
"::",
"$",
"instance",
")",
")",
"{",
"return",
"static",
"::",
"$",
"instance",
"=",
"new",
"s... | Get or create the singleton alias manager instance.
@param array $aliases
@return Manager | [
"Get",
"or",
"create",
"the",
"singleton",
"alias",
"manager",
"instance",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Alias/Manager.php#L50-L59 |
230,515 | cygnite/framework | src/Cygnite/Alias/Manager.php | Manager.alias | public function alias(array $class = [], string $alias = null) : Manager
{
if (!is_array($class)) {
$this->set($class, $alias);
return $this;
}
$this->aliases = array_merge($this->get(), $class);
return $this;
} | php | public function alias(array $class = [], string $alias = null) : Manager
{
if (!is_array($class)) {
$this->set($class, $alias);
return $this;
}
$this->aliases = array_merge($this->get(), $class);
return $this;
} | [
"public",
"function",
"alias",
"(",
"array",
"$",
"class",
"=",
"[",
"]",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"Manager",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"class",
")",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"cla... | Set number of alias of class as array.
@param array $class
@param string $alias
@return Manager | [
"Set",
"number",
"of",
"alias",
"of",
"class",
"as",
"array",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Alias/Manager.php#L68-L79 |
230,516 | cygnite/framework | src/Cygnite/Alias/Manager.php | Manager.namespace | public function namespace(string $namespace, string $alias = null) : Manager
{
$this->namespaces[] = [trim($namespace, '\\'), trim($alias, '\\')];
return $this;
} | php | public function namespace(string $namespace, string $alias = null) : Manager
{
$this->namespaces[] = [trim($namespace, '\\'), trim($alias, '\\')];
return $this;
} | [
"public",
"function",
"namespace",
"(",
"string",
"$",
"namespace",
",",
"string",
"$",
"alias",
"=",
"null",
")",
":",
"Manager",
"{",
"$",
"this",
"->",
"namespaces",
"[",
"]",
"=",
"[",
"trim",
"(",
"$",
"namespace",
",",
"'\\\\'",
")",
",",
"trim... | Register a namespace alias.
@param $namespace
@param $alias
@return Manager | [
"Register",
"a",
"namespace",
"alias",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Alias/Manager.php#L88-L93 |
230,517 | cygnite/framework | src/Cygnite/Alias/Manager.php | Manager.get | public function get(string $alias = null)
{
if (is_null($alias)) {
return $this->aliases;
}
return $this->has($alias) ? $this->aliases[$alias] : false;
} | php | public function get(string $alias = null)
{
if (is_null($alias)) {
return $this->aliases;
}
return $this->has($alias) ? $this->aliases[$alias] : false;
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"alias",
")",
")",
"{",
"return",
"$",
"this",
"->",
"aliases",
";",
"}",
"return",
"$",
"this",
"->",
"has",
"(",
"$",
"alias",
")",... | Returns the value stored in stack.
@param string|null $alias
@return array|bool|mixed | [
"Returns",
"the",
"value",
"stored",
"in",
"stack",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Alias/Manager.php#L115-L122 |
230,518 | cygnite/framework | src/Cygnite/Alias/Manager.php | Manager.resolveNamespaceAlias | public function resolveNamespaceAlias(string $alias)
{
foreach ($this->namespaces as $namespace) {
list($className, $aliasTo) = $namespace;
if (false == strpos($alias, $aliasTo)) {
if (!empty($aliasTo)) {
$alias = substr($alias, strlen($aliasTo) +... | php | public function resolveNamespaceAlias(string $alias)
{
foreach ($this->namespaces as $namespace) {
list($className, $aliasTo) = $namespace;
if (false == strpos($alias, $aliasTo)) {
if (!empty($aliasTo)) {
$alias = substr($alias, strlen($aliasTo) +... | [
"public",
"function",
"resolveNamespaceAlias",
"(",
"string",
"$",
"alias",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"namespaces",
"as",
"$",
"namespace",
")",
"{",
"list",
"(",
"$",
"className",
",",
"$",
"aliasTo",
")",
"=",
"$",
"namespace",
";",
... | Resolve namespace alias and return class name.
@param string $alias
@return bool|string | [
"Resolve",
"namespace",
"alias",
"and",
"return",
"class",
"name",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Alias/Manager.php#L154-L169 |
230,519 | cygnite/framework | src/Cygnite/Alias/Manager.php | Manager.resolve | public function resolve(string $alias) : bool
{
// return false if alias already resolved.
if (in_array($alias, $this->resolved)) {
return false;
}
$this->resolved[] = $alias;
// Resolve class alias if set.
if ($this->has($alias)) {
$class = ... | php | public function resolve(string $alias) : bool
{
// return false if alias already resolved.
if (in_array($alias, $this->resolved)) {
return false;
}
$this->resolved[] = $alias;
// Resolve class alias if set.
if ($this->has($alias)) {
$class = ... | [
"public",
"function",
"resolve",
"(",
"string",
"$",
"alias",
")",
":",
"bool",
"{",
"// return false if alias already resolved.",
"if",
"(",
"in_array",
"(",
"$",
"alias",
",",
"$",
"this",
"->",
"resolved",
")",
")",
"{",
"return",
"false",
";",
"}",
"$"... | Resolve all aliases.
@param string $alias
@return bool | [
"Resolve",
"all",
"aliases",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Alias/Manager.php#L195-L218 |
230,520 | cygnite/framework | src/Cygnite/Foundation/Application.php | Application.instance | public static function instance(Closure $callback = null, $argument = [])
{
if (!is_null($callback) && $callback instanceof Closure) {
return $callback(static::getInstance($argument));
}
return static::getInstance($argument);
} | php | public static function instance(Closure $callback = null, $argument = [])
{
if (!is_null($callback) && $callback instanceof Closure) {
return $callback(static::getInstance($argument));
}
return static::getInstance($argument);
} | [
"public",
"static",
"function",
"instance",
"(",
"Closure",
"$",
"callback",
"=",
"null",
",",
"$",
"argument",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"callback",
")",
"&&",
"$",
"callback",
"instanceof",
"Closure",
")",
"{",
"... | Returns a Instance of Application either as Closure
or static instance.
@param Closure $callback
@param array $argument
@return Application | [
"Returns",
"a",
"Instance",
"of",
"Application",
"either",
"as",
"Closure",
"or",
"static",
"instance",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Application.php#L93-L100 |
230,521 | cygnite/framework | src/Cygnite/Foundation/Application.php | Application.setLocale | public function setLocale($localization = null)
{
$locale = Config::get('global.config', 'locale');
if (!is_null($localization)) {
$locale = $localization;
}
$fallbackLocale = Config::get('global.config', 'fallback.locale');
$trans = $this->getTranslator();
... | php | public function setLocale($localization = null)
{
$locale = Config::get('global.config', 'locale');
if (!is_null($localization)) {
$locale = $localization;
}
$fallbackLocale = Config::get('global.config', 'fallback.locale');
$trans = $this->getTranslator();
... | [
"public",
"function",
"setLocale",
"(",
"$",
"localization",
"=",
"null",
")",
"{",
"$",
"locale",
"=",
"Config",
"::",
"get",
"(",
"'global.config'",
",",
"'locale'",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"localization",
")",
")",
"{",
"$",
... | Set language to the translator.
@param null $localization
@return locale | [
"Set",
"language",
"to",
"the",
"translator",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Application.php#L204-L217 |
230,522 | cygnite/framework | src/Cygnite/Foundation/Application.php | Application.executeServices | public function executeServices()
{
$serviceProvider = function () {
$path = $this->container->get('app.config');
extract(['app' => $this]);
return include $path.DS.'services.php';
};
return $serviceProvider();
} | php | public function executeServices()
{
$serviceProvider = function () {
$path = $this->container->get('app.config');
extract(['app' => $this]);
return include $path.DS.'services.php';
};
return $serviceProvider();
} | [
"public",
"function",
"executeServices",
"(",
")",
"{",
"$",
"serviceProvider",
"=",
"function",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'app.config'",
")",
";",
"extract",
"(",
"[",
"'app'",
"=>",
"$",
"this... | Execute all registered services. | [
"Execute",
"all",
"registered",
"services",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Application.php#L223-L232 |
230,523 | cygnite/framework | src/Cygnite/Foundation/Application.php | Application.registerServiceProvider | public function registerServiceProvider(array $services = []) : Application
{
foreach ($services as $key => $serviceProvider) {
$this->createProvider($serviceProvider)->register($this->container);
}
return $this;
} | php | public function registerServiceProvider(array $services = []) : Application
{
foreach ($services as $key => $serviceProvider) {
$this->createProvider($serviceProvider)->register($this->container);
}
return $this;
} | [
"public",
"function",
"registerServiceProvider",
"(",
"array",
"$",
"services",
"=",
"[",
"]",
")",
":",
"Application",
"{",
"foreach",
"(",
"$",
"services",
"as",
"$",
"key",
"=>",
"$",
"serviceProvider",
")",
"{",
"$",
"this",
"->",
"createProvider",
"("... | We will register all service providers into application.
@param array $services
@return $this | [
"We",
"will",
"register",
"all",
"service",
"providers",
"into",
"application",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Application.php#L251-L258 |
230,524 | cygnite/framework | src/Cygnite/Foundation/Application.php | Application.setServiceController | public function setServiceController($key, $class)
{
$this->container[$key] = function () use ($class) {
$serviceController = $this->container->singleton(\Cygnite\Mvc\Controller\ServiceController::class);
$instance = new $class($serviceController, $this->container);
$serv... | php | public function setServiceController($key, $class)
{
$this->container[$key] = function () use ($class) {
$serviceController = $this->container->singleton(\Cygnite\Mvc\Controller\ServiceController::class);
$instance = new $class($serviceController, $this->container);
$serv... | [
"public",
"function",
"setServiceController",
"(",
"$",
"key",
",",
"$",
"class",
")",
"{",
"$",
"this",
"->",
"container",
"[",
"$",
"key",
"]",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"class",
")",
"{",
"$",
"serviceController",
"=",
"$",
"this... | Set service controller.
@param $key
@param $class
@return void | [
"Set",
"service",
"controller",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Application.php#L278-L287 |
230,525 | cygnite/framework | src/Cygnite/Foundation/Application.php | Application.setPaths | public function setPaths() : ApplicationInterface
{
$this->container->set('app', $this);
$paths = $this->bootstrappers->getBootstrapper()->getPaths();
foreach ($paths->all() as $key => $path) {
$this->container->set($key, $path);
}
return $this;
} | php | public function setPaths() : ApplicationInterface
{
$this->container->set('app', $this);
$paths = $this->bootstrappers->getBootstrapper()->getPaths();
foreach ($paths->all() as $key => $path) {
$this->container->set($key, $path);
}
return $this;
} | [
"public",
"function",
"setPaths",
"(",
")",
":",
"ApplicationInterface",
"{",
"$",
"this",
"->",
"container",
"->",
"set",
"(",
"'app'",
",",
"$",
"this",
")",
";",
"$",
"paths",
"=",
"$",
"this",
"->",
"bootstrappers",
"->",
"getBootstrapper",
"(",
")",... | Set Paths to Container.
@return $this | [
"Set",
"Paths",
"to",
"Container",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Application.php#L315-L325 |
230,526 | cygnite/framework | src/Cygnite/Foundation/Application.php | Application.bootApplication | public function bootApplication(Request $request) : Application
{
/*
| -------------------------------------------------------------------
| Check if script is running via cli and return false
| -------------------------------------------------------------------
|
| W... | php | public function bootApplication(Request $request) : Application
{
/*
| -------------------------------------------------------------------
| Check if script is running via cli and return false
| -------------------------------------------------------------------
|
| W... | [
"public",
"function",
"bootApplication",
"(",
"Request",
"$",
"request",
")",
":",
"Application",
"{",
"/*\n | -------------------------------------------------------------------\n | Check if script is running via cli and return false\n | ----------------------------------... | Set all configurations and boot application.
@return $this | [
"Set",
"all",
"configurations",
"and",
"boot",
"application",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Application.php#L332-L351 |
230,527 | cygnite/framework | src/Cygnite/Foundation/Application.php | Application.registerCoreBootstrappers | protected function registerCoreBootstrappers()
{
foreach ($this->getBootStrappers() as $key => $class) {
$this->container->set($key, $this->compose('\\'.$class));
}
$this->bootstrappers->execute();
return $this;
} | php | protected function registerCoreBootstrappers()
{
foreach ($this->getBootStrappers() as $key => $class) {
$this->container->set($key, $this->compose('\\'.$class));
}
$this->bootstrappers->execute();
return $this;
} | [
"protected",
"function",
"registerCoreBootstrappers",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getBootStrappers",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"class",
")",
"{",
"$",
"this",
"->",
"container",
"->",
"set",
"(",
"$",
"key",
",",
"$"... | We will register all core class into container.
@return instance ContainerAwareInterface | [
"We",
"will",
"register",
"all",
"core",
"class",
"into",
"container",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Application.php#L385-L394 |
230,528 | cygnite/framework | src/Cygnite/Foundation/Application.php | Application.attachEvents | public function attachEvents()
{
$appEvents = $this->container->get('event')->getAppEvents();
if (!empty($appEvents)) {
foreach ($appEvents as $event => $namespace) {
// attach all before and after event to handler
$this->container->get('event')->attach("... | php | public function attachEvents()
{
$appEvents = $this->container->get('event')->getAppEvents();
if (!empty($appEvents)) {
foreach ($appEvents as $event => $namespace) {
// attach all before and after event to handler
$this->container->get('event')->attach("... | [
"public",
"function",
"attachEvents",
"(",
")",
"{",
"$",
"appEvents",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'event'",
")",
"->",
"getAppEvents",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"appEvents",
")",
")",
"{",
"foreach... | Attach all application events to event handler. | [
"Attach",
"all",
"application",
"events",
"to",
"event",
"handler",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Application.php#L428-L438 |
230,529 | cygnite/framework | src/Cygnite/Foundation/Application.php | Application.abort | public function abort(int $code, string $message = '', array $headers = [])
{
if ($code == 404) {
throw new \Cygnite\Exception\Http\HttpNotFoundException($message);
}
throw new \Cygnite\Exception\Http\HttpException($code, $message, null, $headers);
} | php | public function abort(int $code, string $message = '', array $headers = [])
{
if ($code == 404) {
throw new \Cygnite\Exception\Http\HttpNotFoundException($message);
}
throw new \Cygnite\Exception\Http\HttpException($code, $message, null, $headers);
} | [
"public",
"function",
"abort",
"(",
"int",
"$",
"code",
",",
"string",
"$",
"message",
"=",
"''",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"code",
"==",
"404",
")",
"{",
"throw",
"new",
"\\",
"Cygnite",
"\\",
"Except... | Throw an HttpException with the given message.
@param int $code
@param string $message
@param array $headers
@throw \Cygnite\Exception\Http\HttpNotFoundException|Cygnite\Exception\Http\HttpException
@return void | [
"Throw",
"an",
"HttpException",
"with",
"the",
"given",
"message",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Foundation/Application.php#L489-L496 |
230,530 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.resolveConnection | public function resolveConnection()
{
$connection = self::cyrus()->getDatabase();
$this->setDatabaseConnection($connection);
return is_object($this->pdo[$connection]) ? $this->pdo[$connection] : null;
} | php | public function resolveConnection()
{
$connection = self::cyrus()->getDatabase();
$this->setDatabaseConnection($connection);
return is_object($this->pdo[$connection]) ? $this->pdo[$connection] : null;
} | [
"public",
"function",
"resolveConnection",
"(",
")",
"{",
"$",
"connection",
"=",
"self",
"::",
"cyrus",
"(",
")",
"->",
"getDatabase",
"(",
")",
";",
"$",
"this",
"->",
"setDatabaseConnection",
"(",
"$",
"connection",
")",
";",
"return",
"is_object",
"(",... | Get Database Connection Object based on database name
provided into model class.
@return null|object | [
"Get",
"Database",
"Connection",
"Object",
"based",
"on",
"database",
"name",
"provided",
"into",
"model",
"class",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L155-L162 |
230,531 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.insert | public function insert($arguments = [])
{
$ar = null;
$ar = self::cyrus();
/*
| Trigger Before create events if
| defined by user into model class
|
*/
$this->triggerEvent('beforeCreate');
// Build Sql Query and prepare it
$sql = $... | php | public function insert($arguments = [])
{
$ar = null;
$ar = self::cyrus();
/*
| Trigger Before create events if
| defined by user into model class
|
*/
$this->triggerEvent('beforeCreate');
// Build Sql Query and prepare it
$sql = $... | [
"public",
"function",
"insert",
"(",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"ar",
"=",
"null",
";",
"$",
"ar",
"=",
"self",
"::",
"cyrus",
"(",
")",
";",
"/*\n | Trigger Before create events if\n | defined by user into model class\n ... | Insert a record into database.
@param array $arguments
@throws \RuntimeException
@return mixed | [
"Insert",
"a",
"record",
"into",
"database",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L173-L206 |
230,532 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.buildWhereForUpdate | private function buildWhereForUpdate()
{
$whereArray = array_combine($this->where, $this->bindings);
list($whereNew, $condition) = $this->formatWhereToNamePlaceHolder($whereArray);
return [$whereNew, $this->buildWherePlaceholderName($whereNew)];
} | php | private function buildWhereForUpdate()
{
$whereArray = array_combine($this->where, $this->bindings);
list($whereNew, $condition) = $this->formatWhereToNamePlaceHolder($whereArray);
return [$whereNew, $this->buildWherePlaceholderName($whereNew)];
} | [
"private",
"function",
"buildWhereForUpdate",
"(",
")",
"{",
"$",
"whereArray",
"=",
"array_combine",
"(",
"$",
"this",
"->",
"where",
",",
"$",
"this",
"->",
"bindings",
")",
";",
"list",
"(",
"$",
"whereNew",
",",
"$",
"condition",
")",
"=",
"$",
"th... | Build where condition for Update query.
@return array | [
"Build",
"where",
"condition",
"for",
"Update",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L253-L259 |
230,533 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.update | public function update($data, $where = [])
{
/*
| Trigger Before Update events if
| defined by user into model class
|
*/
$this->triggerEvent('beforeUpdate');
if (!empty($where)) {
$whereStr = $this->buildWherePlaceholderName($where);
... | php | public function update($data, $where = [])
{
/*
| Trigger Before Update events if
| defined by user into model class
|
*/
$this->triggerEvent('beforeUpdate');
if (!empty($where)) {
$whereStr = $this->buildWherePlaceholderName($where);
... | [
"public",
"function",
"update",
"(",
"$",
"data",
",",
"$",
"where",
"=",
"[",
"]",
")",
"{",
"/*\n | Trigger Before Update events if\n | defined by user into model class\n |\n */",
"$",
"this",
"->",
"triggerEvent",
"(",
"'beforeUpdate'",
")... | Update record with new values.
@param $args
@throws \Exception
@return mixed | [
"Update",
"record",
"with",
"new",
"values",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L270-L313 |
230,534 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.trash | public function trash($where = null, $multiple = false)
{
$whr = [];
$ar = self::cyrus();
/*
| Trigger Before Delete events if
| defined by user into model class
|
*/
$this->triggerEvent('beforeDelete');
// Bind where conditions
$t... | php | public function trash($where = null, $multiple = false)
{
$whr = [];
$ar = self::cyrus();
/*
| Trigger Before Delete events if
| defined by user into model class
|
*/
$this->triggerEvent('beforeDelete');
// Bind where conditions
$t... | [
"public",
"function",
"trash",
"(",
"$",
"where",
"=",
"null",
",",
"$",
"multiple",
"=",
"false",
")",
"{",
"$",
"whr",
"=",
"[",
"]",
";",
"$",
"ar",
"=",
"self",
"::",
"cyrus",
"(",
")",
";",
"/*\n | Trigger Before Delete events if\n | d... | Trash method.
Delete a row from the table
<code>
$user = new User();
$user->trash(1);
$user->trash([1,4,6,33,54], true)
$user->trash(['id' => 23])
$user->where('name', '=', 'application')->trash();
</code>
@param array $where
$multiple false
@param bool $multiple
@throws \Exception
@internal param \Cygnite\Data... | [
"Trash",
"method",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L339-L376 |
230,535 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder._select | private function _select($column)
{
if ($column === 'all' || $column == '*') {
$this->selectColumns = $this->quoteIdentifier(
self::cyrus()->getTableName()
).'.*';
} else {
if (string_has($column, 'as') || string_has($column, 'AS')) {
... | php | private function _select($column)
{
if ($column === 'all' || $column == '*') {
$this->selectColumns = $this->quoteIdentifier(
self::cyrus()->getTableName()
).'.*';
} else {
if (string_has($column, 'as') || string_has($column, 'AS')) {
... | [
"private",
"function",
"_select",
"(",
"$",
"column",
")",
"{",
"if",
"(",
"$",
"column",
"===",
"'all'",
"||",
"$",
"column",
"==",
"'*'",
")",
"{",
"$",
"this",
"->",
"selectColumns",
"=",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"self",
"::",
"c... | Internally build select Columns.
@param $column
@return $this | [
"Internally",
"build",
"select",
"Columns",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L443-L458 |
230,536 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.orWhereIn | public function orWhereIn($key, $value, $operator = 'IN')
{
$exp = explode(',', $value);
$this->where[] = 'OR OR'.$key.' '.$operator.' ('.$this->createPlaceHolder($exp).') ';
foreach ($exp as $key => $val) {
$this->bindings[$key] = $val;
}
return $this;
} | php | public function orWhereIn($key, $value, $operator = 'IN')
{
$exp = explode(',', $value);
$this->where[] = 'OR OR'.$key.' '.$operator.' ('.$this->createPlaceHolder($exp).') ';
foreach ($exp as $key => $val) {
$this->bindings[$key] = $val;
}
return $this;
} | [
"public",
"function",
"orWhereIn",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"operator",
"=",
"'IN'",
")",
"{",
"$",
"exp",
"=",
"explode",
"(",
"','",
",",
"$",
"value",
")",
";",
"$",
"this",
"->",
"where",
"[",
"]",
"=",
"'OR OR'",
".",
... | Where conditions with "or".
@param $key
@param $value
@param string $operator
@return $this | [
"Where",
"conditions",
"with",
"or",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L546-L556 |
230,537 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.having | public function having($column, $operator = '=', $value = null)
{
$this->havingType = 'AND';
return $this->addCondition('having', $column, $operator, $value);
} | php | public function having($column, $operator = '=', $value = null)
{
$this->havingType = 'AND';
return $this->addCondition('having', $column, $operator, $value);
} | [
"public",
"function",
"having",
"(",
"$",
"column",
",",
"$",
"operator",
"=",
"'='",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"havingType",
"=",
"'AND'",
";",
"return",
"$",
"this",
"->",
"addCondition",
"(",
"'having'",
",",
"$"... | Add having clause to the query.
@param $column
@param string $operator
@param null $value
@return $this | [
"Add",
"having",
"clause",
"to",
"the",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L567-L572 |
230,538 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.orHaving | public function orHaving($column, $operator = '=', $value = null)
{
$this->havingType = 'OR';
return $this->addCondition('having', $column, $operator, $value);
} | php | public function orHaving($column, $operator = '=', $value = null)
{
$this->havingType = 'OR';
return $this->addCondition('having', $column, $operator, $value);
} | [
"public",
"function",
"orHaving",
"(",
"$",
"column",
",",
"$",
"operator",
"=",
"'='",
",",
"$",
"value",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"havingType",
"=",
"'OR'",
";",
"return",
"$",
"this",
"->",
"addCondition",
"(",
"'having'",
",",
"$... | Add having clause to the query prefixing OR keyword.
@param $column
@param string $operator
@param null $value
@return $this|Builder | [
"Add",
"having",
"clause",
"to",
"the",
"query",
"prefixing",
"OR",
"keyword",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L583-L588 |
230,539 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.addCondition | protected function addCondition($type, $column, $separator, $value)
{
$multiple = is_array($column) ? $column : [$column => $value];
foreach ($multiple as $key => $val) {
// Add the table name in case of ambiguous columns
if (count($this->joinSources) > 0 && string_has($key... | php | protected function addCondition($type, $column, $separator, $value)
{
$multiple = is_array($column) ? $column : [$column => $value];
foreach ($multiple as $key => $val) {
// Add the table name in case of ambiguous columns
if (count($this->joinSources) > 0 && string_has($key... | [
"protected",
"function",
"addCondition",
"(",
"$",
"type",
",",
"$",
"column",
",",
"$",
"separator",
",",
"$",
"value",
")",
"{",
"$",
"multiple",
"=",
"is_array",
"(",
"$",
"column",
")",
"?",
"$",
"column",
":",
"[",
"$",
"column",
"=>",
"$",
"v... | Method to compile a simple column separated value for HAVING clause.
If column passed as array, we will add condition for each column.
@param $type
@param $column
@param $separator
@param $value
@return $this | [
"Method",
"to",
"compile",
"a",
"simple",
"column",
"separated",
"value",
"for",
"HAVING",
"clause",
".",
"If",
"column",
"passed",
"as",
"array",
"we",
"will",
"add",
"condition",
"for",
"each",
"column",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L601-L619 |
230,540 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.bindCondition | protected function bindCondition($type, $key, $values = [])
{
$conditionHolder = "{$type}Conditions";
if (!is_array($values)) {
$values = [$values];
}
array_push($this->$conditionHolder, [$key, $values]);
return $this;
} | php | protected function bindCondition($type, $key, $values = [])
{
$conditionHolder = "{$type}Conditions";
if (!is_array($values)) {
$values = [$values];
}
array_push($this->$conditionHolder, [$key, $values]);
return $this;
} | [
"protected",
"function",
"bindCondition",
"(",
"$",
"type",
",",
"$",
"key",
",",
"$",
"values",
"=",
"[",
"]",
")",
"{",
"$",
"conditionHolder",
"=",
"\"{$type}Conditions\"",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"$",
"... | Build Having Conditions for the query.
@param $type
@param $key
@param array $values
@return $this | [
"Build",
"Having",
"Conditions",
"for",
"the",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L645-L655 |
230,541 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.makeConditions | protected function makeConditions($type, $join = 'AND')
{
$conditionHolder = "{$type}Conditions";
// If there are no clauses, return empty string
if (count($this->$conditionHolder) === 0) {
return '';
}
$conditions = [];
/*
* Bind all values to... | php | protected function makeConditions($type, $join = 'AND')
{
$conditionHolder = "{$type}Conditions";
// If there are no clauses, return empty string
if (count($this->$conditionHolder) === 0) {
return '';
}
$conditions = [];
/*
* Bind all values to... | [
"protected",
"function",
"makeConditions",
"(",
"$",
"type",
",",
"$",
"join",
"=",
"'AND'",
")",
"{",
"$",
"conditionHolder",
"=",
"\"{$type}Conditions\"",
";",
"// If there are no clauses, return empty string",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"$",
... | Build a HAVING clause conditions.
@param string $type
@param string $join
@return string | [
"Build",
"a",
"HAVING",
"clause",
"conditions",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L678-L698 |
230,542 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.limit | public function limit($limit, $offset = '')
{
if (is_null($limit)) {
throw new \Exception('Empty parameter given to limit clause ');
}
if (empty($offset) && !empty($limit)) {
$this->limitValue = 0;
$this->offsetValue = intval($limit);
} else {
... | php | public function limit($limit, $offset = '')
{
if (is_null($limit)) {
throw new \Exception('Empty parameter given to limit clause ');
}
if (empty($offset) && !empty($limit)) {
$this->limitValue = 0;
$this->offsetValue = intval($limit);
} else {
... | [
"public",
"function",
"limit",
"(",
"$",
"limit",
",",
"$",
"offset",
"=",
"''",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"limit",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Empty parameter given to limit clause '",
")",
";",
"}",
"if",
... | Limit the record and fetch from database.
@param type $limit
@param string $offset
@throws \Exception
@return $this | [
"Limit",
"the",
"record",
"and",
"fetch",
"from",
"database",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L724-L739 |
230,543 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.orderBy | public function orderBy($column, $orderType = 'ASC')
{
if (empty($column) || is_null($column)) {
throw new \Exception('Empty parameter given to order by clause');
}
$this->orderType = $orderType;
if (is_array($column)) {
$this->columnName = $this->extractArra... | php | public function orderBy($column, $orderType = 'ASC')
{
if (empty($column) || is_null($column)) {
throw new \Exception('Empty parameter given to order by clause');
}
$this->orderType = $orderType;
if (is_array($column)) {
$this->columnName = $this->extractArra... | [
"public",
"function",
"orderBy",
"(",
"$",
"column",
",",
"$",
"orderType",
"=",
"'ASC'",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"column",
")",
"||",
"is_null",
"(",
"$",
"column",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Empty param... | This function to make order for selected query.
@param $column
@param string $orderType
@throws \Exception
@return $this | [
"This",
"function",
"to",
"make",
"order",
"for",
"selected",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L751-L769 |
230,544 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.groupBy | public function groupBy($column)
{
if (is_null($column)) {
throw new \InvalidArgumentException('Cannot pass null argument to '.__METHOD__);
}
if (is_array($column)) {
$this->groupBy = $this->extractArrayAttributes($column);
return $this;
}
... | php | public function groupBy($column)
{
if (is_null($column)) {
throw new \InvalidArgumentException('Cannot pass null argument to '.__METHOD__);
}
if (is_array($column)) {
$this->groupBy = $this->extractArrayAttributes($column);
return $this;
}
... | [
"public",
"function",
"groupBy",
"(",
"$",
"column",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"column",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Cannot pass null argument to '",
".",
"__METHOD__",
")",
";",
"}",
"if",
"(",
"... | Group By function to group columns based on aggregate functions.
@param $column
@throws \InvalidArgumentException
@return $this | [
"Group",
"By",
"function",
"to",
"group",
"columns",
"based",
"on",
"aggregate",
"functions",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L780-L795 |
230,545 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.findAll | public function findAll($type = '')
{
$data = [];
$ar = self::cyrus();
/*
| Trigger before select events defined into
| model class
*/
$this->triggerEvent('beforeSelect');
$this->buildQuery(); // Build Sql Query
try {
$stmt = $... | php | public function findAll($type = '')
{
$data = [];
$ar = self::cyrus();
/*
| Trigger before select events defined into
| model class
*/
$this->triggerEvent('beforeSelect');
$this->buildQuery(); // Build Sql Query
try {
$stmt = $... | [
"public",
"function",
"findAll",
"(",
"$",
"type",
"=",
"''",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"ar",
"=",
"self",
"::",
"cyrus",
"(",
")",
";",
"/*\n | Trigger before select events defined into\n | model class\n */",
"$",
"... | Build and Find all the matching records from database.
By default its returns class with properties values
You can simply pass fetchMode into findAll to get various
format output.
@param string $type
@throws \Exception
@internal param string $type
@return array or object | [
"Build",
"and",
"Find",
"all",
"the",
"matching",
"records",
"from",
"database",
".",
"By",
"default",
"its",
"returns",
"class",
"with",
"properties",
"values",
"You",
"can",
"simply",
"pass",
"fetchMode",
"into",
"findAll",
"to",
"get",
"various",
"format",
... | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L825-L858 |
230,546 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.findOne | public function findOne($type = '')
{
$rows = $this->findAll($type)->asArray();
return isset($rows[0]) ? $rows[0] : null;
} | php | public function findOne($type = '')
{
$rows = $this->findAll($type)->asArray();
return isset($rows[0]) ? $rows[0] : null;
} | [
"public",
"function",
"findOne",
"(",
"$",
"type",
"=",
"''",
")",
"{",
"$",
"rows",
"=",
"$",
"this",
"->",
"findAll",
"(",
"$",
"type",
")",
"->",
"asArray",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"rows",
"[",
"0",
"]",
")",
"?",
"$",
... | This method is alias of findAll, We will get only the
zeroth row from the collection object.
@return object|null | [
"This",
"method",
"is",
"alias",
"of",
"findAll",
"We",
"will",
"get",
"only",
"the",
"zeroth",
"row",
"from",
"the",
"collection",
"object",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L878-L883 |
230,547 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.fetchAs | public function fetchAs($stmt, $type = null)
{
$data = [];
if ((is_null($type) || $type == '') && static::$dataSource) {
$type = 'class';
static::$dataSource = false;
}
switch (strtolower($type)) {
case 'group':
$data = $stmt->fet... | php | public function fetchAs($stmt, $type = null)
{
$data = [];
if ((is_null($type) || $type == '') && static::$dataSource) {
$type = 'class';
static::$dataSource = false;
}
switch (strtolower($type)) {
case 'group':
$data = $stmt->fet... | [
"public",
"function",
"fetchAs",
"(",
"$",
"stmt",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"(",
"is_null",
"(",
"$",
"type",
")",
"||",
"$",
"type",
"==",
"''",
")",
"&&",
"static",
"::",
"$",
"dat... | Allows to fetch records as type specified.
@param $stmt
@param null $type
@return string | [
"Allows",
"to",
"fetch",
"records",
"as",
"type",
"specified",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L893-L927 |
230,548 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.sql | public function sql($sql, $attributes = [])
{
try {
$this->statement = $this->resolveConnection()->prepare($sql);
if (!empty($attributes)) {
$this->statement->execute($attributes);
} else {
$this->statement->execute();
}
... | php | public function sql($sql, $attributes = [])
{
try {
$this->statement = $this->resolveConnection()->prepare($sql);
if (!empty($attributes)) {
$this->statement->execute($attributes);
} else {
$this->statement->execute();
}
... | [
"public",
"function",
"sql",
"(",
"$",
"sql",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"statement",
"=",
"$",
"this",
"->",
"resolveConnection",
"(",
")",
"->",
"prepare",
"(",
"$",
"sql",
")",
";",
"if",
"(... | Build raw queries.
@param string $sql
@param array $attributes
@throws \Exception|\PDOException
@return object pointer $this | [
"Build",
"raw",
"queries",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L979-L994 |
230,549 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.buildFindersWhereCondition | public function buildFindersWhereCondition($method, $arguments, $type = 'And')
{
$condition = [];
$condition = explode($type, str_replace('findBy', '', $method));
if (count($condition) == count($arguments[0])) {
foreach ($condition as $key => $value) {
$field = I... | php | public function buildFindersWhereCondition($method, $arguments, $type = 'And')
{
$condition = [];
$condition = explode($type, str_replace('findBy', '', $method));
if (count($condition) == count($arguments[0])) {
foreach ($condition as $key => $value) {
$field = I... | [
"public",
"function",
"buildFindersWhereCondition",
"(",
"$",
"method",
",",
"$",
"arguments",
",",
"$",
"type",
"=",
"'And'",
")",
"{",
"$",
"condition",
"=",
"[",
"]",
";",
"$",
"condition",
"=",
"explode",
"(",
"$",
"type",
",",
"str_replace",
"(",
... | This method is mainly used for building where conditions as array
for dynamic finders.
@param $method String
@param $arguments array
@param $type string
@throws \Exception
@return object | [
"This",
"method",
"is",
"mainly",
"used",
"for",
"building",
"where",
"conditions",
"as",
"array",
"for",
"dynamic",
"finders",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1072-L1094 |
230,550 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.findBySql | public function findBySql($sql)
{
$results = [];
$stmt = $this->resolveConnection()->prepare(trim($sql));
$stmt->execute();
$results = $this->fetchAs($stmt);
return new Collection($results);
} | php | public function findBySql($sql)
{
$results = [];
$stmt = $this->resolveConnection()->prepare(trim($sql));
$stmt->execute();
$results = $this->fetchAs($stmt);
return new Collection($results);
} | [
"public",
"function",
"findBySql",
"(",
"$",
"sql",
")",
"{",
"$",
"results",
"=",
"[",
"]",
";",
"$",
"stmt",
"=",
"$",
"this",
"->",
"resolveConnection",
"(",
")",
"->",
"prepare",
"(",
"trim",
"(",
"$",
"sql",
")",
")",
";",
"$",
"stmt",
"->",... | Find result using raw sql query.
@param $sql
@return Collection | [
"Find",
"result",
"using",
"raw",
"sql",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1103-L1111 |
230,551 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.from | public function from($table)
{
$this->fromTable = (is_null($table)) ? get_class($this) : $table;
return $this;
} | php | public function from($table)
{
$this->fromTable = (is_null($table)) ? get_class($this) : $table;
return $this;
} | [
"public",
"function",
"from",
"(",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"fromTable",
"=",
"(",
"is_null",
"(",
"$",
"table",
")",
")",
"?",
"get_class",
"(",
"$",
"this",
")",
":",
"$",
"table",
";",
"return",
"$",
"this",
";",
"}"
] | Select from table. Alias method of table.
@param $table
@return $this | [
"Select",
"from",
"table",
".",
"Alias",
"method",
"of",
"table",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1120-L1125 |
230,552 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.table | public function table($table)
{
$ar = static::cyrus();
$ar->setTableName($table);
static::$dataSource = true;
return $this;
} | php | public function table($table)
{
$ar = static::cyrus();
$ar->setTableName($table);
static::$dataSource = true;
return $this;
} | [
"public",
"function",
"table",
"(",
"$",
"table",
")",
"{",
"$",
"ar",
"=",
"static",
"::",
"cyrus",
"(",
")",
";",
"$",
"ar",
"->",
"setTableName",
"(",
"$",
"table",
")",
";",
"static",
"::",
"$",
"dataSource",
"=",
"true",
";",
"return",
"$",
... | Set table to run fluent query without model class.
@param $table
@return $this | [
"Set",
"table",
"to",
"run",
"fluent",
"query",
"without",
"model",
"class",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1142-L1149 |
230,553 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.find | public function find($method, $options = [])
{
if (isset($options['primaryKey']) && $method == __FUNCTION__) {
return $this->select('all')
->where(self::cyrus()->getKeyName(), '=', array_shift($options['args']))
->orderBy(self::cyrus()->getKeyName(), 'DESC')
... | php | public function find($method, $options = [])
{
if (isset($options['primaryKey']) && $method == __FUNCTION__) {
return $this->select('all')
->where(self::cyrus()->getKeyName(), '=', array_shift($options['args']))
->orderBy(self::cyrus()->getKeyName(), 'DESC')
... | [
"public",
"function",
"find",
"(",
"$",
"method",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'primaryKey'",
"]",
")",
"&&",
"$",
"method",
"==",
"__FUNCTION__",
")",
"{",
"return",
"$",
"this",
"->"... | Find a single row.
@param $method
@param array $options
@return mixed | [
"Find",
"a",
"single",
"row",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1172-L1182 |
230,554 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.triggerEvent | protected function triggerEvent($event)
{
$instance = static::cyrus();
if (method_exists($instance, $event) &&
in_array($event, $instance->getModelEvents())
) {
$instance->{$event}($instance);
}
} | php | protected function triggerEvent($event)
{
$instance = static::cyrus();
if (method_exists($instance, $event) &&
in_array($event, $instance->getModelEvents())
) {
$instance->{$event}($instance);
}
} | [
"protected",
"function",
"triggerEvent",
"(",
"$",
"event",
")",
"{",
"$",
"instance",
"=",
"static",
"::",
"cyrus",
"(",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"instance",
",",
"$",
"event",
")",
"&&",
"in_array",
"(",
"$",
"event",
",",
"$... | We will trigger event.
@param $event | [
"We",
"will",
"trigger",
"event",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1226-L1235 |
230,555 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.getInsertQuery | private function getInsertQuery($function, $ar, $arguments)
{
$keys = array_keys($arguments);
return $function.' INTO `'.$ar->getDatabase().'`.`'.$ar->getTableName().
'` ('.implode(', ', $keys).')'.
' VALUES(:'.implode(', :', $keys).')';
} | php | private function getInsertQuery($function, $ar, $arguments)
{
$keys = array_keys($arguments);
return $function.' INTO `'.$ar->getDatabase().'`.`'.$ar->getTableName().
'` ('.implode(', ', $keys).')'.
' VALUES(:'.implode(', :', $keys).')';
} | [
"private",
"function",
"getInsertQuery",
"(",
"$",
"function",
",",
"$",
"ar",
",",
"$",
"arguments",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"arguments",
")",
";",
"return",
"$",
"function",
".",
"' INTO `'",
".",
"$",
"ar",
"->",
"getData... | Get insert sql statement.
@param $function
@param $ar
@param $arguments
@return string | [
"Get",
"insert",
"sql",
"statement",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1246-L1253 |
230,556 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.getUpdateQuery | private function getUpdateQuery($data, $function)
{
$ar = static::cyrus();
$data = (empty($data)) ? $ar->getAttributes() : $data;
/*
| we will unset primary key from given array
| This will avoid sql error (SQLSTATE[HY000]: General error: 2031)
*/
unset($da... | php | private function getUpdateQuery($data, $function)
{
$ar = static::cyrus();
$data = (empty($data)) ? $ar->getAttributes() : $data;
/*
| we will unset primary key from given array
| This will avoid sql error (SQLSTATE[HY000]: General error: 2031)
*/
unset($da... | [
"private",
"function",
"getUpdateQuery",
"(",
"$",
"data",
",",
"$",
"function",
")",
"{",
"$",
"ar",
"=",
"static",
"::",
"cyrus",
"(",
")",
";",
"$",
"data",
"=",
"(",
"empty",
"(",
"$",
"data",
")",
")",
"?",
"$",
"ar",
"->",
"getAttributes",
... | Get update sql statement.
@param $data
@param $function
@return string | [
"Get",
"update",
"sql",
"statement",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1263-L1281 |
230,557 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.bindParam | private function bindParam($stmt)
{
// Bind parameters
for ($i = 1; $i <= count($this->bindings); $i++) {
$stmt->bindParam($i, $this->bindings[$i - 1]);
}
} | php | private function bindParam($stmt)
{
// Bind parameters
for ($i = 1; $i <= count($this->bindings); $i++) {
$stmt->bindParam($i, $this->bindings[$i - 1]);
}
} | [
"private",
"function",
"bindParam",
"(",
"$",
"stmt",
")",
"{",
"// Bind parameters",
"for",
"(",
"$",
"i",
"=",
"1",
";",
"$",
"i",
"<=",
"count",
"(",
"$",
"this",
"->",
"bindings",
")",
";",
"$",
"i",
"++",
")",
"{",
"$",
"stmt",
"->",
"bindPa... | We will bind Parameters to execute queries.
@param $stmt | [
"We",
"will",
"bind",
"Parameters",
"to",
"execute",
"queries",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1288-L1294 |
230,558 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.createPlaceHolder | private function createPlaceHolder($arguments)
{
foreach (array_keys($arguments) as $key) {
$placeholder[] = substr(str_repeat('?,', count($key)), 0, -1);
}
return implode(',', $placeholder);
} | php | private function createPlaceHolder($arguments)
{
foreach (array_keys($arguments) as $key) {
$placeholder[] = substr(str_repeat('?,', count($key)), 0, -1);
}
return implode(',', $placeholder);
} | [
"private",
"function",
"createPlaceHolder",
"(",
"$",
"arguments",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"arguments",
")",
"as",
"$",
"key",
")",
"{",
"$",
"placeholder",
"[",
"]",
"=",
"substr",
"(",
"str_repeat",
"(",
"'?,'",
",",
"count",
... | Create placeholders for arguments.
@param $arguments
@return string | [
"Create",
"placeholders",
"for",
"arguments",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1311-L1318 |
230,559 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.prepareExceptColumns | private function prepareExceptColumns()
{
$ar = self::cyrus();
if (!method_exists($ar, 'skip')) {
return;
}
// we will get the table schema
$select = Schema::make($this, function ($table) use ($ar) {
$table->database = $ar->getDatabase();
... | php | private function prepareExceptColumns()
{
$ar = self::cyrus();
if (!method_exists($ar, 'skip')) {
return;
}
// we will get the table schema
$select = Schema::make($this, function ($table) use ($ar) {
$table->database = $ar->getDatabase();
... | [
"private",
"function",
"prepareExceptColumns",
"(",
")",
"{",
"$",
"ar",
"=",
"self",
"::",
"cyrus",
"(",
")",
";",
"if",
"(",
"!",
"method_exists",
"(",
"$",
"ar",
",",
"'skip'",
")",
")",
"{",
"return",
";",
"}",
"// we will get the table schema",
"$",... | we will prepare query except columns given in model
and assign it to selectColumns to find the results. | [
"we",
"will",
"prepare",
"query",
"except",
"columns",
"given",
"in",
"model",
"and",
"assign",
"it",
"to",
"selectColumns",
"to",
"find",
"the",
"results",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1358-L1387 |
230,560 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.buildOriginalQuery | private function buildOriginalQuery()
{
return
'SELECT '.$this->buildSelectedColumns().' FROM '.$this->quoteIdentifier(
self::cyrus()->getTableName()
).' '.$this->getWhere().
' '.$this->getGroupBy().' '.$this->buildHavingConditions().' '.$this->getOrderBy(... | php | private function buildOriginalQuery()
{
return
'SELECT '.$this->buildSelectedColumns().' FROM '.$this->quoteIdentifier(
self::cyrus()->getTableName()
).' '.$this->getWhere().
' '.$this->getGroupBy().' '.$this->buildHavingConditions().' '.$this->getOrderBy(... | [
"private",
"function",
"buildOriginalQuery",
"(",
")",
"{",
"return",
"'SELECT '",
".",
"$",
"this",
"->",
"buildSelectedColumns",
"(",
")",
".",
"' FROM '",
".",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"self",
"::",
"cyrus",
"(",
")",
"->",
"getTableName... | We can use this method to debug query which
executed last.
@return string | [
"We",
"can",
"use",
"this",
"method",
"to",
"debug",
"query",
"which",
"executed",
"last",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1411-L1418 |
230,561 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.all | public function all($arguments)
{
if (isset($arguments[0]['orderBy'])) {
$exp = [];
$exp = explode(' ', $arguments[0]['orderBy']);
$this->orderBy($this->quoteIdentifier($exp[0]), (isset($exp[1])) ? strtoupper($exp[1]) : 'ASC');
} else {
$this->orderBy(... | php | public function all($arguments)
{
if (isset($arguments[0]['orderBy'])) {
$exp = [];
$exp = explode(' ', $arguments[0]['orderBy']);
$this->orderBy($this->quoteIdentifier($exp[0]), (isset($exp[1])) ? strtoupper($exp[1]) : 'ASC');
} else {
$this->orderBy(... | [
"public",
"function",
"all",
"(",
"$",
"arguments",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"arguments",
"[",
"0",
"]",
"[",
"'orderBy'",
"]",
")",
")",
"{",
"$",
"exp",
"=",
"[",
"]",
";",
"$",
"exp",
"=",
"explode",
"(",
"' '",
",",
"$",
"a... | Find all values from the database table.
@param $arguments
@return mixed | [
"Find",
"all",
"values",
"from",
"the",
"database",
"table",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1482-L1528 |
230,562 | cygnite/framework | src/Cygnite/Database/Query/Builder.php | Builder.findFirstOrLast | private function findFirstOrLast($order = null)
{
$orderBy = (!is_null($order)) ? $order : 'ASC';
$fetchObject = $this->select('all')
->orderBy(self::cyrus()->getKeyName(), $orderBy)
->limit(1)
->findAll();
if ($fetchObject == null) {
return ... | php | private function findFirstOrLast($order = null)
{
$orderBy = (!is_null($order)) ? $order : 'ASC';
$fetchObject = $this->select('all')
->orderBy(self::cyrus()->getKeyName(), $orderBy)
->limit(1)
->findAll();
if ($fetchObject == null) {
return ... | [
"private",
"function",
"findFirstOrLast",
"(",
"$",
"order",
"=",
"null",
")",
"{",
"$",
"orderBy",
"=",
"(",
"!",
"is_null",
"(",
"$",
"order",
")",
")",
"?",
"$",
"order",
":",
"'ASC'",
";",
"$",
"fetchObject",
"=",
"$",
"this",
"->",
"select",
"... | Method to find first oof last row of the table.
@param null $order
@return mixed | [
"Method",
"to",
"find",
"first",
"oof",
"last",
"row",
"of",
"the",
"table",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Builder.php#L1547-L1561 |
230,563 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.isExternal | public function isExternal($flag = false)
{
$this->external = true;
if ($flag) {
$this->baseUrl = '';
}
return $this;
} | php | public function isExternal($flag = false)
{
$this->external = true;
if ($flag) {
$this->baseUrl = '';
}
return $this;
} | [
"public",
"function",
"isExternal",
"(",
"$",
"flag",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"external",
"=",
"true",
";",
"if",
"(",
"$",
"flag",
")",
"{",
"$",
"this",
"->",
"baseUrl",
"=",
"''",
";",
"}",
"return",
"$",
"this",
";",
"}"
] | We will check if external true,
if so then we will set the base url as empty
so that user can give his own path to load assets.
@param bool $flag
@return $this | [
"We",
"will",
"check",
"if",
"external",
"true",
"if",
"so",
"then",
"we",
"will",
"set",
"the",
"base",
"url",
"as",
"empty",
"so",
"that",
"user",
"can",
"give",
"his",
"own",
"path",
"to",
"load",
"assets",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L85-L94 |
230,564 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.dump | public function dump($name)
{
// Check {style.final} and display only combined asset into browser
if (
$this->combine && string_has($name, '.') &&
isset($this->combinedAssets[$this->tag[$this->where]][$name])
) {
$this->render($this->combinedAssets[$this->... | php | public function dump($name)
{
// Check {style.final} and display only combined asset into browser
if (
$this->combine && string_has($name, '.') &&
isset($this->combinedAssets[$this->tag[$this->where]][$name])
) {
$this->render($this->combinedAssets[$this->... | [
"public",
"function",
"dump",
"(",
"$",
"name",
")",
"{",
"// Check {style.final} and display only combined asset into browser",
"if",
"(",
"$",
"this",
"->",
"combine",
"&&",
"string_has",
"(",
"$",
"name",
",",
"'.'",
")",
"&&",
"isset",
"(",
"$",
"this",
"-... | We will render all assets into browser.
@param $name
@return void | [
"We",
"will",
"render",
"all",
"assets",
"into",
"browser",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L156-L169 |
230,565 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.render | private function render($data)
{
foreach ($data as $key => $asset) {
echo $this->stripCarriage($asset).PHP_EOL;
}
} | php | private function render($data)
{
foreach ($data as $key => $asset) {
echo $this->stripCarriage($asset).PHP_EOL;
}
} | [
"private",
"function",
"render",
"(",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"asset",
")",
"{",
"echo",
"$",
"this",
"->",
"stripCarriage",
"(",
"$",
"asset",
")",
".",
"PHP_EOL",
";",
"}",
"}"
] | Render assets into browser.
@param $data | [
"Render",
"assets",
"into",
"browser",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L176-L181 |
230,566 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.combine | public function combine($name, $path, $file, $compress = false)
{
$this->combine = true;
if (file_exists($this->container->get('root').DS.$path.$file)) {
$cssAsset = file_get_contents($this->container->get('root').DS.$path.$file);
if (string_has($cssAsset, '@generator')) {
... | php | public function combine($name, $path, $file, $compress = false)
{
$this->combine = true;
if (file_exists($this->container->get('root').DS.$path.$file)) {
$cssAsset = file_get_contents($this->container->get('root').DS.$path.$file);
if (string_has($cssAsset, '@generator')) {
... | [
"public",
"function",
"combine",
"(",
"$",
"name",
",",
"$",
"path",
",",
"$",
"file",
",",
"$",
"compress",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"combine",
"=",
"true",
";",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"container",
"->"... | We will combine all assets tagged to the given key
and make a final file which will contain all asset
source.
$asset->add('style', array('path' => ''))
->add('style', array('path' => ''))
->combine('style', 'final_css', 'assets/css/final.css');
@param $name
@param $path
@param $file
@param bool $compre... | [
"We",
"will",
"combine",
"all",
"assets",
"tagged",
"to",
"the",
"given",
"key",
"and",
"make",
"a",
"final",
"file",
"which",
"will",
"contain",
"all",
"asset",
"source",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L207-L247 |
230,567 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.style | public function style($href, $media = '', $title = '')
{
$media = (is_null($media)) ? 'media=all' : $media;
$title = (!is_null($title)) ? 'title= "'.$title.'"' : '';
$this->setLocation($href, strtolower(__FUNCTION__));
if (is_null($href)) {
throw new InvalidArgumentExce... | php | public function style($href, $media = '', $title = '')
{
$media = (is_null($media)) ? 'media=all' : $media;
$title = (!is_null($title)) ? 'title= "'.$title.'"' : '';
$this->setLocation($href, strtolower(__FUNCTION__));
if (is_null($href)) {
throw new InvalidArgumentExce... | [
"public",
"function",
"style",
"(",
"$",
"href",
",",
"$",
"media",
"=",
"''",
",",
"$",
"title",
"=",
"''",
")",
"{",
"$",
"media",
"=",
"(",
"is_null",
"(",
"$",
"media",
")",
")",
"?",
"'media=all'",
":",
"$",
"media",
";",
"$",
"title",
"="... | Generate a link to a stylesheet file.
<code>
// Generate a link to a stylesheet file
Asset::css('css/cygnite.css');
</code>
@internal param $href
@internal param string $media
@internal param string $title
@param $href
@param $media
@param $title
@throws \InvalidArgumentException
@return string | [
"Generate",
"a",
"link",
"to",
"a",
"stylesheet",
"file",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L489-L519 |
230,568 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.loadAssetsFromDir | private function loadAssetsFromDir($href, $attr, $title, $type = 'style')
{
$path = str_replace('\\', '/', $href);
$assets = glob($path.'*');
foreach ($assets as $src) {
($type == 'style') ? $this->setStyle($attr, $src, $title) : $this->setScript($src, $attr);
}
} | php | private function loadAssetsFromDir($href, $attr, $title, $type = 'style')
{
$path = str_replace('\\', '/', $href);
$assets = glob($path.'*');
foreach ($assets as $src) {
($type == 'style') ? $this->setStyle($attr, $src, $title) : $this->setScript($src, $attr);
}
} | [
"private",
"function",
"loadAssetsFromDir",
"(",
"$",
"href",
",",
"$",
"attr",
",",
"$",
"title",
",",
"$",
"type",
"=",
"'style'",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"href",
")",
";",
"$",
"assets",
"=... | Include all the stylesheets from the path.
@param $href
@param $attr
@param $title
@param string $type
@return void | [
"Include",
"all",
"the",
"stylesheets",
"from",
"the",
"path",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L554-L562 |
230,569 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.setStyle | private function setStyle($media, $style, $title)
{
$this->assets[$this->tag[$this->where]][strtolower(__FUNCTION__)][] = (string)
static::$stylesheet.' '.$media.'
'.$title.' href="'.$this->getBaseUrl().$style.'" >'.PHP_EOL;
} | php | private function setStyle($media, $style, $title)
{
$this->assets[$this->tag[$this->where]][strtolower(__FUNCTION__)][] = (string)
static::$stylesheet.' '.$media.'
'.$title.' href="'.$this->getBaseUrl().$style.'" >'.PHP_EOL;
} | [
"private",
"function",
"setStyle",
"(",
"$",
"media",
",",
"$",
"style",
",",
"$",
"title",
")",
"{",
"$",
"this",
"->",
"assets",
"[",
"$",
"this",
"->",
"tag",
"[",
"$",
"this",
"->",
"where",
"]",
"]",
"[",
"strtolower",
"(",
"__FUNCTION__",
")"... | We will set the styles into assets array.
@param $media
@param $style
@param $title
@return void | [
"We",
"will",
"set",
"the",
"styles",
"into",
"assets",
"array",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L573-L578 |
230,570 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.getBaseUrl | public function getBaseUrl()
{
if ($this->external == false) {
return $this->baseUrl = Url::getBase();
}
return $this->baseUrl;
} | php | public function getBaseUrl()
{
if ($this->external == false) {
return $this->baseUrl = Url::getBase();
}
return $this->baseUrl;
} | [
"public",
"function",
"getBaseUrl",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"external",
"==",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"baseUrl",
"=",
"Url",
"::",
"getBase",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"baseUrl",
"... | get the base url. | [
"get",
"the",
"base",
"url",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L583-L590 |
230,571 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.setScript | private function setScript($src, $attributes)
{
$this->assets[$this->tag[$this->where]][strtolower(__FUNCTION__)][] = (string)
static::$script.'
src="'.Url::getBase().$src.'"'.$this->addAttributes($attributes).'></script>'.PHP_EOL;
} | php | private function setScript($src, $attributes)
{
$this->assets[$this->tag[$this->where]][strtolower(__FUNCTION__)][] = (string)
static::$script.'
src="'.Url::getBase().$src.'"'.$this->addAttributes($attributes).'></script>'.PHP_EOL;
} | [
"private",
"function",
"setScript",
"(",
"$",
"src",
",",
"$",
"attributes",
")",
"{",
"$",
"this",
"->",
"assets",
"[",
"$",
"this",
"->",
"tag",
"[",
"$",
"this",
"->",
"where",
"]",
"]",
"[",
"strtolower",
"(",
"__FUNCTION__",
")",
"]",
"[",
"]"... | We will set the script into assets array.
@param $src
@param $attributes | [
"We",
"will",
"set",
"the",
"script",
"into",
"assets",
"array",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L598-L603 |
230,572 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.addAttributes | public function addAttributes($attributes, $html = [])
{
if (!empty($attributes)) {
foreach ($attributes as $key => $value) {
if (!is_null($value)) {
$html[] = $key.'="'.Html::entities($value).'"';
}
}
}
return (cou... | php | public function addAttributes($attributes, $html = [])
{
if (!empty($attributes)) {
foreach ($attributes as $key => $value) {
if (!is_null($value)) {
$html[] = $key.'="'.Html::entities($value).'"';
}
}
}
return (cou... | [
"public",
"function",
"addAttributes",
"(",
"$",
"attributes",
",",
"$",
"html",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"attributes",
")",
")",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
... | Form Html attributes from array.
@false array $attributes
@param array $attributes
@param array $html
@return string | [
"Form",
"Html",
"attributes",
"from",
"array",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L615-L626 |
230,573 | cygnite/framework | src/Cygnite/AssetManager/Asset.php | Asset.link | public function link($url, $name = null, $attributes = [])
{
$name = (is_null($name)) ? $url : $name;
$this->setLocation($url, strtolower(__FUNCTION__));
$lingTag = '';
$lingTag = '<a href="'.$this->getBaseUrl().Html::entities($url).'"
'.$this->addAttributes($attributes).'>'... | php | public function link($url, $name = null, $attributes = [])
{
$name = (is_null($name)) ? $url : $name;
$this->setLocation($url, strtolower(__FUNCTION__));
$lingTag = '';
$lingTag = '<a href="'.$this->getBaseUrl().Html::entities($url).'"
'.$this->addAttributes($attributes).'>'... | [
"public",
"function",
"link",
"(",
"$",
"url",
",",
"$",
"name",
"=",
"null",
",",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"name",
"=",
"(",
"is_null",
"(",
"$",
"name",
")",
")",
"?",
"$",
"url",
":",
"$",
"name",
";",
"$",
"this",
... | Generate anchor link.
@false string $url
@false string $name
@false array $attributes
@param $url
@param null $name
@param array $attributes
@return string | [
"Generate",
"anchor",
"link",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/Asset.php#L699-L718 |
230,574 | kaliop-uk/ezworkflowenginebundle | ezpublish_legacy/ezworkflowenginebridge/eventtypes/event/ezworkflowenginehook/ezworkflowenginehooktype.php | eZWorkflowEngineHookType.getsignalName | protected function getsignalName( $triggerName, $operationName )
{
if ( !isset( self::$signalMapping[$operationName][$triggerName] ) )
{
return $triggerName . '_' . $operationName;
}
return self::$signalMapping[$operationName][$triggerName];
} | php | protected function getsignalName( $triggerName, $operationName )
{
if ( !isset( self::$signalMapping[$operationName][$triggerName] ) )
{
return $triggerName . '_' . $operationName;
}
return self::$signalMapping[$operationName][$triggerName];
} | [
"protected",
"function",
"getsignalName",
"(",
"$",
"triggerName",
",",
"$",
"operationName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"signalMapping",
"[",
"$",
"operationName",
"]",
"[",
"$",
"triggerName",
"]",
")",
")",
"{",
"return... | Returns the eZ5 Signal known to map to the eZ4 Operation. If mapping is unknown, the eZ4 Operation name is returned
@param string $triggerName
@param string $operationName
@return string mixed | [
"Returns",
"the",
"eZ5",
"Signal",
"known",
"to",
"map",
"to",
"the",
"eZ4",
"Operation",
".",
"If",
"mapping",
"is",
"unknown",
"the",
"eZ4",
"Operation",
"name",
"is",
"returned"
] | 1540eff00b64b6db692ec865c9d25b0179b4b638 | https://github.com/kaliop-uk/ezworkflowenginebundle/blob/1540eff00b64b6db692ec865c9d25b0179b4b638/ezpublish_legacy/ezworkflowenginebridge/eventtypes/event/ezworkflowenginehook/ezworkflowenginehooktype.php#L98-L106 |
230,575 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_method_setdebugtemplate.php | Smarty_Internal_Method_SetDebugTemplate.setDebugTemplate | public function setDebugTemplate(Smarty_Internal_TemplateBase $obj, $tpl_name)
{
$smarty = isset($obj->smarty) ? $obj->smarty : $obj;
if (!is_readable($tpl_name)) {
throw new SmartyException("Unknown file '{$tpl_name}'");
}
$smarty->debug_tpl = $tpl_name;
return $... | php | public function setDebugTemplate(Smarty_Internal_TemplateBase $obj, $tpl_name)
{
$smarty = isset($obj->smarty) ? $obj->smarty : $obj;
if (!is_readable($tpl_name)) {
throw new SmartyException("Unknown file '{$tpl_name}'");
}
$smarty->debug_tpl = $tpl_name;
return $... | [
"public",
"function",
"setDebugTemplate",
"(",
"Smarty_Internal_TemplateBase",
"$",
"obj",
",",
"$",
"tpl_name",
")",
"{",
"$",
"smarty",
"=",
"isset",
"(",
"$",
"obj",
"->",
"smarty",
")",
"?",
"$",
"obj",
"->",
"smarty",
":",
"$",
"obj",
";",
"if",
"... | set the debug template
@api Smarty::setDebugTemplate()
@param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
@param string $tpl_name
@return \Smarty|\Smarty_Internal_Template
@throws SmartyException if file is not readable | [
"set",
"the",
"debug",
"template"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_method_setdebugtemplate.php#L32-L40 |
230,576 | tapestry-cloud/tapestry | src/Modules/Content/Compile.php | Compile.iterateProjectContentTypes | private function iterateProjectContentTypes(ContentTypeFactory $contentTypes, Project $project, OutputInterface $output)
{
/** @var ContentType $contentType */
foreach ($contentTypes->all() as $contentType) {
$output->writeln('[+] Compiling content within ['.$contentType->getName().']');... | php | private function iterateProjectContentTypes(ContentTypeFactory $contentTypes, Project $project, OutputInterface $output)
{
/** @var ContentType $contentType */
foreach ($contentTypes->all() as $contentType) {
$output->writeln('[+] Compiling content within ['.$contentType->getName().']');... | [
"private",
"function",
"iterateProjectContentTypes",
"(",
"ContentTypeFactory",
"$",
"contentTypes",
",",
"Project",
"$",
"project",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"/** @var ContentType $contentType */",
"foreach",
"(",
"$",
"contentTypes",
"->",
"all"... | Iterate over the file list of all content types and add the files they contain to the local compiled file list
also at this point run any generators that the file may be linked to.
@param ContentTypeFactory $contentTypes
@param Project $project
@param OutputInterface $output | [
"Iterate",
"over",
"the",
"file",
"list",
"of",
"all",
"content",
"types",
"and",
"add",
"the",
"files",
"they",
"contain",
"to",
"the",
"local",
"compiled",
"file",
"list",
"also",
"at",
"this",
"point",
"run",
"any",
"generators",
"that",
"the",
"file",
... | f3fc980b2484ccbe609a7f811c65b91254e8720e | https://github.com/tapestry-cloud/tapestry/blob/f3fc980b2484ccbe609a7f811c65b91254e8720e/src/Modules/Content/Compile.php#L131-L155 |
230,577 | tapestry-cloud/tapestry | src/Modules/Content/Compile.php | Compile.collectProjectFilesUseData | private function collectProjectFilesUseData(Project $project)
{
/** @var File $file */
foreach ($project['compiled'] as $file) {
if (! $uses = $file->getData('use')) {
continue;
}
foreach ($uses as $use) {
if (! $items = $file->getD... | php | private function collectProjectFilesUseData(Project $project)
{
/** @var File $file */
foreach ($project['compiled'] as $file) {
if (! $uses = $file->getData('use')) {
continue;
}
foreach ($uses as $use) {
if (! $items = $file->getD... | [
"private",
"function",
"collectProjectFilesUseData",
"(",
"Project",
"$",
"project",
")",
"{",
"/** @var File $file */",
"foreach",
"(",
"$",
"project",
"[",
"'compiled'",
"]",
"as",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"$",
"uses",
"=",
"$",
"file",
"->... | Where a file has a use statement, we now need to collect the associated use data and inject it.
@param Project $project | [
"Where",
"a",
"file",
"has",
"a",
"use",
"statement",
"we",
"now",
"need",
"to",
"collect",
"the",
"associated",
"use",
"data",
"and",
"inject",
"it",
"."
] | f3fc980b2484ccbe609a7f811c65b91254e8720e | https://github.com/tapestry-cloud/tapestry/blob/f3fc980b2484ccbe609a7f811c65b91254e8720e/src/Modules/Content/Compile.php#L162-L191 |
230,578 | tapestry-cloud/tapestry | src/Modules/Content/Compile.php | Compile.executeContentRenderers | private function executeContentRenderers(ContentRendererFactory $contentRenderers)
{
while (! $this->allFilesRendered()) {
foreach ($this->files as &$file) {
if ($file->isRendered()) {
continue;
}
$contentRenderers->renderFile($... | php | private function executeContentRenderers(ContentRendererFactory $contentRenderers)
{
while (! $this->allFilesRendered()) {
foreach ($this->files as &$file) {
if ($file->isRendered()) {
continue;
}
$contentRenderers->renderFile($... | [
"private",
"function",
"executeContentRenderers",
"(",
"ContentRendererFactory",
"$",
"contentRenderers",
")",
"{",
"while",
"(",
"!",
"$",
"this",
"->",
"allFilesRendered",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"files",
"as",
"&",
"$",
"fil... | Execute Content Renderers.
@param ContentRendererFactory $contentRenderers | [
"Execute",
"Content",
"Renderers",
"."
] | f3fc980b2484ccbe609a7f811c65b91254e8720e | https://github.com/tapestry-cloud/tapestry/blob/f3fc980b2484ccbe609a7f811c65b91254e8720e/src/Modules/Content/Compile.php#L234-L245 |
230,579 | tapestry-cloud/tapestry | src/Modules/Content/Compile.php | Compile.mutateFilesToFilesystemInterfaces | private function mutateFilesToFilesystemInterfaces(Project $project, Cache $cache)
{
foreach ($this->files as &$file) {
/** @var CachedFile $cachedFile */
if ($cachedFile = $cache->getItem($file->getUid())) {
if ($cachedFile->check($file)) {
$file ... | php | private function mutateFilesToFilesystemInterfaces(Project $project, Cache $cache)
{
foreach ($this->files as &$file) {
/** @var CachedFile $cachedFile */
if ($cachedFile = $cache->getItem($file->getUid())) {
if ($cachedFile->check($file)) {
$file ... | [
"private",
"function",
"mutateFilesToFilesystemInterfaces",
"(",
"Project",
"$",
"project",
",",
"Cache",
"$",
"cache",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"files",
"as",
"&",
"$",
"file",
")",
"{",
"/** @var CachedFile $cachedFile */",
"if",
"(",
"$"... | Mutate compiled File into FileIgnored, FileCopy or FileWrite entities.
@param Project $project
@param Cache $cache | [
"Mutate",
"compiled",
"File",
"into",
"FileIgnored",
"FileCopy",
"or",
"FileWrite",
"entities",
"."
] | f3fc980b2484ccbe609a7f811c65b91254e8720e | https://github.com/tapestry-cloud/tapestry/blob/f3fc980b2484ccbe609a7f811c65b91254e8720e/src/Modules/Content/Compile.php#L253-L271 |
230,580 | cygnite/framework | src/Cygnite/Database/Query/Joins.php | Joins.join | public function join($table, $constraint, $tableAlias = null)
{
return $this->addJoinSource('', $table, $constraint, $tableAlias);
} | php | public function join($table, $constraint, $tableAlias = null)
{
return $this->addJoinSource('', $table, $constraint, $tableAlias);
} | [
"public",
"function",
"join",
"(",
"$",
"table",
",",
"$",
"constraint",
",",
"$",
"tableAlias",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"addJoinSource",
"(",
"''",
",",
"$",
"table",
",",
"$",
"constraint",
",",
"$",
"tableAlias",
")",
"... | Add a simple JOIN string to the query.
@param $table
@param $constraint
@param null $tableAlias
@return $this | [
"Add",
"a",
"simple",
"JOIN",
"string",
"to",
"the",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Joins.php#L31-L34 |
230,581 | cygnite/framework | src/Cygnite/Database/Query/Joins.php | Joins.leftOuterJoin | public function leftOuterJoin($table, $constraint, $tableAlias = null)
{
return $this->addJoinSource('LEFT OUTER', $table, $constraint, $tableAlias);
} | php | public function leftOuterJoin($table, $constraint, $tableAlias = null)
{
return $this->addJoinSource('LEFT OUTER', $table, $constraint, $tableAlias);
} | [
"public",
"function",
"leftOuterJoin",
"(",
"$",
"table",
",",
"$",
"constraint",
",",
"$",
"tableAlias",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"addJoinSource",
"(",
"'LEFT OUTER'",
",",
"$",
"table",
",",
"$",
"constraint",
",",
"$",
"tabl... | Add a LEFT OUTER JOIN string to the query.
@param $table
@param $constraint
@param null $tableAlias
@return $this | [
"Add",
"a",
"LEFT",
"OUTER",
"JOIN",
"string",
"to",
"the",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Joins.php#L73-L76 |
230,582 | cygnite/framework | src/Cygnite/Database/Query/Joins.php | Joins.rightOuterJoin | public function rightOuterJoin($table, $constraint, $tableAlias = null)
{
return $this->addJoinSource('RIGHT OUTER', $table, $constraint, $tableAlias);
} | php | public function rightOuterJoin($table, $constraint, $tableAlias = null)
{
return $this->addJoinSource('RIGHT OUTER', $table, $constraint, $tableAlias);
} | [
"public",
"function",
"rightOuterJoin",
"(",
"$",
"table",
",",
"$",
"constraint",
",",
"$",
"tableAlias",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"addJoinSource",
"(",
"'RIGHT OUTER'",
",",
"$",
"table",
",",
"$",
"constraint",
",",
"$",
"ta... | Add an RIGHT OUTER JOIN string to the query.
@param $table
@param $constraint
@param null $tableAlias
@return $this | [
"Add",
"an",
"RIGHT",
"OUTER",
"JOIN",
"string",
"to",
"the",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Joins.php#L87-L90 |
230,583 | cygnite/framework | src/Cygnite/Database/Query/Joins.php | Joins.fullOuterJoin | public function fullOuterJoin($table, $constraint, $tableAlias = null)
{
return $this->addJoinSource('FULL OUTER', $table, $constraint, $tableAlias);
} | php | public function fullOuterJoin($table, $constraint, $tableAlias = null)
{
return $this->addJoinSource('FULL OUTER', $table, $constraint, $tableAlias);
} | [
"public",
"function",
"fullOuterJoin",
"(",
"$",
"table",
",",
"$",
"constraint",
",",
"$",
"tableAlias",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"addJoinSource",
"(",
"'FULL OUTER'",
",",
"$",
"table",
",",
"$",
"constraint",
",",
"$",
"tabl... | Add an FULL OUTER JOIN string to the query.
@param $table
@param $constraint
@param null $tableAlias
@return $this | [
"Add",
"an",
"FULL",
"OUTER",
"JOIN",
"string",
"to",
"the",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Joins.php#L101-L104 |
230,584 | cygnite/framework | src/Cygnite/Database/Query/Joins.php | Joins.addJoinSource | protected function addJoinSource($joinOperator, $table, $constraint, $tableAlias = null)
{
$joinOperator = trim("{$joinOperator} JOIN");
$table = Inflector::tabilize($this->quoteIdentifier(lcfirst($table)));
// Add table alias if exists
if (!is_null($tableAlias)) {
$tabl... | php | protected function addJoinSource($joinOperator, $table, $constraint, $tableAlias = null)
{
$joinOperator = trim("{$joinOperator} JOIN");
$table = Inflector::tabilize($this->quoteIdentifier(lcfirst($table)));
// Add table alias if exists
if (!is_null($tableAlias)) {
$tabl... | [
"protected",
"function",
"addJoinSource",
"(",
"$",
"joinOperator",
",",
"$",
"table",
",",
"$",
"constraint",
",",
"$",
"tableAlias",
"=",
"null",
")",
"{",
"$",
"joinOperator",
"=",
"trim",
"(",
"\"{$joinOperator} JOIN\"",
")",
";",
"$",
"table",
"=",
"I... | Query Internal method to add a JOIN string to the query.
The join operators can be one of INNER, LEFT OUTER, CROSS etc - this
will be prepended to JOIN.
firstColumn, operator, secondColumn
Example: ['user.id', '=', 'profile.user_id']
will compile to
ON `user`.`id` = `profile`.`user_id`
The final (optional) argume... | [
"Query",
"Internal",
"method",
"to",
"add",
"a",
"JOIN",
"string",
"to",
"the",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Joins.php#L129-L150 |
230,585 | cygnite/framework | src/Cygnite/Database/Query/Joins.php | Joins.rawJoin | public function rawJoin($query, $constraint, $tableAlias)
{
$this->hasJoin = true;
// Add table alias if present
if (!is_null($tableAlias)) {
$tableAlias = $this->quoteIdentifier($tableAlias);
$query .= " {$tableAlias}";
}
// Build the constraint
... | php | public function rawJoin($query, $constraint, $tableAlias)
{
$this->hasJoin = true;
// Add table alias if present
if (!is_null($tableAlias)) {
$tableAlias = $this->quoteIdentifier($tableAlias);
$query .= " {$tableAlias}";
}
// Build the constraint
... | [
"public",
"function",
"rawJoin",
"(",
"$",
"query",
",",
"$",
"constraint",
",",
"$",
"tableAlias",
")",
"{",
"$",
"this",
"->",
"hasJoin",
"=",
"true",
";",
"// Add table alias if present",
"if",
"(",
"!",
"is_null",
"(",
"$",
"tableAlias",
")",
")",
"{... | Add a RAW JOIN string to the query.
@param $query
@param $constraint
@param $tableAlias
@return $this | [
"Add",
"a",
"RAW",
"JOIN",
"string",
"to",
"the",
"query",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Joins.php#L161-L182 |
230,586 | cygnite/framework | src/Cygnite/Database/Query/Joins.php | Joins.quoteIdentifierSection | protected function quoteIdentifierSection($part)
{
if ($part === '*') {
return $part;
}
$quoteCharacter = '`';
// double up any identifier quotes to escape them
return $quoteCharacter.
str_replace(
$quoteCharacter,
$quoteCharacter.... | php | protected function quoteIdentifierSection($part)
{
if ($part === '*') {
return $part;
}
$quoteCharacter = '`';
// double up any identifier quotes to escape them
return $quoteCharacter.
str_replace(
$quoteCharacter,
$quoteCharacter.... | [
"protected",
"function",
"quoteIdentifierSection",
"(",
"$",
"part",
")",
"{",
"if",
"(",
"$",
"part",
"===",
"'*'",
")",
"{",
"return",
"$",
"part",
";",
"}",
"$",
"quoteCharacter",
"=",
"'`'",
";",
"// double up any identifier quotes to escape them",
"return",... | This method for quoting of a single
part of an identifier.
@param $part
@return string | [
"This",
"method",
"for",
"quoting",
"of",
"a",
"single",
"part",
"of",
"an",
"identifier",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Database/Query/Joins.php#L228-L242 |
230,587 | ctbsea/phalapi-smarty | src/Smarty/sysplugins/smarty_internal_extension_handler.php | Smarty_Internal_Extension_Handler._callExternalMethod | public function _callExternalMethod(Smarty_Internal_Data $data, $name, $args)
{
/* @var Smarty $data ->smarty */
$smarty = isset($data->smarty) ? $data->smarty : $data;
if (!isset($smarty->ext->$name)) {
$class = 'Smarty_Internal_Method_' . ucfirst($name);
if (preg_ma... | php | public function _callExternalMethod(Smarty_Internal_Data $data, $name, $args)
{
/* @var Smarty $data ->smarty */
$smarty = isset($data->smarty) ? $data->smarty : $data;
if (!isset($smarty->ext->$name)) {
$class = 'Smarty_Internal_Method_' . ucfirst($name);
if (preg_ma... | [
"public",
"function",
"_callExternalMethod",
"(",
"Smarty_Internal_Data",
"$",
"data",
",",
"$",
"name",
",",
"$",
"args",
")",
"{",
"/* @var Smarty $data ->smarty */",
"$",
"smarty",
"=",
"isset",
"(",
"$",
"data",
"->",
"smarty",
")",
"?",
"$",
"data",
"->... | Call external Method
@param \Smarty_Internal_Data $data
@param string $name external method names
@param array $args argument array
@return mixed
@throws SmartyException | [
"Call",
"external",
"Method"
] | 4d40da3e4482c0749f3cfd1605265a109a1c495f | https://github.com/ctbsea/phalapi-smarty/blob/4d40da3e4482c0749f3cfd1605265a109a1c495f/src/Smarty/sysplugins/smarty_internal_extension_handler.php#L67-L106 |
230,588 | thrace-project/datagrid-bundle | Twig/Extension/DataGridExtension.php | DataGridExtension.dataGrid | public function dataGrid ($dataGrid)
{
if (!$dataGrid instanceof DataGridInterface){
$dataGrid = $this->container->get('thrace_data_grid.provider')->get($dataGrid);
}
return $this->container->get('templating')->render(
'ThraceDataGridBundle:DataGrid:index.h... | php | public function dataGrid ($dataGrid)
{
if (!$dataGrid instanceof DataGridInterface){
$dataGrid = $this->container->get('thrace_data_grid.provider')->get($dataGrid);
}
return $this->container->get('templating')->render(
'ThraceDataGridBundle:DataGrid:index.h... | [
"public",
"function",
"dataGrid",
"(",
"$",
"dataGrid",
")",
"{",
"if",
"(",
"!",
"$",
"dataGrid",
"instanceof",
"DataGridInterface",
")",
"{",
"$",
"dataGrid",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'thrace_data_grid.provider'",
")",
"->",
... | Rendering initial content of the datagrid
@param DataGridInterface|string $dataGrid
@return string (html response) | [
"Rendering",
"initial",
"content",
"of",
"the",
"datagrid"
] | 07b39d6494336870933756276d6af1ef7039d700 | https://github.com/thrace-project/datagrid-bundle/blob/07b39d6494336870933756276d6af1ef7039d700/Twig/Extension/DataGridExtension.php#L68-L82 |
230,589 | cygnite/framework | src/Cygnite/AssetManager/AssetCollection.php | AssetCollection.make | public static function make(ContainerAwareInterface $container, Closure $callback = null)
{
$collection = new AssetCollection(new Asset($container));
if (is_null($callback)) {
return $collection->asset();
}
return $callback($collection);
} | php | public static function make(ContainerAwareInterface $container, Closure $callback = null)
{
$collection = new AssetCollection(new Asset($container));
if (is_null($callback)) {
return $collection->asset();
}
return $callback($collection);
} | [
"public",
"static",
"function",
"make",
"(",
"ContainerAwareInterface",
"$",
"container",
",",
"Closure",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"collection",
"=",
"new",
"AssetCollection",
"(",
"new",
"Asset",
"(",
"$",
"container",
")",
")",
";",
"... | Create a Asset collection object return callback.
@param ContainerAwareInterface $container
@param callable|null $callback
@return Closure | [
"Create",
"a",
"Asset",
"collection",
"object",
"return",
"callback",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/AssetCollection.php#L47-L56 |
230,590 | cygnite/framework | src/Cygnite/AssetManager/AssetCollection.php | AssetCollection.create | public static function create($class, ContainerAwareInterface $container) : Asset
{
(new $class($a = new Asset($container)))->register();
return static::$asset = $a;
} | php | public static function create($class, ContainerAwareInterface $container) : Asset
{
(new $class($a = new Asset($container)))->register();
return static::$asset = $a;
} | [
"public",
"static",
"function",
"create",
"(",
"$",
"class",
",",
"ContainerAwareInterface",
"$",
"container",
")",
":",
"Asset",
"{",
"(",
"new",
"$",
"class",
"(",
"$",
"a",
"=",
"new",
"Asset",
"(",
"$",
"container",
")",
")",
")",
"->",
"register",... | Register Asset into Asset object and returns
Asset object.
@param $class
@param Closure $callback
@return mixed | [
"Register",
"Asset",
"into",
"Asset",
"object",
"and",
"returns",
"Asset",
"object",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/AssetManager/AssetCollection.php#L66-L71 |
230,591 | inetprocess/libsugarcrm | src/LangFileCleaner.php | LangFileCleaner.clean | public function clean($sort = true, $test = false)
{
$finder = new Finder();
$finder->files()
->in($this->getApplication()->getPath())
->path('/^custom\/include\/language/')
->depth('== 3')
->name('*.lang.php');
$found_one = false;
fore... | php | public function clean($sort = true, $test = false)
{
$finder = new Finder();
$finder->files()
->in($this->getApplication()->getPath())
->path('/^custom\/include\/language/')
->depth('== 3')
->name('*.lang.php');
$found_one = false;
fore... | [
"public",
"function",
"clean",
"(",
"$",
"sort",
"=",
"true",
",",
"$",
"test",
"=",
"false",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"finder",
"->",
"files",
"(",
")",
"->",
"in",
"(",
"$",
"this",
"->",
"getApplicatio... | Clean all sugar language files. | [
"Clean",
"all",
"sugar",
"language",
"files",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/LangFileCleaner.php#L47-L73 |
230,592 | cygnite/framework | src/Cygnite/Mvc/View/Template.php | Template.setDefaultFunctions | public function setDefaultFunctions()
{
$this->setLink() //set link() function
->setTwigBaseUrl(); //set baseUrl() function
foreach ($this->functions as $key => $func) {
$this->twigEnvironment->addFunction($func);
}
} | php | public function setDefaultFunctions()
{
$this->setLink() //set link() function
->setTwigBaseUrl(); //set baseUrl() function
foreach ($this->functions as $key => $func) {
$this->twigEnvironment->addFunction($func);
}
} | [
"public",
"function",
"setDefaultFunctions",
"(",
")",
"{",
"$",
"this",
"->",
"setLink",
"(",
")",
"//set link() function",
"->",
"setTwigBaseUrl",
"(",
")",
";",
"//set baseUrl() function",
"foreach",
"(",
"$",
"this",
"->",
"functions",
"as",
"$",
"key",
"=... | Set default functions for the framework. | [
"Set",
"default",
"functions",
"for",
"the",
"framework",
"."
] | 58d0cc1c946415eb0867d76218bd35166e999093 | https://github.com/cygnite/framework/blob/58d0cc1c946415eb0867d76218bd35166e999093/src/Cygnite/Mvc/View/Template.php#L83-L91 |
230,593 | inetprocess/libsugarcrm | src/LangFile.php | LangFile.getTokenName | public static function getTokenName($token)
{
if (is_int($token[self::T_KEY])) {
return token_name($token[self::T_KEY]);
} else {
return $token[self::T_KEY];
}
} | php | public static function getTokenName($token)
{
if (is_int($token[self::T_KEY])) {
return token_name($token[self::T_KEY]);
} else {
return $token[self::T_KEY];
}
} | [
"public",
"static",
"function",
"getTokenName",
"(",
"$",
"token",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"token",
"[",
"self",
"::",
"T_KEY",
"]",
")",
")",
"{",
"return",
"token_name",
"(",
"$",
"token",
"[",
"self",
"::",
"T_KEY",
"]",
")",
";... | Return the token name as a string. | [
"Return",
"the",
"token",
"name",
"as",
"a",
"string",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/LangFile.php#L71-L78 |
230,594 | inetprocess/libsugarcrm | src/LangFile.php | LangFile.checkVarName | public function checkVarName($var_name)
{
if (empty($var_name)) {
return;
}
if (array_key_exists($var_name, $this->var_blocks)) {
$this->logger->warning("Found duplicate definition for $var_name.");
}
} | php | public function checkVarName($var_name)
{
if (empty($var_name)) {
return;
}
if (array_key_exists($var_name, $this->var_blocks)) {
$this->logger->warning("Found duplicate definition for $var_name.");
}
} | [
"public",
"function",
"checkVarName",
"(",
"$",
"var_name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"var_name",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"array_key_exists",
"(",
"$",
"var_name",
",",
"$",
"this",
"->",
"var_blocks",
")",
")",
"{... | Log a warning if a variable name was already found.
Also check for the global or local version of the same variable.
@param var_name Name of the variable to check. | [
"Log",
"a",
"warning",
"if",
"a",
"variable",
"name",
"was",
"already",
"found",
".",
"Also",
"check",
"for",
"the",
"global",
"or",
"local",
"version",
"of",
"the",
"same",
"variable",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/LangFile.php#L86-L94 |
230,595 | inetprocess/libsugarcrm | src/LangFile.php | LangFile.normalizeVariableName | public function normalizeVariableName($var_name)
{
if (substr($var_name, 0, 8) == '$GLOBALS') {
// Replaces:
// $GLOBALS['test'] => $test
// $GLOBALS [ 'test' ] => $test
$reg = <<<'EOS'
/^\$GLOBALS\s*\[\s*'([^']+)'\s*\]/
EOS;
$var_name = preg_repl... | php | public function normalizeVariableName($var_name)
{
if (substr($var_name, 0, 8) == '$GLOBALS') {
// Replaces:
// $GLOBALS['test'] => $test
// $GLOBALS [ 'test' ] => $test
$reg = <<<'EOS'
/^\$GLOBALS\s*\[\s*'([^']+)'\s*\]/
EOS;
$var_name = preg_repl... | [
"public",
"function",
"normalizeVariableName",
"(",
"$",
"var_name",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"var_name",
",",
"0",
",",
"8",
")",
"==",
"'$GLOBALS'",
")",
"{",
"// Replaces:",
"// $GLOBALS['test'] => $test",
"// $GLOBALS [ 'test' ] => $test",
"$"... | Remove the global part of a variable definition. All variables must be set to their local equivalent. | [
"Remove",
"the",
"global",
"part",
"of",
"a",
"variable",
"definition",
".",
"All",
"variables",
"must",
"be",
"set",
"to",
"their",
"local",
"equivalent",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/LangFile.php#L99-L111 |
230,596 | inetprocess/libsugarcrm | src/LangFile.php | LangFile.getSortedFile | public function getSortedFile($sort = true)
{
if (!$this->tokens->valid()) {
$this->logger->info('File is empty.');
}
while ($this->tokens->valid()) {
$this->logger->info('parsing next block');
$this->parseNextBlock();
}
if ($sort) {
... | php | public function getSortedFile($sort = true)
{
if (!$this->tokens->valid()) {
$this->logger->info('File is empty.');
}
while ($this->tokens->valid()) {
$this->logger->info('parsing next block');
$this->parseNextBlock();
}
if ($sort) {
... | [
"public",
"function",
"getSortedFile",
"(",
"$",
"sort",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"tokens",
"->",
"valid",
"(",
")",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"info",
"(",
"'File is empty.'",
")",
";",
"}",
"whil... | Parse all tokens from the file and return them sorted and cleaned.
@param sort If true it will sort the variables.
@return A string with the original file data sorted. | [
"Parse",
"all",
"tokens",
"from",
"the",
"file",
"and",
"return",
"them",
"sorted",
"and",
"cleaned",
"."
] | 493bb105c29996dc583181431fcb0987fd1fed70 | https://github.com/inetprocess/libsugarcrm/blob/493bb105c29996dc583181431fcb0987fd1fed70/src/LangFile.php#L257-L273 |
230,597 | crodas/SQLParser | src/SQLParser/Parser.php | SQLParser_Parser.tokenName | function tokenName($tokenType)
{
if ($tokenType === 0) {
return 'End of Input';
}
if ($tokenType > 0 && $tokenType < count(self::$yyTokenName)) {
return self::$yyTokenName[$tokenType];
} else {
return "Unknown";
}
} | php | function tokenName($tokenType)
{
if ($tokenType === 0) {
return 'End of Input';
}
if ($tokenType > 0 && $tokenType < count(self::$yyTokenName)) {
return self::$yyTokenName[$tokenType];
} else {
return "Unknown";
}
} | [
"function",
"tokenName",
"(",
"$",
"tokenType",
")",
"{",
"if",
"(",
"$",
"tokenType",
"===",
"0",
")",
"{",
"return",
"'End of Input'",
";",
"}",
"if",
"(",
"$",
"tokenType",
">",
"0",
"&&",
"$",
"tokenType",
"<",
"count",
"(",
"self",
"::",
"$",
... | This function returns the symbolic name associated with a token
value.
@param int
@return string | [
"This",
"function",
"returns",
"the",
"symbolic",
"name",
"associated",
"with",
"a",
"token",
"value",
"."
] | a0241cb8755ed36b2a0d0812503ee71abfbe52ac | https://github.com/crodas/SQLParser/blob/a0241cb8755ed36b2a0d0812503ee71abfbe52ac/src/SQLParser/Parser.php#L1462-L1472 |
230,598 | crodas/SQLParser | src/SQLParser/Parser.php | SQLParser_Parser.yy_reduce | function yy_reduce($yyruleno)
{
//int $yygoto; /* The next state */
//int $yyact; /* The next action */
//mixed $yygotominor; /* The LHS of the rule reduced */
//SQLParser_yyStackEntry $yymsp; /* The top of the parser's stack... | php | function yy_reduce($yyruleno)
{
//int $yygoto; /* The next state */
//int $yyact; /* The next action */
//mixed $yygotominor; /* The LHS of the rule reduced */
//SQLParser_yyStackEntry $yymsp; /* The top of the parser's stack... | [
"function",
"yy_reduce",
"(",
"$",
"yyruleno",
")",
"{",
"//int $yygoto; /* The next state */",
"//int $yyact; /* The next action */",
"//mixed $yygotominor; /* The LHS of the rule reduced */",
"//SQLParser_yyStackEntry $yymsp; /* The to... | Perform a reduce action and the shift that must immediately
follow the reduce.
For a rule such as:
<pre>
A ::= B blah C. { dosomething(); }
</pre>
This function will first call the action, if any, ("dosomething();" in our
example), and then it will pop three states from the stack,
one for each entry on the right-han... | [
"Perform",
"a",
"reduce",
"action",
"and",
"the",
"shift",
"that",
"must",
"immediately",
"follow",
"the",
"reduce",
"."
] | a0241cb8755ed36b2a0d0812503ee71abfbe52ac | https://github.com/crodas/SQLParser/blob/a0241cb8755ed36b2a0d0812503ee71abfbe52ac/src/SQLParser/Parser.php#L2729-L2777 |
230,599 | iionly/tidypics | classes/TidypicsImage.php | TidypicsImage.getViewInfo | public function getViewInfo($viewer_guid = 0) {
if ($viewer_guid == 0) {
$viewer_guid = elgg_get_logged_in_user_guid();
}
$count = elgg_get_annotations([
'guid' => $this->getGUID(),
'annotation_name' => 'tp_view',
'count' => true,
]);
if ($count > 0) {
$views = elgg_get_annotations([
'guid... | php | public function getViewInfo($viewer_guid = 0) {
if ($viewer_guid == 0) {
$viewer_guid = elgg_get_logged_in_user_guid();
}
$count = elgg_get_annotations([
'guid' => $this->getGUID(),
'annotation_name' => 'tp_view',
'count' => true,
]);
if ($count > 0) {
$views = elgg_get_annotations([
'guid... | [
"public",
"function",
"getViewInfo",
"(",
"$",
"viewer_guid",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"viewer_guid",
"==",
"0",
")",
"{",
"$",
"viewer_guid",
"=",
"elgg_get_logged_in_user_guid",
"(",
")",
";",
"}",
"$",
"count",
"=",
"elgg_get_annotations",
"(... | Get the view information for this image
@param $viewer_guid The guid of the viewer
@return array with number of views, number of unique viewers, and number of views for this viewer | [
"Get",
"the",
"view",
"information",
"for",
"this",
"image"
] | 6dc7d2728a7074a28f5440d191e4832b0d04367e | https://github.com/iionly/tidypics/blob/6dc7d2728a7074a28f5440d191e4832b0d04367e/classes/TidypicsImage.php#L136-L186 |
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.