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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5,100 | sgtlambda/fieldwork | src/fieldwork/Form.php | Form.getFormErrors | public function getFormErrors ()
{
return array_map(function (FormValidator $formValidator) {
return $formValidator->getErrorMsg();
}, array_filter($this->validators, function (FormValidator $validator) {
return !$validator->isValid();
}));
} | php | public function getFormErrors ()
{
return array_map(function (FormValidator $formValidator) {
return $formValidator->getErrorMsg();
}, array_filter($this->validators, function (FormValidator $validator) {
return !$validator->isValid();
}));
} | [
"public",
"function",
"getFormErrors",
"(",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"FormValidator",
"$",
"formValidator",
")",
"{",
"return",
"$",
"formValidator",
"->",
"getErrorMsg",
"(",
")",
";",
"}",
",",
"array_filter",
"(",
"$",
"this"... | Get all the error messages for form-wide validators that returned invalid
@return string[] | [
"Get",
"all",
"the",
"error",
"messages",
"for",
"form",
"-",
"wide",
"validators",
"that",
"returned",
"invalid"
] | ba18939c9822db4dc84947d90979cfb0da072cb0 | https://github.com/sgtlambda/fieldwork/blob/ba18939c9822db4dc84947d90979cfb0da072cb0/src/fieldwork/Form.php#L264-L271 |
5,101 | sgtlambda/fieldwork | src/fieldwork/Form.php | Form.getWrapBefore | public function getWrapBefore ()
{
$dataFields = $this->getDataFieldsHTML();
$errors = join(array_map(function ($errorMsg) {
return Form::renderFormError($errorMsg);
}, $this->getFormErrors()));
return "<form " . $this->getAttributesString() . ">" . $errors . $dataFie... | php | public function getWrapBefore ()
{
$dataFields = $this->getDataFieldsHTML();
$errors = join(array_map(function ($errorMsg) {
return Form::renderFormError($errorMsg);
}, $this->getFormErrors()));
return "<form " . $this->getAttributesString() . ">" . $errors . $dataFie... | [
"public",
"function",
"getWrapBefore",
"(",
")",
"{",
"$",
"dataFields",
"=",
"$",
"this",
"->",
"getDataFieldsHTML",
"(",
")",
";",
"$",
"errors",
"=",
"join",
"(",
"array_map",
"(",
"function",
"(",
"$",
"errorMsg",
")",
"{",
"return",
"Form",
"::",
... | Gets the markup that is to be outputted before the actual contents of the form. This method could be used for
even more manual control over outputting with a custom markup.
@return string | [
"Gets",
"the",
"markup",
"that",
"is",
"to",
"be",
"outputted",
"before",
"the",
"actual",
"contents",
"of",
"the",
"form",
".",
"This",
"method",
"could",
"be",
"used",
"for",
"even",
"more",
"manual",
"control",
"over",
"outputting",
"with",
"a",
"custom... | ba18939c9822db4dc84947d90979cfb0da072cb0 | https://github.com/sgtlambda/fieldwork/blob/ba18939c9822db4dc84947d90979cfb0da072cb0/src/fieldwork/Form.php#L278-L285 |
5,102 | sgtlambda/fieldwork | src/fieldwork/Form.php | Form.getFields | public function getFields ($includeInactiveFields = false)
{
$fields = array();
foreach ($this->getChildren(true, $includeInactiveFields) as $component)
if ($component instanceof Field)
array_push($fields, $component);
return $fields;
} | php | public function getFields ($includeInactiveFields = false)
{
$fields = array();
foreach ($this->getChildren(true, $includeInactiveFields) as $component)
if ($component instanceof Field)
array_push($fields, $component);
return $fields;
} | [
"public",
"function",
"getFields",
"(",
"$",
"includeInactiveFields",
"=",
"false",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getChildren",
"(",
"true",
",",
"$",
"includeInactiveFields",
")",
"as",
"$",
"c... | Retrieves an array of this form's fields
@param boolean $includeInactiveFields whether to include inactive fields as well
@return Field[] | [
"Retrieves",
"an",
"array",
"of",
"this",
"form",
"s",
"fields"
] | ba18939c9822db4dc84947d90979cfb0da072cb0 | https://github.com/sgtlambda/fieldwork/blob/ba18939c9822db4dc84947d90979cfb0da072cb0/src/fieldwork/Form.php#L335-L342 |
5,103 | sgtlambda/fieldwork | src/fieldwork/Form.php | Form.submit | private function submit ()
{
foreach ($this->getFields() as $field)
/* @var $field Field */
$field->submit();
$this->isCallbacksubmitted = true;
foreach ($this->callback as $callback)
if (is_callable($callback))
call_user_func($callback, $t... | php | private function submit ()
{
foreach ($this->getFields() as $field)
/* @var $field Field */
$field->submit();
$this->isCallbacksubmitted = true;
foreach ($this->callback as $callback)
if (is_callable($callback))
call_user_func($callback, $t... | [
"private",
"function",
"submit",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getFields",
"(",
")",
"as",
"$",
"field",
")",
"/* @var $field Field */",
"$",
"field",
"->",
"submit",
"(",
")",
";",
"$",
"this",
"->",
"isCallbacksubmitted",
"=",
"tru... | Submits the form internally. You're not usually supposed to call this function directly. | [
"Submits",
"the",
"form",
"internally",
".",
"You",
"re",
"not",
"usually",
"supposed",
"to",
"call",
"this",
"function",
"directly",
"."
] | ba18939c9822db4dc84947d90979cfb0da072cb0 | https://github.com/sgtlambda/fieldwork/blob/ba18939c9822db4dc84947d90979cfb0da072cb0/src/fieldwork/Form.php#L385-L394 |
5,104 | sgtlambda/fieldwork | src/fieldwork/Form.php | Form.process | public function process ()
{
if ($this->isProcessed)
return;
$this->isProcessed = true;
foreach ($this->getFields() as $field)
/* @var $field Field */
$field->preprocess();
$this->isUserSubmitted = $this->getValue($this->getSubmitConfirmFieldName()... | php | public function process ()
{
if ($this->isProcessed)
return;
$this->isProcessed = true;
foreach ($this->getFields() as $field)
/* @var $field Field */
$field->preprocess();
$this->isUserSubmitted = $this->getValue($this->getSubmitConfirmFieldName()... | [
"public",
"function",
"process",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isProcessed",
")",
"return",
";",
"$",
"this",
"->",
"isProcessed",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"getFields",
"(",
")",
"as",
"$",
"field",
")",
... | Check if form was activated, then validates, calls handlers, then submits. Call this function before displaying
the form. | [
"Check",
"if",
"form",
"was",
"activated",
"then",
"validates",
"calls",
"handlers",
"then",
"submits",
".",
"Call",
"this",
"function",
"before",
"displaying",
"the",
"form",
"."
] | ba18939c9822db4dc84947d90979cfb0da072cb0 | https://github.com/sgtlambda/fieldwork/blob/ba18939c9822db4dc84947d90979cfb0da072cb0/src/fieldwork/Form.php#L421-L440 |
5,105 | sgtlambda/fieldwork | src/fieldwork/Form.php | Form.getValues | function getValues ($useName = true, $includeDataFields = true)
{
$values = array();
foreach ($this->getFields() as $field)
/* @var $field Field */
if ($field->getCollectData()) {
$key = $useName ? $field->getName() : $field->getLocalSlug();
... | php | function getValues ($useName = true, $includeDataFields = true)
{
$values = array();
foreach ($this->getFields() as $field)
/* @var $field Field */
if ($field->getCollectData()) {
$key = $useName ? $field->getName() : $field->getLocalSlug();
... | [
"function",
"getValues",
"(",
"$",
"useName",
"=",
"true",
",",
"$",
"includeDataFields",
"=",
"true",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getFields",
"(",
")",
"as",
"$",
"field",
")",
"/* @var $... | Gets a complete associated array containing all the data that needs to be stored
@param bool $useName Whether to use the field name (if not, the fields shorter local slug is used)
@param bool $includeDataFields Whether to include the data fields
@return array | [
"Gets",
"a",
"complete",
"associated",
"array",
"containing",
"all",
"the",
"data",
"that",
"needs",
"to",
"be",
"stored"
] | ba18939c9822db4dc84947d90979cfb0da072cb0 | https://github.com/sgtlambda/fieldwork/blob/ba18939c9822db4dc84947d90979cfb0da072cb0/src/fieldwork/Form.php#L486-L498 |
5,106 | sgtlambda/fieldwork | src/fieldwork/Form.php | Form.setValues | function setValues (array $values = array())
{
foreach ($this->getFields() as $field)
if (array_key_exists($field->getName(), $values))
$field->setValue($values[$field->getName()]);
foreach ($this->dataFields as $dataKey => $dataVal)
if (array_key_exists($data... | php | function setValues (array $values = array())
{
foreach ($this->getFields() as $field)
if (array_key_exists($field->getName(), $values))
$field->setValue($values[$field->getName()]);
foreach ($this->dataFields as $dataKey => $dataVal)
if (array_key_exists($data... | [
"function",
"setValues",
"(",
"array",
"$",
"values",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getFields",
"(",
")",
"as",
"$",
"field",
")",
"if",
"(",
"array_key_exists",
"(",
"$",
"field",
"->",
"getName",
"(",
")",
... | Restores the values from an associated array. Only defined properties will be overwritten
@param array $values | [
"Restores",
"the",
"values",
"from",
"an",
"associated",
"array",
".",
"Only",
"defined",
"properties",
"will",
"be",
"overwritten"
] | ba18939c9822db4dc84947d90979cfb0da072cb0 | https://github.com/sgtlambda/fieldwork/blob/ba18939c9822db4dc84947d90979cfb0da072cb0/src/fieldwork/Form.php#L505-L513 |
5,107 | Sowapps/orpheus-rendering | src/Rendering/HTMLRendering.php | HTMLRendering.display | public function display($layout=null, $env=array()) {
if( $layout === NULL ) {
throw new \Exception("Invalid Rendering Model");
}
$rendering = $this->getCurrentRendering();
if( $rendering ) {
$env += $rendering[1];
}
// TODO Merge layoutStack and rendering stack
$prevLayouts = count(static::$layo... | php | public function display($layout=null, $env=array()) {
if( $layout === NULL ) {
throw new \Exception("Invalid Rendering Model");
}
$rendering = $this->getCurrentRendering();
if( $rendering ) {
$env += $rendering[1];
}
// TODO Merge layoutStack and rendering stack
$prevLayouts = count(static::$layo... | [
"public",
"function",
"display",
"(",
"$",
"layout",
"=",
"null",
",",
"$",
"env",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"layout",
"===",
"NULL",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Invalid Rendering Model\"",
")",
";",
"... | Display the model, allow an absolute path to the template file.
{@inheritDoc}
@see \Orpheus\Rendering\Rendering::display()
@param string $layout The model to use
@param array $env An environment variable | [
"Display",
"the",
"model",
"allow",
"an",
"absolute",
"path",
"to",
"the",
"template",
"file",
"."
] | 415ae6d4f0c2256a67dc76c6fa104d6c3ccb4156 | https://github.com/Sowapps/orpheus-rendering/blob/415ae6d4f0c2256a67dc76c6fa104d6c3ccb4156/src/Rendering/HTMLRendering.php#L124-L147 |
5,108 | Sowapps/orpheus-rendering | src/Rendering/HTMLRendering.php | HTMLRendering.renderReport | public static function renderReport($report, $domain, $type, $stream) {
$report = nl2br($report);
$rendering = new static();
if( $rendering->existsLayoutPath('report-'.$type) ) {
return $rendering->render('report-'.$type, array('Report'=>$report, 'Domain'=>$domain, 'Type'=>$type, 'Stream'=>$stream));
}
if(... | php | public static function renderReport($report, $domain, $type, $stream) {
$report = nl2br($report);
$rendering = new static();
if( $rendering->existsLayoutPath('report-'.$type) ) {
return $rendering->render('report-'.$type, array('Report'=>$report, 'Domain'=>$domain, 'Type'=>$type, 'Stream'=>$stream));
}
if(... | [
"public",
"static",
"function",
"renderReport",
"(",
"$",
"report",
",",
"$",
"domain",
",",
"$",
"type",
",",
"$",
"stream",
")",
"{",
"$",
"report",
"=",
"nl2br",
"(",
"$",
"report",
")",
";",
"$",
"rendering",
"=",
"new",
"static",
"(",
")",
";"... | Render the given report as HTML
@param string $report
@param string $domain
@param string $type
@param string $stream
@return string | [
"Render",
"the",
"given",
"report",
"as",
"HTML"
] | 415ae6d4f0c2256a67dc76c6fa104d6c3ccb4156 | https://github.com/Sowapps/orpheus-rendering/blob/415ae6d4f0c2256a67dc76c6fa104d6c3ccb4156/src/Rendering/HTMLRendering.php#L196-L213 |
5,109 | Sowapps/orpheus-rendering | src/Rendering/HTMLRendering.php | HTMLRendering.addThemeCSSFile | public function addThemeCSSFile($filename, $type=null) {
$this->addCSSURL($this->getCSSURL().$filename, $type);
} | php | public function addThemeCSSFile($filename, $type=null) {
$this->addCSSURL($this->getCSSURL().$filename, $type);
} | [
"public",
"function",
"addThemeCSSFile",
"(",
"$",
"filename",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"addCSSURL",
"(",
"$",
"this",
"->",
"getCSSURL",
"(",
")",
".",
"$",
"filename",
",",
"$",
"type",
")",
";",
"}"
] | Add a theme css file to the list
@param string $filename
@param string $type | [
"Add",
"a",
"theme",
"css",
"file",
"to",
"the",
"list"
] | 415ae6d4f0c2256a67dc76c6fa104d6c3ccb4156 | https://github.com/Sowapps/orpheus-rendering/blob/415ae6d4f0c2256a67dc76c6fa104d6c3ccb4156/src/Rendering/HTMLRendering.php#L221-L223 |
5,110 | Sowapps/orpheus-rendering | src/Rendering/HTMLRendering.php | HTMLRendering.addThemeJSFile | public function addThemeJSFile($filename, $type=null) {
$this->addJSURL($this->getJSURL().$filename, $type);
} | php | public function addThemeJSFile($filename, $type=null) {
$this->addJSURL($this->getJSURL().$filename, $type);
} | [
"public",
"function",
"addThemeJSFile",
"(",
"$",
"filename",
",",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"addJSURL",
"(",
"$",
"this",
"->",
"getJSURL",
"(",
")",
".",
"$",
"filename",
",",
"$",
"type",
")",
";",
"}"
] | Add a theme js file to the list
@param string $filename
@param string $type | [
"Add",
"a",
"theme",
"js",
"file",
"to",
"the",
"list"
] | 415ae6d4f0c2256a67dc76c6fa104d6c3ccb4156 | https://github.com/Sowapps/orpheus-rendering/blob/415ae6d4f0c2256a67dc76c6fa104d6c3ccb4156/src/Rendering/HTMLRendering.php#L251-L253 |
5,111 | sgoendoer/sonic | src/Sonic.php | Sonic.& | public static function &initInstance(EntityAuthData $platform)
{
if(NULL === self::$_instance)
{
self::$_instance = new Sonic();
}
self::$_instance->platformAuthData = $platform;
self::$logger = new Logger('sonic');
self::$logger->pushHandler(new StreamHandler(Configuration::getLogfile()... | php | public static function &initInstance(EntityAuthData $platform)
{
if(NULL === self::$_instance)
{
self::$_instance = new Sonic();
}
self::$_instance->platformAuthData = $platform;
self::$logger = new Logger('sonic');
self::$logger->pushHandler(new StreamHandler(Configuration::getLogfile()... | [
"public",
"static",
"function",
"&",
"initInstance",
"(",
"EntityAuthData",
"$",
"platform",
")",
"{",
"if",
"(",
"NULL",
"===",
"self",
"::",
"$",
"_instance",
")",
"{",
"self",
"::",
"$",
"_instance",
"=",
"new",
"Sonic",
"(",
")",
";",
"}",
"self",
... | initializes the Sonic SDK using EntityAuthData of the platform
@param $config Configuration object
@param $platform EntityAuthData object of the platform
@return The Sonic instance | [
"initializes",
"the",
"Sonic",
"SDK",
"using",
"EntityAuthData",
"of",
"the",
"platform"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L76-L91 |
5,112 | sgoendoer/sonic | src/Sonic.php | Sonic.setSocialRecordCaching | public function setSocialRecordCaching(ISocialRecordCaching $srCachingObject)
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(!array_key_exists('sgoendoer\Sonic\Identity\ISocialRecordCaching', class_implements($srCachingObject)))
{
throw new S... | php | public function setSocialRecordCaching(ISocialRecordCaching $srCachingObject)
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(!array_key_exists('sgoendoer\Sonic\Identity\ISocialRecordCaching', class_implements($srCachingObject)))
{
throw new S... | [
"public",
"function",
"setSocialRecordCaching",
"(",
"ISocialRecordCaching",
"$",
"srCachingObject",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_instance",
"===",
"NULL",
")",
"throw",
"new",
"SonicRuntimeException",
"(",
"'Sonic instance not initialized'",
")",
";",
... | sets the SocialRecordCaching instance
@param $srCachingObject The ISocialRecordCaching instance
@return Sonic instance | [
"sets",
"the",
"SocialRecordCaching",
"instance"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L129-L141 |
5,113 | sgoendoer/sonic | src/Sonic.php | Sonic.socialRecordCachingEnabled | public static function socialRecordCachingEnabled()
{
if(self::$_instance === NULL)
return false;
if(self::$_instance->socialRecordCache === NULL)
return false;
else
return true;
} | php | public static function socialRecordCachingEnabled()
{
if(self::$_instance === NULL)
return false;
if(self::$_instance->socialRecordCache === NULL)
return false;
else
return true;
} | [
"public",
"static",
"function",
"socialRecordCachingEnabled",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_instance",
"===",
"NULL",
")",
"return",
"false",
";",
"if",
"(",
"self",
"::",
"$",
"_instance",
"->",
"socialRecordCache",
"===",
"NULL",
")",
"r... | determines, if SocialRecordCaching is enabled
@return true, if SocialRecordCaching is enabled, else false | [
"determines",
"if",
"SocialRecordCaching",
"is",
"enabled"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L148-L156 |
5,114 | sgoendoer/sonic | src/Sonic.php | Sonic.getSocialRecordCaching | public static function getSocialRecordCaching()
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(self::$_instance->socialRecordCache != NULL)
return self::$_instance->socialRecordCache;
else
return NULL;
} | php | public static function getSocialRecordCaching()
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(self::$_instance->socialRecordCache != NULL)
return self::$_instance->socialRecordCache;
else
return NULL;
} | [
"public",
"static",
"function",
"getSocialRecordCaching",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_instance",
"===",
"NULL",
")",
"throw",
"new",
"SonicRuntimeException",
"(",
"'Sonic instance not initialized'",
")",
";",
"if",
"(",
"self",
"::",
"$",
"_... | returns the SocialRecordCaching instance
@return if set, the SocialRecordCaching instance | [
"returns",
"the",
"SocialRecordCaching",
"instance"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L163-L172 |
5,115 | sgoendoer/sonic | src/Sonic.php | Sonic.setUniqueIDManager | public function setUniqueIDManager(IUniqueIDManager $uniqueIDManagerObject)
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(!array_key_exists('sgoendoer\Sonic\Crypt\IUniqueIDManager', class_implements($uniqueIDManagerObject)))
{
throw new Soni... | php | public function setUniqueIDManager(IUniqueIDManager $uniqueIDManagerObject)
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(!array_key_exists('sgoendoer\Sonic\Crypt\IUniqueIDManager', class_implements($uniqueIDManagerObject)))
{
throw new Soni... | [
"public",
"function",
"setUniqueIDManager",
"(",
"IUniqueIDManager",
"$",
"uniqueIDManagerObject",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_instance",
"===",
"NULL",
")",
"throw",
"new",
"SonicRuntimeException",
"(",
"'Sonic instance not initialized'",
")",
";",
"i... | sets the UniqueIDManager
@param $uniqueIDManagerObject The IUniqueIDManager instance
@return Sonic instance | [
"sets",
"the",
"UniqueIDManager"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L180-L193 |
5,116 | sgoendoer/sonic | src/Sonic.php | Sonic.getUniqueIDManager | public static function getUniqueIDManager()
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(self::$_instance->uniqueIDManager != NULL)
return self::$_instance->uniqueIDManager;
else
return NULL;
} | php | public static function getUniqueIDManager()
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(self::$_instance->uniqueIDManager != NULL)
return self::$_instance->uniqueIDManager;
else
return NULL;
} | [
"public",
"static",
"function",
"getUniqueIDManager",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_instance",
"===",
"NULL",
")",
"throw",
"new",
"SonicRuntimeException",
"(",
"'Sonic instance not initialized'",
")",
";",
"if",
"(",
"self",
"::",
"$",
"_inst... | returns the UniqueIDManager instance, if set
@return UniqueIDManager instance if set, else NULL | [
"returns",
"the",
"UniqueIDManager",
"instance",
"if",
"set"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L200-L209 |
5,117 | sgoendoer/sonic | src/Sonic.php | Sonic.setAccessControlManager | public function setAccessControlManager(AccessControlManager $accessControlManagerObject)
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(!array_key_exists('sgoendoer\Sonic\AccessControl\AccessControlManager', class_parents($accessControlManagerObjec... | php | public function setAccessControlManager(AccessControlManager $accessControlManagerObject)
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(!array_key_exists('sgoendoer\Sonic\AccessControl\AccessControlManager', class_parents($accessControlManagerObjec... | [
"public",
"function",
"setAccessControlManager",
"(",
"AccessControlManager",
"$",
"accessControlManagerObject",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_instance",
"===",
"NULL",
")",
"throw",
"new",
"SonicRuntimeException",
"(",
"'Sonic instance not initialized'",
")... | sets the AccessControlManager
@param $accessControlManagerObject The AccessControlManager instance
@return Sonic instance | [
"sets",
"the",
"AccessControlManager"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L217-L230 |
5,118 | sgoendoer/sonic | src/Sonic.php | Sonic.getAccessControlManager | public static function getAccessControlManager()
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(self::$_instance->accessControlManager != NULL)
return self::$_instance->accessControlManager;
else
throw new AccessControlManagerException('A... | php | public static function getAccessControlManager()
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
if(self::$_instance->accessControlManager != NULL)
return self::$_instance->accessControlManager;
else
throw new AccessControlManagerException('A... | [
"public",
"static",
"function",
"getAccessControlManager",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_instance",
"===",
"NULL",
")",
"throw",
"new",
"SonicRuntimeException",
"(",
"'Sonic instance not initialized'",
")",
";",
"if",
"(",
"self",
"::",
"$",
"... | returns the AccessControlManager instance
@return the AccessControlManager instance | [
"returns",
"the",
"AccessControlManager",
"instance"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L237-L246 |
5,119 | sgoendoer/sonic | src/Sonic.php | Sonic.setPlatformAuthData | public static function setPlatformAuthData(EntityAuthData $entityAuthData)
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
self::$_instance->platformAuthData = $entityAuthData;
return self::$_instance;
} | php | public static function setPlatformAuthData(EntityAuthData $entityAuthData)
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
self::$_instance->platformAuthData = $entityAuthData;
return self::$_instance;
} | [
"public",
"static",
"function",
"setPlatformAuthData",
"(",
"EntityAuthData",
"$",
"entityAuthData",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_instance",
"===",
"NULL",
")",
"throw",
"new",
"SonicRuntimeException",
"(",
"'Sonic instance not initialized'",
")",
";",
... | set the platform's AuthData
@param EntityAuthData object of the platform | [
"set",
"the",
"platform",
"s",
"AuthData"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L253-L261 |
5,120 | sgoendoer/sonic | src/Sonic.php | Sonic.setUserAuthData | public static function setUserAuthData(EntityAuthData $entityAuthData)
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
self::$_instance->userAuthData = $entityAuthData;
self::$_instance->setContext(Sonic::CONTEXT_USER);
return self::$_inst... | php | public static function setUserAuthData(EntityAuthData $entityAuthData)
{
if(self::$_instance === NULL)
throw new SonicRuntimeException('Sonic instance not initialized');
self::$_instance->userAuthData = $entityAuthData;
self::$_instance->setContext(Sonic::CONTEXT_USER);
return self::$_inst... | [
"public",
"static",
"function",
"setUserAuthData",
"(",
"EntityAuthData",
"$",
"entityAuthData",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_instance",
"===",
"NULL",
")",
"throw",
"new",
"SonicRuntimeException",
"(",
"'Sonic instance not initialized'",
")",
";",
"s... | set the user's AuthData
@param EntityAuthData object of the user | [
"set",
"the",
"user",
"s",
"AuthData"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L333-L343 |
5,121 | sgoendoer/sonic | src/Sonic.php | Sonic.getLogger | public static function getLogger()
{
if(self::$logger === NULL)
{
self::$logger = new Logger('sonic');
self::$logger->pushHandler(new StreamHandler(Configuration::getLogfile()));
}
return self::$logger;
} | php | public static function getLogger()
{
if(self::$logger === NULL)
{
self::$logger = new Logger('sonic');
self::$logger->pushHandler(new StreamHandler(Configuration::getLogfile()));
}
return self::$logger;
} | [
"public",
"static",
"function",
"getLogger",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"logger",
"===",
"NULL",
")",
"{",
"self",
"::",
"$",
"logger",
"=",
"new",
"Logger",
"(",
"'sonic'",
")",
";",
"self",
"::",
"$",
"logger",
"->",
"pushHandler"... | return the monolog logger instance
@return the logger instance | [
"return",
"the",
"monolog",
"logger",
"instance"
] | 2c32ebd78607dc3e8558f10a0b7bf881d37fc168 | https://github.com/sgoendoer/sonic/blob/2c32ebd78607dc3e8558f10a0b7bf881d37fc168/src/Sonic.php#L480-L489 |
5,122 | budkit/budkit-framework | src/Budkit/Protocol/Http/Response.php | Response.setCookies | public function setCookies($cookies = [])
{
$this->cookies = ($cookies instanceof Parameters) ? $cookies : new Parameters("cookies", (array)$cookies);
return $this;
} | php | public function setCookies($cookies = [])
{
$this->cookies = ($cookies instanceof Parameters) ? $cookies : new Parameters("cookies", (array)$cookies);
return $this;
} | [
"public",
"function",
"setCookies",
"(",
"$",
"cookies",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"cookies",
"=",
"(",
"$",
"cookies",
"instanceof",
"Parameters",
")",
"?",
"$",
"cookies",
":",
"new",
"Parameters",
"(",
"\"cookies\"",
",",
"(",
"arr... | Sets the response cookies. Be warned that this replaces all cookies;
@param string $cookies
@return void
@author Livingstone Fultang | [
"Sets",
"the",
"response",
"cookies",
".",
"Be",
"warned",
"that",
"this",
"replaces",
"all",
"cookies",
";"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Protocol/Http/Response.php#L136-L142 |
5,123 | budkit/budkit-framework | src/Budkit/Protocol/Http/Response.php | Response.setHeaders | public function setHeaders(array $headers = [])
{
$this->headers = ($headers instanceof Headers) ? $headers : new Headers((array)$headers);
return $this;
} | php | public function setHeaders(array $headers = [])
{
$this->headers = ($headers instanceof Headers) ? $headers : new Headers((array)$headers);
return $this;
} | [
"public",
"function",
"setHeaders",
"(",
"array",
"$",
"headers",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"headers",
"=",
"(",
"$",
"headers",
"instanceof",
"Headers",
")",
"?",
"$",
"headers",
":",
"new",
"Headers",
"(",
"(",
"array",
")",
"$",
... | Sets a HeaderBag containing all headers;
@param string $headers
@return Response
@author Livingstone Fultang | [
"Sets",
"a",
"HeaderBag",
"containing",
"all",
"headers",
";"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Protocol/Http/Response.php#L210-L217 |
5,124 | budkit/budkit-framework | src/Budkit/Protocol/Http/Response.php | Response.addHeader | public function addHeader($key, $value = null)
{
//if loation change code to 320;
$headers = $this->getHeaders();
$headers->set($key, $value);
return $this;
} | php | public function addHeader($key, $value = null)
{
//if loation change code to 320;
$headers = $this->getHeaders();
$headers->set($key, $value);
return $this;
} | [
"public",
"function",
"addHeader",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"//if loation change code to 320;",
"$",
"headers",
"=",
"$",
"this",
"->",
"getHeaders",
"(",
")",
";",
"$",
"headers",
"->",
"set",
"(",
"$",
"key",
",",
"$... | Add a header to the Header bag;
@param string $key
@param string $value
@return void
@author Livingstone Fultang | [
"Add",
"a",
"header",
"to",
"the",
"Header",
"bag",
";"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Protocol/Http/Response.php#L243-L250 |
5,125 | budkit/budkit-framework | src/Budkit/Protocol/Http/Response.php | Response.getContent | public function getContent($packetId = null)
{
if (!isset($this->packetId)) {
return $content = implode("/n", $this->content);
}
//Return the content with PacketId;
return isset($this->content[$packetId]) ? $this->content[$packetId] : "";
} | php | public function getContent($packetId = null)
{
if (!isset($this->packetId)) {
return $content = implode("/n", $this->content);
}
//Return the content with PacketId;
return isset($this->content[$packetId]) ? $this->content[$packetId] : "";
} | [
"public",
"function",
"getContent",
"(",
"$",
"packetId",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"packetId",
")",
")",
"{",
"return",
"$",
"content",
"=",
"implode",
"(",
"\"/n\"",
",",
"$",
"this",
"->",
"content",
... | Gets content with specified Id, or all the content for buffering;
@param string $packetId
@return void
@author Livingstone Fultang | [
"Gets",
"content",
"with",
"specified",
"Id",
"or",
"all",
"the",
"content",
"for",
"buffering",
";"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Protocol/Http/Response.php#L313-L322 |
5,126 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/format.php | Format.forge | public static function forge($data = null, $from_type = null, $param = null)
{
return new static($data, $from_type, $param);
} | php | public static function forge($data = null, $from_type = null, $param = null)
{
return new static($data, $from_type, $param);
} | [
"public",
"static",
"function",
"forge",
"(",
"$",
"data",
"=",
"null",
",",
"$",
"from_type",
"=",
"null",
",",
"$",
"param",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"$",
"data",
",",
"$",
"from_type",
",",
"$",
"param",
")",
";",
... | Returns an instance of the Format object.
echo Format::forge(array('foo' => 'bar'))->to_xml();
@param mixed general date to be converted
@param string data format the file was provided in
@param mixed additional parameter that can be passed on to a 'from' method
@return Format | [
"Returns",
"an",
"instance",
"of",
"the",
"Format",
"object",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/format.php#L39-L42 |
5,127 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request/soap.php | Request_Soap.set_cookie | public function set_cookie($name, $value = null)
{
is_null($value)
? $this->connection()->__setCookie($name)
: $this->connection()->__setCookie($name, $value);
} | php | public function set_cookie($name, $value = null)
{
is_null($value)
? $this->connection()->__setCookie($name)
: $this->connection()->__setCookie($name, $value);
} | [
"public",
"function",
"set_cookie",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"is_null",
"(",
"$",
"value",
")",
"?",
"$",
"this",
"->",
"connection",
"(",
")",
"->",
"__setCookie",
"(",
"$",
"name",
")",
":",
"$",
"this",
"->",
... | Set cookie for subsequent requests
@param string $name
@param string $value
@return void
@throws \RequestException | [
"Set",
"cookie",
"for",
"subsequent",
"requests"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request/soap.php#L258-L263 |
5,128 | gliverphp/database | src/MySQL/MySQLTable.php | MySQLTable.createTable | public function createTable()
{
//get the instance of the FileInfo class
$file_info = FileInfo::Create($this->table_file_path);
//this file already exists
if($file_info->isFile())
{
//load the clas into momeory
include $file_info->getPathname();
$class_name = substr($file_info->getFilename(), 0,-... | php | public function createTable()
{
//get the instance of the FileInfo class
$file_info = FileInfo::Create($this->table_file_path);
//this file already exists
if($file_info->isFile())
{
//load the clas into momeory
include $file_info->getPathname();
$class_name = substr($file_info->getFilename(), 0,-... | [
"public",
"function",
"createTable",
"(",
")",
"{",
"//get the instance of the FileInfo class",
"$",
"file_info",
"=",
"FileInfo",
"::",
"Create",
"(",
"$",
"this",
"->",
"table_file_path",
")",
";",
"//this file already exists",
"if",
"(",
"$",
"file_info",
"->",
... | This method creates a new table associated with this model.
@param string $table_name The name of the table associated with this class
@param string $model_name The name of the model class associated with this table
@return bool true if table create success | [
"This",
"method",
"creates",
"a",
"new",
"table",
"associated",
"with",
"this",
"model",
"."
] | b998bd3d24cb2f269b9bd54438c7df8751377ba9 | https://github.com/gliverphp/database/blob/b998bd3d24cb2f269b9bd54438c7df8751377ba9/src/MySQL/MySQLTable.php#L115-L144 |
5,129 | gliverphp/database | src/MySQL/MySQLTable.php | MySQLTable.updateTable | public function updateTable()
{
//get the instance of the FileInfo class
$file_info = FileInfo::Create($this->table_file_path);
//this file already exists
if($file_info->isFile())
{
//load the clas into momeory
include $file_info->getPathname();
$class_name = substr($file_info->getFilename(), 0,-4... | php | public function updateTable()
{
//get the instance of the FileInfo class
$file_info = FileInfo::Create($this->table_file_path);
//this file already exists
if($file_info->isFile())
{
//load the clas into momeory
include $file_info->getPathname();
$class_name = substr($file_info->getFilename(), 0,-4... | [
"public",
"function",
"updateTable",
"(",
")",
"{",
"//get the instance of the FileInfo class",
"$",
"file_info",
"=",
"FileInfo",
"::",
"Create",
"(",
"$",
"this",
"->",
"table_file_path",
")",
";",
"//this file already exists",
"if",
"(",
"$",
"file_info",
"->",
... | This model updates a table structure in the database.
@param null
@return bool true if update structure success | [
"This",
"model",
"updates",
"a",
"table",
"structure",
"in",
"the",
"database",
"."
] | b998bd3d24cb2f269b9bd54438c7df8751377ba9 | https://github.com/gliverphp/database/blob/b998bd3d24cb2f269b9bd54438c7df8751377ba9/src/MySQL/MySQLTable.php#L151-L181 |
5,130 | gliverphp/database | src/MySQL/MySQLTable.php | MySQLTable.createSQL | public function createSQL()
{
try {
$lines = array();
$indices = array();
$columns = $this->columns;
$template = "CREATE TABLE %s (\n%s,\n%s\n) ENGINE=%s DEFAULT CHARSET=%s;";
foreach ($this->columns as $column_name => $column)
{
//$column_name = $column["name"];//set the column name
... | php | public function createSQL()
{
try {
$lines = array();
$indices = array();
$columns = $this->columns;
$template = "CREATE TABLE %s (\n%s,\n%s\n) ENGINE=%s DEFAULT CHARSET=%s;";
foreach ($this->columns as $column_name => $column)
{
//$column_name = $column["name"];//set the column name
... | [
"public",
"function",
"createSQL",
"(",
")",
"{",
"try",
"{",
"$",
"lines",
"=",
"array",
"(",
")",
";",
"$",
"indices",
"=",
"array",
"(",
")",
";",
"$",
"columns",
"=",
"$",
"this",
"->",
"columns",
";",
"$",
"template",
"=",
"\"CREATE TABLE %s (\\... | This method generates query string for creating the database table.
@param null
@return $this | [
"This",
"method",
"generates",
"query",
"string",
"for",
"creating",
"the",
"database",
"table",
"."
] | b998bd3d24cb2f269b9bd54438c7df8751377ba9 | https://github.com/gliverphp/database/blob/b998bd3d24cb2f269b9bd54438c7df8751377ba9/src/MySQL/MySQLTable.php#L313-L392 |
5,131 | wearenolte/wp-widgets | src/Register.php | Register.register_widgets | public static function register_widgets() {
foreach ( self::$_widgets['lean'] as $widget ) {
self::register_widget( __NAMESPACE__ . '\\Collection\\' . $widget );
}
foreach ( self::$_widgets['custom'] as $widget ) {
self::register_widget( $widget );
}
} | php | public static function register_widgets() {
foreach ( self::$_widgets['lean'] as $widget ) {
self::register_widget( __NAMESPACE__ . '\\Collection\\' . $widget );
}
foreach ( self::$_widgets['custom'] as $widget ) {
self::register_widget( $widget );
}
} | [
"public",
"static",
"function",
"register_widgets",
"(",
")",
"{",
"foreach",
"(",
"self",
"::",
"$",
"_widgets",
"[",
"'lean'",
"]",
"as",
"$",
"widget",
")",
"{",
"self",
"::",
"register_widget",
"(",
"__NAMESPACE__",
".",
"'\\\\Collection\\\\'",
".",
"$",... | Register required widgets. | [
"Register",
"required",
"widgets",
"."
] | 7b008dc3182f8b9da44657bd2fe714e7e48cf002 | https://github.com/wearenolte/wp-widgets/blob/7b008dc3182f8b9da44657bd2fe714e7e48cf002/src/Register.php#L52-L60 |
5,132 | wearenolte/wp-widgets | src/Register.php | Register.register_widget | private static function register_widget( $widget_class ) {
register_widget( $widget_class );
$callback = [ $widget_class, 'post_registration' ];
if ( is_callable( $callback, true ) ) {
call_user_func( $callback );
}
} | php | private static function register_widget( $widget_class ) {
register_widget( $widget_class );
$callback = [ $widget_class, 'post_registration' ];
if ( is_callable( $callback, true ) ) {
call_user_func( $callback );
}
} | [
"private",
"static",
"function",
"register_widget",
"(",
"$",
"widget_class",
")",
"{",
"register_widget",
"(",
"$",
"widget_class",
")",
";",
"$",
"callback",
"=",
"[",
"$",
"widget_class",
",",
"'post_registration'",
"]",
";",
"if",
"(",
"is_callable",
"(",
... | Register a widget and run its post_registration function.
@param string $widget_class Full class name (including namespace) of the widget. | [
"Register",
"a",
"widget",
"and",
"run",
"its",
"post_registration",
"function",
"."
] | 7b008dc3182f8b9da44657bd2fe714e7e48cf002 | https://github.com/wearenolte/wp-widgets/blob/7b008dc3182f8b9da44657bd2fe714e7e48cf002/src/Register.php#L67-L74 |
5,133 | wearenolte/wp-widgets | src/Register.php | Register.get_widget_instance | public static function get_widget_instance( $widget_id ) {
global $wp_registered_widgets;
if ( ! isset( $wp_registered_widgets[ $widget_id ] ) ) {
return false;
}
$model = $wp_registered_widgets[ $widget_id ]['callback'][0];
if ( ! is_a( $model, 'Lean\Widgets\Models\AbstractWidget' ) ) {
return false... | php | public static function get_widget_instance( $widget_id ) {
global $wp_registered_widgets;
if ( ! isset( $wp_registered_widgets[ $widget_id ] ) ) {
return false;
}
$model = $wp_registered_widgets[ $widget_id ]['callback'][0];
if ( ! is_a( $model, 'Lean\Widgets\Models\AbstractWidget' ) ) {
return false... | [
"public",
"static",
"function",
"get_widget_instance",
"(",
"$",
"widget_id",
")",
"{",
"global",
"$",
"wp_registered_widgets",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"wp_registered_widgets",
"[",
"$",
"widget_id",
"]",
")",
")",
"{",
"return",
"false",
";"... | Gets a specific instance of a widget
@param string $widget_id The widget id
@return AbstractWidget|bool | [
"Gets",
"a",
"specific",
"instance",
"of",
"a",
"widget"
] | 7b008dc3182f8b9da44657bd2fe714e7e48cf002 | https://github.com/wearenolte/wp-widgets/blob/7b008dc3182f8b9da44657bd2fe714e7e48cf002/src/Register.php#L82-L100 |
5,134 | crysalead/collection | src/Collection.php | Collection.formats | public static function formats($format = null, $handler = null)
{
if ($format === null) {
return static::$_formats;
}
if ($format === false) {
return static::$_formats = ['array' => 'Lead\Collection\Collection::toArray'];
}
if ($handler === false) {
... | php | public static function formats($format = null, $handler = null)
{
if ($format === null) {
return static::$_formats;
}
if ($format === false) {
return static::$_formats = ['array' => 'Lead\Collection\Collection::toArray'];
}
if ($handler === false) {
... | [
"public",
"static",
"function",
"formats",
"(",
"$",
"format",
"=",
"null",
",",
"$",
"handler",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"format",
"===",
"null",
")",
"{",
"return",
"static",
"::",
"$",
"_formats",
";",
"}",
"if",
"(",
"$",
"format"... | Accessor method for adding format handlers to `Collection` instances.
The values assigned are used by `Collection::to()` to convert `Collection` instances into
different formats, i.e. JSON.
This can be accomplished in two ways. First, format handlers may be registered on a
case-by-case basis, as in the following:
``... | [
"Accessor",
"method",
"for",
"adding",
"format",
"handlers",
"to",
"Collection",
"instances",
"."
] | f36854210a8e8545de82f6760c0d80f5cb027c35 | https://github.com/crysalead/collection/blob/f36854210a8e8545de82f6760c0d80f5cb027c35/src/Collection.php#L131-L144 |
5,135 | crysalead/collection | src/Collection.php | Collection.each | public function each($callback)
{
foreach ($this->_data as $key => $val) {
$this->_data[$key] = $callback($val, $key, $this);
}
return $this;
} | php | public function each($callback)
{
foreach ($this->_data as $key => $val) {
$this->_data[$key] = $callback($val, $key, $this);
}
return $this;
} | [
"public",
"function",
"each",
"(",
"$",
"callback",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_data",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"$",
"key",
"]",
"=",
"$",
"callback",
"(",
"$",
"val",
","... | Applies a callback to all items in the collection.
@param callback $callback The callback to apply.
@return object This collection instance. | [
"Applies",
"a",
"callback",
"to",
"all",
"items",
"in",
"the",
"collection",
"."
] | f36854210a8e8545de82f6760c0d80f5cb027c35 | https://github.com/crysalead/collection/blob/f36854210a8e8545de82f6760c0d80f5cb027c35/src/Collection.php#L395-L401 |
5,136 | crysalead/collection | src/Collection.php | Collection.toArray | public static function toArray($data, $options = [])
{
$defaults = ['key' => true, 'handlers' => []];
$options += $defaults;
$result = [];
foreach ($data as $key => $item) {
switch (true) {
case is_array($item):
$result[$key] = static:... | php | public static function toArray($data, $options = [])
{
$defaults = ['key' => true, 'handlers' => []];
$options += $defaults;
$result = [];
foreach ($data as $key => $item) {
switch (true) {
case is_array($item):
$result[$key] = static:... | [
"public",
"static",
"function",
"toArray",
"(",
"$",
"data",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"defaults",
"=",
"[",
"'key'",
"=>",
"true",
",",
"'handlers'",
"=>",
"[",
"]",
"]",
";",
"$",
"options",
"+=",
"$",
"defaults",
";",
... | Exports a `Collection` instance to an array.
@param mixed $data Either a `Collection` instance, or an array representing a
`Collection`'s internal state.
@param array $options Options used when converting `$data` to an array:
- `'key'` _boolean_: A boolean indicating if keys must be conserved or not.
- `'han... | [
"Exports",
"a",
"Collection",
"instance",
"to",
"an",
"array",
"."
] | f36854210a8e8545de82f6760c0d80f5cb027c35 | https://github.com/crysalead/collection/blob/f36854210a8e8545de82f6760c0d80f5cb027c35/src/Collection.php#L520-L549 |
5,137 | unyx/console | input/parameter/values/Arguments.php | Arguments.push | public function push(string $value) : core\collections\interfaces\Map
{
// Grab an Argument for the next index. If we get null here, it means there are no further Arguments
// that accept values present.
if (!$argument = $this->definitions->getNextDefinition($this)) {
throw new e... | php | public function push(string $value) : core\collections\interfaces\Map
{
// Grab an Argument for the next index. If we get null here, it means there are no further Arguments
// that accept values present.
if (!$argument = $this->definitions->getNextDefinition($this)) {
throw new e... | [
"public",
"function",
"push",
"(",
"string",
"$",
"value",
")",
":",
"core",
"\\",
"collections",
"\\",
"interfaces",
"\\",
"Map",
"{",
"// Grab an Argument for the next index. If we get null here, it means there are no further Arguments",
"// that accept values present.",
"if"... | Adds an argument's value to the collection.
Automatically decides on the name of the argument based on the present definition.
@param string $value The argument's value to set.
@param $this
@throws exceptions\ArgumentsTooMany When the definition does not permit any further arguments. | [
"Adds",
"an",
"argument",
"s",
"value",
"to",
"the",
"collection",
"."
] | b4a76e08bbb5428b0349c0ec4259a914f81a2957 | https://github.com/unyx/console/blob/b4a76e08bbb5428b0349c0ec4259a914f81a2957/input/parameter/values/Arguments.php#L44-L55 |
5,138 | snapwp/snap-debug | src/Dumper/Handle.php | Handle.dump | public static function dump($var)
{
$flags = 0;
if (Config::get('debug.dump_show_string_length')) {
$flags = $flags | AbstractDumper::DUMP_STRING_LENGTH;
}
$cloner = new VarCloner();
if (! \in_array(\PHP_SAPI, array('cli', 'phpdbg'), true)) {
$dumpe... | php | public static function dump($var)
{
$flags = 0;
if (Config::get('debug.dump_show_string_length')) {
$flags = $flags | AbstractDumper::DUMP_STRING_LENGTH;
}
$cloner = new VarCloner();
if (! \in_array(\PHP_SAPI, array('cli', 'phpdbg'), true)) {
$dumpe... | [
"public",
"static",
"function",
"dump",
"(",
"$",
"var",
")",
"{",
"$",
"flags",
"=",
"0",
";",
"if",
"(",
"Config",
"::",
"get",
"(",
"'debug.dump_show_string_length'",
")",
")",
"{",
"$",
"flags",
"=",
"$",
"flags",
"|",
"AbstractDumper",
"::",
"DUMP... | The dump replacement.
@since 1.0.0
@param mixed $var The var to dump. | [
"The",
"dump",
"replacement",
"."
] | 49c0c258ce50098a3fca076ce122adf57571f2e2 | https://github.com/snapwp/snap-debug/blob/49c0c258ce50098a3fca076ce122adf57571f2e2/src/Dumper/Handle.php#L80-L106 |
5,139 | snapwp/snap-debug | src/Dumper/Handle.php | Handle.get_styles | private static function get_styles()
{
$style = Config::get('debug.dump_set_style', 'snap');
if (\is_array($style)) {
return $style;
}
if (\array_key_exists($style, self::$schemes)) {
return self::$schemes[ $style ];
}
return self::$schemes[... | php | private static function get_styles()
{
$style = Config::get('debug.dump_set_style', 'snap');
if (\is_array($style)) {
return $style;
}
if (\array_key_exists($style, self::$schemes)) {
return self::$schemes[ $style ];
}
return self::$schemes[... | [
"private",
"static",
"function",
"get_styles",
"(",
")",
"{",
"$",
"style",
"=",
"Config",
"::",
"get",
"(",
"'debug.dump_set_style'",
",",
"'snap'",
")",
";",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"style",
")",
")",
"{",
"return",
"$",
"style",
";",
... | Ensures the dump output uses the correct styles for Snap.
Can be overwritten by setting the config key.
@since 1.0.0
@return array | [
"Ensures",
"the",
"dump",
"output",
"uses",
"the",
"correct",
"styles",
"for",
"Snap",
"."
] | 49c0c258ce50098a3fca076ce122adf57571f2e2 | https://github.com/snapwp/snap-debug/blob/49c0c258ce50098a3fca076ce122adf57571f2e2/src/Dumper/Handle.php#L117-L130 |
5,140 | snapwp/snap-debug | src/Dumper/Handle.php | Handle.additional_output | private static function additional_output()
{
$backtrace = \debug_backtrace()[3];
$root = \realpath(__DIR__ . '/../../../../../../');
return '<span class="sf-dump-lineinfo">' . \ltrim(\str_replace($root, '', $backtrace['file']), '/\\') . ':' . $backtrace['line'] . '</span>';
} | php | private static function additional_output()
{
$backtrace = \debug_backtrace()[3];
$root = \realpath(__DIR__ . '/../../../../../../');
return '<span class="sf-dump-lineinfo">' . \ltrim(\str_replace($root, '', $backtrace['file']), '/\\') . ':' . $backtrace['line'] . '</span>';
} | [
"private",
"static",
"function",
"additional_output",
"(",
")",
"{",
"$",
"backtrace",
"=",
"\\",
"debug_backtrace",
"(",
")",
"[",
"3",
"]",
";",
"$",
"root",
"=",
"\\",
"realpath",
"(",
"__DIR__",
".",
"'/../../../../../../'",
")",
";",
"return",
"'<span... | Gets the line and file of where the dump was called.
@since 1.0.0
@return string The HTML for showing the line info. | [
"Gets",
"the",
"line",
"and",
"file",
"of",
"where",
"the",
"dump",
"was",
"called",
"."
] | 49c0c258ce50098a3fca076ce122adf57571f2e2 | https://github.com/snapwp/snap-debug/blob/49c0c258ce50098a3fca076ce122adf57571f2e2/src/Dumper/Handle.php#L139-L146 |
5,141 | marando/phpSOFA | src/Marando/IAU/iauApcg13.php | iauApcg13.Apcg13 | public static function Apcg13($date1, $date2, iauASTROM &$astrom) {
$ehpv = [];
$ebpv = [];
/* Earth barycentric & heliocentric position/velocity (au, au/d). */
IAU::Epv00($date1, $date2, $ehpv, $ebpv);
/* Compute the star-independent astrometry parameters. */
IAU::Apcg($date1, $date2, $ebpv, ... | php | public static function Apcg13($date1, $date2, iauASTROM &$astrom) {
$ehpv = [];
$ebpv = [];
/* Earth barycentric & heliocentric position/velocity (au, au/d). */
IAU::Epv00($date1, $date2, $ehpv, $ebpv);
/* Compute the star-independent astrometry parameters. */
IAU::Apcg($date1, $date2, $ebpv, ... | [
"public",
"static",
"function",
"Apcg13",
"(",
"$",
"date1",
",",
"$",
"date2",
",",
"iauASTROM",
"&",
"$",
"astrom",
")",
"{",
"$",
"ehpv",
"=",
"[",
"]",
";",
"$",
"ebpv",
"=",
"[",
"]",
";",
"/* Earth barycentric & heliocentric position/velocity (au, au/d... | - - - - - - - - - -
i a u A p c g 1 3
- - - - - - - - - -
For a geocentric observer, prepare star-independent astrometry
parameters for transformations between ICRS and GCRS coordinates.
The caller supplies the date, and SOFA models are used to predict
the Earth ephemeris.
The parameters produced by this function are... | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"i",
"a",
"u",
"A",
"p",
"c",
"g",
"1",
"3",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-"
] | 757fa49fe335ae1210eaa7735473fd4388b13f07 | https://github.com/marando/phpSOFA/blob/757fa49fe335ae1210eaa7735473fd4388b13f07/src/Marando/IAU/iauApcg13.php#L121-L132 |
5,142 | gossi/trixionary | src/model/Map/StructureNodeParentTableMap.php | StructureNodeParentTableMap.doDelete | public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(StructureNodeParentTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
... | php | public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(StructureNodeParentTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
... | [
"public",
"static",
"function",
"doDelete",
"(",
"$",
"values",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"getW... | Performs a DELETE on the database, given a StructureNodeParent or Criteria object OR a primary key value.
@param mixed $values Criteria or StructureNodeParent object or primary key or array of primary keys
which is used to create the DELETE statement
@param ConnectionInterface $con the connection to use... | [
"Performs",
"a",
"DELETE",
"on",
"the",
"database",
"given",
"a",
"StructureNodeParent",
"or",
"Criteria",
"object",
"OR",
"a",
"primary",
"key",
"value",
"."
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Map/StructureNodeParentTableMap.php#L405-L443 |
5,143 | gossi/trixionary | src/model/Map/StructureNodeParentTableMap.php | StructureNodeParentTableMap.doInsert | public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(StructureNodeParentTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria... | php | public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(StructureNodeParentTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria... | [
"public",
"static",
"function",
"doInsert",
"(",
"$",
"criteria",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"ge... | Performs an INSERT on the database, given a StructureNodeParent or Criteria object.
@param mixed $criteria Criteria or StructureNodeParent object containing data that is used to create the INSERT statement.
@param ConnectionInterface $con the ConnectionInterface connection to use
@return mixed ... | [
"Performs",
"an",
"INSERT",
"on",
"the",
"database",
"given",
"a",
"StructureNodeParent",
"or",
"Criteria",
"object",
"."
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Map/StructureNodeParentTableMap.php#L465-L486 |
5,144 | taniko/romans | src/Parser.php | Parser.toInt | public static function toInt(string $str) : int
{
$result = 0;
$str = mb_convert_kana(self::replaceRoman($str), 'a');
foreach (self::$romans as $key => $value) {
while (mb_strpos($str, $key) === 0) {
$result += $value;
$str = mb_substr($str, str... | php | public static function toInt(string $str) : int
{
$result = 0;
$str = mb_convert_kana(self::replaceRoman($str), 'a');
foreach (self::$romans as $key => $value) {
while (mb_strpos($str, $key) === 0) {
$result += $value;
$str = mb_substr($str, str... | [
"public",
"static",
"function",
"toInt",
"(",
"string",
"$",
"str",
")",
":",
"int",
"{",
"$",
"result",
"=",
"0",
";",
"$",
"str",
"=",
"mb_convert_kana",
"(",
"self",
"::",
"replaceRoman",
"(",
"$",
"str",
")",
",",
"'a'",
")",
";",
"foreach",
"(... | convert roman numerals to decimal
@param string $str roman numerals
@return int decimal | [
"convert",
"roman",
"numerals",
"to",
"decimal"
] | 60721a61a0050c83e876cbf009e70aa93cabb1d2 | https://github.com/taniko/romans/blob/60721a61a0050c83e876cbf009e70aa93cabb1d2/src/Parser.php#L19-L30 |
5,145 | taniko/romans | src/Parser.php | Parser.toRoman | public static function toRoman(int $num) : string
{
$result = '';
foreach (self::$romans as $roman => $value) {
$matches = intval($num / $value);
$result .= str_repeat($roman, $matches);
$num = $num % $value;
}
return $result;
} | php | public static function toRoman(int $num) : string
{
$result = '';
foreach (self::$romans as $roman => $value) {
$matches = intval($num / $value);
$result .= str_repeat($roman, $matches);
$num = $num % $value;
}
return $result;
} | [
"public",
"static",
"function",
"toRoman",
"(",
"int",
"$",
"num",
")",
":",
"string",
"{",
"$",
"result",
"=",
"''",
";",
"foreach",
"(",
"self",
"::",
"$",
"romans",
"as",
"$",
"roman",
"=>",
"$",
"value",
")",
"{",
"$",
"matches",
"=",
"intval",... | convert decimal to roman numerals
@param int $num decimal
@return string roman numerals | [
"convert",
"decimal",
"to",
"roman",
"numerals"
] | 60721a61a0050c83e876cbf009e70aa93cabb1d2 | https://github.com/taniko/romans/blob/60721a61a0050c83e876cbf009e70aa93cabb1d2/src/Parser.php#L37-L46 |
5,146 | unikent/lib-php-collections | src/API.php | API.solr_client | public function solr_client() {
if (!isset($this->_solrclient)) {
$this->_solrclient = new \Solarium\Client(array(
'endpoint' => array(
'localhost' => array(
'host' => $this->_url,
'port' => $this->_solr_port,
... | php | public function solr_client() {
if (!isset($this->_solrclient)) {
$this->_solrclient = new \Solarium\Client(array(
'endpoint' => array(
'localhost' => array(
'host' => $this->_url,
'port' => $this->_solr_port,
... | [
"public",
"function",
"solr_client",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_solrclient",
")",
")",
"{",
"$",
"this",
"->",
"_solrclient",
"=",
"new",
"\\",
"Solarium",
"\\",
"Client",
"(",
"array",
"(",
"'endpoint'",
"=>",
... | Returns the SOLR client. | [
"Returns",
"the",
"SOLR",
"client",
"."
] | 8bb57de388641fd3adf8c94a90e70961907fb2cf | https://github.com/unikent/lib-php-collections/blob/8bb57de388641fd3adf8c94a90e70961907fb2cf/src/API.php#L125-L139 |
5,147 | unikent/lib-php-collections | src/API.php | API.build_rest_url | protected function build_rest_url($url, $params = array()) {
$base = '';
if (substr($this->_url, 0, 4) !== 'http') {
$base .= 'http://';
}
$base .= $this->_url;
if ($this->_port != 80) {
$base .= ':' . $this->_port;
}
$rurl = new \Rapid\U... | php | protected function build_rest_url($url, $params = array()) {
$base = '';
if (substr($this->_url, 0, 4) !== 'http') {
$base .= 'http://';
}
$base .= $this->_url;
if ($this->_port != 80) {
$base .= ':' . $this->_port;
}
$rurl = new \Rapid\U... | [
"protected",
"function",
"build_rest_url",
"(",
"$",
"url",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"base",
"=",
"''",
";",
"if",
"(",
"substr",
"(",
"$",
"this",
"->",
"_url",
",",
"0",
",",
"4",
")",
"!==",
"'http'",
")",
"... | Build a REST URL.
@internal. | [
"Build",
"a",
"REST",
"URL",
"."
] | 8bb57de388641fd3adf8c94a90e70961907fb2cf | https://github.com/unikent/lib-php-collections/blob/8bb57de388641fd3adf8c94a90e70961907fb2cf/src/API.php#L173-L186 |
5,148 | unikent/lib-php-collections | src/API.php | API.api_call | protected function api_call($url, $params) {
$url = $this->build_rest_url($url, $params);
$result = $this->curl($url);
return json_decode($result);
} | php | protected function api_call($url, $params) {
$url = $this->build_rest_url($url, $params);
$result = $this->curl($url);
return json_decode($result);
} | [
"protected",
"function",
"api_call",
"(",
"$",
"url",
",",
"$",
"params",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"build_rest_url",
"(",
"$",
"url",
",",
"$",
"params",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"curl",
"(",
"$",
"url... | Shorthand for API call. | [
"Shorthand",
"for",
"API",
"call",
"."
] | 8bb57de388641fd3adf8c94a90e70961907fb2cf | https://github.com/unikent/lib-php-collections/blob/8bb57de388641fd3adf8c94a90e70961907fb2cf/src/API.php#L191-L195 |
5,149 | unikent/lib-php-collections | src/API.php | API.get_images | public function get_images() {
$results = $this->api_call('images.php', array(
'collection' => $this->get_type()
));
return array_map(function($o) {
return $this->get_image($o);
}, $results);
} | php | public function get_images() {
$results = $this->api_call('images.php', array(
'collection' => $this->get_type()
));
return array_map(function($o) {
return $this->get_image($o);
}, $results);
} | [
"public",
"function",
"get_images",
"(",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"api_call",
"(",
"'images.php'",
",",
"array",
"(",
"'collection'",
"=>",
"$",
"this",
"->",
"get_type",
"(",
")",
")",
")",
";",
"return",
"array_map",
"(",
"fu... | Returns a list of images in the collection. | [
"Returns",
"a",
"list",
"of",
"images",
"in",
"the",
"collection",
"."
] | 8bb57de388641fd3adf8c94a90e70961907fb2cf | https://github.com/unikent/lib-php-collections/blob/8bb57de388641fd3adf8c94a90e70961907fb2cf/src/API.php#L200-L208 |
5,150 | tux-rampage/rampage-php | library/rampage/core/ServiceManager.php | ServiceManager.setShared | public function setShared($name, $isShared)
{
$cName = $this->canonicalizeName($name);
$this->shared[$cName] = (bool)$isShared;
return $this;
} | php | public function setShared($name, $isShared)
{
$cName = $this->canonicalizeName($name);
$this->shared[$cName] = (bool)$isShared;
return $this;
} | [
"public",
"function",
"setShared",
"(",
"$",
"name",
",",
"$",
"isShared",
")",
"{",
"$",
"cName",
"=",
"$",
"this",
"->",
"canonicalizeName",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"shared",
"[",
"$",
"cName",
"]",
"=",
"(",
"bool",
")",
... | Custom setShared implementation.
This does not check if a service can be instanciated by this service manager.
Definitions may be added at runtime so don't care about instanciability.
@param string $name The service to mark as shared or not shared
@param bool $isShared Flag if the service should be shared or not
@ret... | [
"Custom",
"setShared",
"implementation",
"."
] | 1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf | https://github.com/tux-rampage/rampage-php/blob/1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf/library/rampage/core/ServiceManager.php#L68-L74 |
5,151 | tux-rampage/rampage-php | library/rampage/core/ServiceManager.php | ServiceManager.setInvokableClass | public function setInvokableClass($name, $invokableClass, $shared = null)
{
$invokableClass = strtr($invokableClass, '.', '\\');
return parent::setInvokableClass($name, $invokableClass, $shared);
} | php | public function setInvokableClass($name, $invokableClass, $shared = null)
{
$invokableClass = strtr($invokableClass, '.', '\\');
return parent::setInvokableClass($name, $invokableClass, $shared);
} | [
"public",
"function",
"setInvokableClass",
"(",
"$",
"name",
",",
"$",
"invokableClass",
",",
"$",
"shared",
"=",
"null",
")",
"{",
"$",
"invokableClass",
"=",
"strtr",
"(",
"$",
"invokableClass",
",",
"'.'",
",",
"'\\\\'",
")",
";",
"return",
"parent",
... | Auto convert dottet class names to PHP class names
@see \Zend\ServiceManager\ServiceManager::setInvokableClass() | [
"Auto",
"convert",
"dottet",
"class",
"names",
"to",
"PHP",
"class",
"names"
] | 1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf | https://github.com/tux-rampage/rampage-php/blob/1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf/library/rampage/core/ServiceManager.php#L81-L85 |
5,152 | raideer/tweech-irc-parser | src/Parser.php | Parser.parseParameters | protected function parseParameters($parsed)
{
$command = strtoupper($parsed['command']);
if (!array_key_exists($command, $this->paramsRegex)) {
return $parsed;
}
if (!preg_match($this->paramsRegex[$command], $parsed['params'], $params)) {
return $parsed;
}
$p... | php | protected function parseParameters($parsed)
{
$command = strtoupper($parsed['command']);
if (!array_key_exists($command, $this->paramsRegex)) {
return $parsed;
}
if (!preg_match($this->paramsRegex[$command], $parsed['params'], $params)) {
return $parsed;
}
$p... | [
"protected",
"function",
"parseParameters",
"(",
"$",
"parsed",
")",
"{",
"$",
"command",
"=",
"strtoupper",
"(",
"$",
"parsed",
"[",
"'command'",
"]",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"command",
",",
"$",
"this",
"->",
"paramsRege... | Checks each message and runs the parameters through regex.
@param array $parsed
@return array | [
"Checks",
"each",
"message",
"and",
"runs",
"the",
"parameters",
"through",
"regex",
"."
] | 137ca6ecb74c4398169c1af9079e5dccb370e318 | https://github.com/raideer/tweech-irc-parser/blob/137ca6ecb74c4398169c1af9079e5dccb370e318/src/Parser.php#L96-L115 |
5,153 | raideer/tweech-irc-parser | src/Parser.php | Parser.parse | public function parse($message)
{
//Checking if the message is a full line
if (strpos($message, "\r\n") === false) {
return;
}
//Parsing the message
if (!preg_match($this->messageRegex, $message, $parsed)) {
$parsed = ['invalid' => $message];
return $parsed;
}
/*... | php | public function parse($message)
{
//Checking if the message is a full line
if (strpos($message, "\r\n") === false) {
return;
}
//Parsing the message
if (!preg_match($this->messageRegex, $message, $parsed)) {
$parsed = ['invalid' => $message];
return $parsed;
}
/*... | [
"public",
"function",
"parse",
"(",
"$",
"message",
")",
"{",
"//Checking if the message is a full line",
"if",
"(",
"strpos",
"(",
"$",
"message",
",",
"\"\\r\\n\"",
")",
"===",
"false",
")",
"{",
"return",
";",
"}",
"//Parsing the message",
"if",
"(",
"!",
... | Main parsing function.
@param string $message Received irc message
@return array Parsed | [
"Main",
"parsing",
"function",
"."
] | 137ca6ecb74c4398169c1af9079e5dccb370e318 | https://github.com/raideer/tweech-irc-parser/blob/137ca6ecb74c4398169c1af9079e5dccb370e318/src/Parser.php#L124-L146 |
5,154 | osflab/view | Helper/Bootstrap/Addon/Menu.php | Menu.setMenu | public function setMenu(DropDownMenu $menu)
{
if ($this->menu instanceof DropDownMenu) {
Checkers::notice('A dropdown menu already exists. The old one will be delete.');
}
$this->menu = $menu;
return $this;
} | php | public function setMenu(DropDownMenu $menu)
{
if ($this->menu instanceof DropDownMenu) {
Checkers::notice('A dropdown menu already exists. The old one will be delete.');
}
$this->menu = $menu;
return $this;
} | [
"public",
"function",
"setMenu",
"(",
"DropDownMenu",
"$",
"menu",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"menu",
"instanceof",
"DropDownMenu",
")",
"{",
"Checkers",
"::",
"notice",
"(",
"'A dropdown menu already exists. The old one will be delete.'",
")",
";",
"... | Attach a dropdown menu
@param \Osf\View\Helper\Bootstrap\Addon\Addon\DropDownMenu $menu
@return $this | [
"Attach",
"a",
"dropdown",
"menu"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Bootstrap/Addon/Menu.php#L35-L42 |
5,155 | osflab/view | Helper/Bootstrap/Addon/Menu.php | Menu.getMenuAttributes | public function getMenuAttributes():array
{
if ($this->menu !== null) {
$attrs = [];
if ($this->menu->getOrientationClass() == 'dropdown') {
$attrs['id'] = $this->menu->getLabelledBy();
}
$attrs['data-toggle'] = 'dropdown';
$attrs... | php | public function getMenuAttributes():array
{
if ($this->menu !== null) {
$attrs = [];
if ($this->menu->getOrientationClass() == 'dropdown') {
$attrs['id'] = $this->menu->getLabelledBy();
}
$attrs['data-toggle'] = 'dropdown';
$attrs... | [
"public",
"function",
"getMenuAttributes",
"(",
")",
":",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"menu",
"!==",
"null",
")",
"{",
"$",
"attrs",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"menu",
"->",
"getOrientationClass",
"(",
")",
"=... | Attributes to add to attached element
@return array | [
"Attributes",
"to",
"add",
"to",
"attached",
"element"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Helper/Bootstrap/Addon/Menu.php#L48-L61 |
5,156 | ripaclub/zf2-hanger-snippet | src/View/Helper/SnippetHelper.php | SnippetHelper.setEnableAll | public function setEnableAll()
{
foreach ($this->snippets as $name => $config) {
$this->setEnabled($name);
}
return $this;
} | php | public function setEnableAll()
{
foreach ($this->snippets as $name => $config) {
$this->setEnabled($name);
}
return $this;
} | [
"public",
"function",
"setEnableAll",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"snippets",
"as",
"$",
"name",
"=>",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"setEnabled",
"(",
"$",
"name",
")",
";",
"}",
"return",
"$",
"this",
";",
"}"
... | Set Enable All
@return $this | [
"Set",
"Enable",
"All"
] | f055fe49eabea6f963b20e7db8fb81edf3eb3545 | https://github.com/ripaclub/zf2-hanger-snippet/blob/f055fe49eabea6f963b20e7db8fb81edf3eb3545/src/View/Helper/SnippetHelper.php#L57-L63 |
5,157 | ripaclub/zf2-hanger-snippet | src/View/Helper/SnippetHelper.php | SnippetHelper.setDisableAll | public function setDisableAll()
{
foreach ($this->snippets as $name => $config) {
$this->setDisabled($name);
}
return $this;
} | php | public function setDisableAll()
{
foreach ($this->snippets as $name => $config) {
$this->setDisabled($name);
}
return $this;
} | [
"public",
"function",
"setDisableAll",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"snippets",
"as",
"$",
"name",
"=>",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"setDisabled",
"(",
"$",
"name",
")",
";",
"}",
"return",
"$",
"this",
";",
"}... | Set Disable All
@return $this | [
"Set",
"Disable",
"All"
] | f055fe49eabea6f963b20e7db8fb81edf3eb3545 | https://github.com/ripaclub/zf2-hanger-snippet/blob/f055fe49eabea6f963b20e7db8fb81edf3eb3545/src/View/Helper/SnippetHelper.php#L69-L75 |
5,158 | ripaclub/zf2-hanger-snippet | src/View/Helper/SnippetHelper.php | SnippetHelper.renderSnippet | public function renderSnippet($name)
{
if (!isset($this->snippets[$name])) {
throw new InvalidArgumentException(
sprintf(
"Cannot find a snippet with name '%s'",
$name
)
);
}
return $this->getVie... | php | public function renderSnippet($name)
{
if (!isset($this->snippets[$name])) {
throw new InvalidArgumentException(
sprintf(
"Cannot find a snippet with name '%s'",
$name
)
);
}
return $this->getVie... | [
"public",
"function",
"renderSnippet",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"snippets",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"\"Cannot find a snippet ... | Render a single snippet
@param string $name The snippet name
@throws InvalidArgumentException
@return string | [
"Render",
"a",
"single",
"snippet"
] | f055fe49eabea6f963b20e7db8fb81edf3eb3545 | https://github.com/ripaclub/zf2-hanger-snippet/blob/f055fe49eabea6f963b20e7db8fb81edf3eb3545/src/View/Helper/SnippetHelper.php#L110-L125 |
5,159 | NuclearCMS/Synthesizer | src/Synthesizer.php | Synthesizer.splitText | protected function splitText($part)
{
if ($part === 'before' || $part === 'rest')
{
$parts = explode(static::separator, $this->text);
if (count($parts) === 1 && $part === 'rest')
{
return null;
}
return ($part === 'before'... | php | protected function splitText($part)
{
if ($part === 'before' || $part === 'rest')
{
$parts = explode(static::separator, $this->text);
if (count($parts) === 1 && $part === 'rest')
{
return null;
}
return ($part === 'before'... | [
"protected",
"function",
"splitText",
"(",
"$",
"part",
")",
"{",
"if",
"(",
"$",
"part",
"===",
"'before'",
"||",
"$",
"part",
"===",
"'rest'",
")",
"{",
"$",
"parts",
"=",
"explode",
"(",
"static",
"::",
"separator",
",",
"$",
"this",
"->",
"text",... | Splits the text into given part
@param string $part
@return string | [
"Splits",
"the",
"text",
"into",
"given",
"part"
] | 750e24b7ab5d625af5471584108d2fad0443dbca | https://github.com/NuclearCMS/Synthesizer/blob/750e24b7ab5d625af5471584108d2fad0443dbca/src/Synthesizer.php#L75-L90 |
5,160 | gbprod/elastica-extra-bundle | src/ElasticaExtraBundle/Handler/DeleteIndexHandler.php | DeleteIndexHandler.handle | public function handle(Client $client, $index)
{
$index = $client->getIndex($index);
if (!$index->exists()) {
throw new IndexNotFoundException($index);
}
$index->delete();
} | php | public function handle(Client $client, $index)
{
$index = $client->getIndex($index);
if (!$index->exists()) {
throw new IndexNotFoundException($index);
}
$index->delete();
} | [
"public",
"function",
"handle",
"(",
"Client",
"$",
"client",
",",
"$",
"index",
")",
"{",
"$",
"index",
"=",
"$",
"client",
"->",
"getIndex",
"(",
"$",
"index",
")",
";",
"if",
"(",
"!",
"$",
"index",
"->",
"exists",
"(",
")",
")",
"{",
"throw",... | Handle index deletion command
@param Client $client
@param string $index
@throws IndexNotFoundException | [
"Handle",
"index",
"deletion",
"command"
] | 7a3d925c79903a328a3d07fefe998c0056be7e59 | https://github.com/gbprod/elastica-extra-bundle/blob/7a3d925c79903a328a3d07fefe998c0056be7e59/src/ElasticaExtraBundle/Handler/DeleteIndexHandler.php#L23-L32 |
5,161 | pulkitjalan/requester | src/Requester.php | Requester.getGuzzleClient | public function getGuzzleClient()
{
$guzzle = $this->guzzleClient;
if ($this->retry) {
$guzzle = $this->addRetrySubscriber($guzzle);
}
return $guzzle;
} | php | public function getGuzzleClient()
{
$guzzle = $this->guzzleClient;
if ($this->retry) {
$guzzle = $this->addRetrySubscriber($guzzle);
}
return $guzzle;
} | [
"public",
"function",
"getGuzzleClient",
"(",
")",
"{",
"$",
"guzzle",
"=",
"$",
"this",
"->",
"guzzleClient",
";",
"if",
"(",
"$",
"this",
"->",
"retry",
")",
"{",
"$",
"guzzle",
"=",
"$",
"this",
"->",
"addRetrySubscriber",
"(",
"$",
"guzzle",
")",
... | Getter for guzzle client.
@return \GuzzleHttp\Client | [
"Getter",
"for",
"guzzle",
"client",
"."
] | a5706390a6455e8f97b39b86eed749d1f539c6bd | https://github.com/pulkitjalan/requester/blob/a5706390a6455e8f97b39b86eed749d1f539c6bd/src/Requester.php#L96-L105 |
5,162 | pulkitjalan/requester | src/Requester.php | Requester.addLogger | public function addLogger($logger, $format = 'CLF')
{
if (defined('GuzzleHttp\Subscriber\Log\Formatter::'.$format)) {
$format = constant('GuzzleHttp\Subscriber\Log\Formatter::'.$format);
}
$subscriber = new LogSubscriber($logger, $format);
$this->guzzleClient->getEmitter... | php | public function addLogger($logger, $format = 'CLF')
{
if (defined('GuzzleHttp\Subscriber\Log\Formatter::'.$format)) {
$format = constant('GuzzleHttp\Subscriber\Log\Formatter::'.$format);
}
$subscriber = new LogSubscriber($logger, $format);
$this->guzzleClient->getEmitter... | [
"public",
"function",
"addLogger",
"(",
"$",
"logger",
",",
"$",
"format",
"=",
"'CLF'",
")",
"{",
"if",
"(",
"defined",
"(",
"'GuzzleHttp\\Subscriber\\Log\\Formatter::'",
".",
"$",
"format",
")",
")",
"{",
"$",
"format",
"=",
"constant",
"(",
"'GuzzleHttp\\... | Add a logger to the guzzle client.
@param Logger $logger PSR-3 Logger instance (monolog)
@param string $format Log output format
@return void | [
"Add",
"a",
"logger",
"to",
"the",
"guzzle",
"client",
"."
] | a5706390a6455e8f97b39b86eed749d1f539c6bd | https://github.com/pulkitjalan/requester/blob/a5706390a6455e8f97b39b86eed749d1f539c6bd/src/Requester.php#L115-L123 |
5,163 | pulkitjalan/requester | src/Requester.php | Requester.addFile | public function addFile($filepath, $key = 'file')
{
$this->options = array_merge_recursive($this->options, [
'body' => [
$key => fopen($filepath, 'r'),
],
]);
return $this;
} | php | public function addFile($filepath, $key = 'file')
{
$this->options = array_merge_recursive($this->options, [
'body' => [
$key => fopen($filepath, 'r'),
],
]);
return $this;
} | [
"public",
"function",
"addFile",
"(",
"$",
"filepath",
",",
"$",
"key",
"=",
"'file'",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"array_merge_recursive",
"(",
"$",
"this",
"->",
"options",
",",
"[",
"'body'",
"=>",
"[",
"$",
"key",
"=>",
"fopen",
... | Add a file to the request.
@param string $filepath path to file
@param string $key optional post key, default to file
@return \PulkitJalan\Requester\Requester | [
"Add",
"a",
"file",
"to",
"the",
"request",
"."
] | a5706390a6455e8f97b39b86eed749d1f539c6bd | https://github.com/pulkitjalan/requester/blob/a5706390a6455e8f97b39b86eed749d1f539c6bd/src/Requester.php#L244-L253 |
5,164 | pulkitjalan/requester | src/Requester.php | Requester.getUrl | public function getUrl()
{
if (!$this->url) {
throw new InvalidUrlException();
}
$url = $this->url;
if (! parse_url($this->url, PHP_URL_SCHEME)) {
$url = $this->getProtocol().$url;
}
return $url;
} | php | public function getUrl()
{
if (!$this->url) {
throw new InvalidUrlException();
}
$url = $this->url;
if (! parse_url($this->url, PHP_URL_SCHEME)) {
$url = $this->getProtocol().$url;
}
return $url;
} | [
"public",
"function",
"getUrl",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"url",
")",
"{",
"throw",
"new",
"InvalidUrlException",
"(",
")",
";",
"}",
"$",
"url",
"=",
"$",
"this",
"->",
"url",
";",
"if",
"(",
"!",
"parse_url",
"(",
"$",
... | Getter for the url will append protocol if one does not exist.
@return string | [
"Getter",
"for",
"the",
"url",
"will",
"append",
"protocol",
"if",
"one",
"does",
"not",
"exist",
"."
] | a5706390a6455e8f97b39b86eed749d1f539c6bd | https://github.com/pulkitjalan/requester/blob/a5706390a6455e8f97b39b86eed749d1f539c6bd/src/Requester.php#L344-L357 |
5,165 | pulkitjalan/requester | src/Requester.php | Requester.getOptions | public function getOptions($options)
{
// Add verify to options
$options = array_merge(['verify' => $this->verify], $options);
if ($this->async) {
$options = array_merge(['future' => true], $options);
}
// merge and return
return array_merge_recursive($t... | php | public function getOptions($options)
{
// Add verify to options
$options = array_merge(['verify' => $this->verify], $options);
if ($this->async) {
$options = array_merge(['future' => true], $options);
}
// merge and return
return array_merge_recursive($t... | [
"public",
"function",
"getOptions",
"(",
"$",
"options",
")",
"{",
"// Add verify to options",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'verify'",
"=>",
"$",
"this",
"->",
"verify",
"]",
",",
"$",
"options",
")",
";",
"if",
"(",
"$",
"this",
"->",
... | Getter for options.
@return array | [
"Getter",
"for",
"options",
"."
] | a5706390a6455e8f97b39b86eed749d1f539c6bd | https://github.com/pulkitjalan/requester/blob/a5706390a6455e8f97b39b86eed749d1f539c6bd/src/Requester.php#L364-L375 |
5,166 | pulkitjalan/requester | src/Requester.php | Requester.send | protected function send($function, array $options = [])
{
$guzzle = $this->getGuzzleClient();
$url = $this->getUrl();
// merge options
$options = $this->getOptions($options);
// need to reset after every request
$this->initialize();
return $guzzle->$functi... | php | protected function send($function, array $options = [])
{
$guzzle = $this->getGuzzleClient();
$url = $this->getUrl();
// merge options
$options = $this->getOptions($options);
// need to reset after every request
$this->initialize();
return $guzzle->$functi... | [
"protected",
"function",
"send",
"(",
"$",
"function",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"guzzle",
"=",
"$",
"this",
"->",
"getGuzzleClient",
"(",
")",
";",
"$",
"url",
"=",
"$",
"this",
"->",
"getUrl",
"(",
")",
";",
"/... | Send the request using guzzle.
@param string $function function to call on guzzle
@param array $options options to pass
@return \GuzzleHttp\Message\ResponseInterface | [
"Send",
"the",
"request",
"using",
"guzzle",
"."
] | a5706390a6455e8f97b39b86eed749d1f539c6bd | https://github.com/pulkitjalan/requester/blob/a5706390a6455e8f97b39b86eed749d1f539c6bd/src/Requester.php#L385-L398 |
5,167 | pulkitjalan/requester | src/Requester.php | Requester.addRetrySubscriber | protected function addRetrySubscriber(GuzzleClient $guzzle)
{
// Build retry subscriber
$retry = new RetrySubscriber([
'filter' => RetrySubscriber::createStatusFilter($this->retryOn),
'delay' => function ($number, $event) {
return $this->retryDelay;
... | php | protected function addRetrySubscriber(GuzzleClient $guzzle)
{
// Build retry subscriber
$retry = new RetrySubscriber([
'filter' => RetrySubscriber::createStatusFilter($this->retryOn),
'delay' => function ($number, $event) {
return $this->retryDelay;
... | [
"protected",
"function",
"addRetrySubscriber",
"(",
"GuzzleClient",
"$",
"guzzle",
")",
"{",
"// Build retry subscriber",
"$",
"retry",
"=",
"new",
"RetrySubscriber",
"(",
"[",
"'filter'",
"=>",
"RetrySubscriber",
"::",
"createStatusFilter",
"(",
"$",
"this",
"->",
... | Add the retry subscriber to the guzzle client.
@param \GuzzleHttp\Client $guzzle
@return \GuzzleHttp\Client | [
"Add",
"the",
"retry",
"subscriber",
"to",
"the",
"guzzle",
"client",
"."
] | a5706390a6455e8f97b39b86eed749d1f539c6bd | https://github.com/pulkitjalan/requester/blob/a5706390a6455e8f97b39b86eed749d1f539c6bd/src/Requester.php#L407-L422 |
5,168 | pulkitjalan/requester | src/Requester.php | Requester.initialize | protected function initialize()
{
$this->url = '';
$this->options = [];
$this->secure = array_get($this->config, 'secure', true);
$this->retryOn = array_get($this->config, 'retry.on', [500, 502, 503, 504]);
$this->retryDelay = array_get($this->config, 'retry.delay', 10);
... | php | protected function initialize()
{
$this->url = '';
$this->options = [];
$this->secure = array_get($this->config, 'secure', true);
$this->retryOn = array_get($this->config, 'retry.on', [500, 502, 503, 504]);
$this->retryDelay = array_get($this->config, 'retry.delay', 10);
... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"$",
"this",
"->",
"url",
"=",
"''",
";",
"$",
"this",
"->",
"options",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"secure",
"=",
"array_get",
"(",
"$",
"this",
"->",
"config",
",",
"'secure'",
",",... | Resets all variables to default values
required if using the same instance for multiple requests.
@return void | [
"Resets",
"all",
"variables",
"to",
"default",
"values",
"required",
"if",
"using",
"the",
"same",
"instance",
"for",
"multiple",
"requests",
"."
] | a5706390a6455e8f97b39b86eed749d1f539c6bd | https://github.com/pulkitjalan/requester/blob/a5706390a6455e8f97b39b86eed749d1f539c6bd/src/Requester.php#L440-L450 |
5,169 | infusephp/admin | src/Controller.php | Controller.adminModules | private function adminModules()
{
$return = [];
foreach ($this->app[ 'config' ]->get('modules.all') as $module) {
$controller = '\\app\\'.$module.'\\Controller';
if (!class_exists($controller)) {
continue;
}
if (property_exists($cont... | php | private function adminModules()
{
$return = [];
foreach ($this->app[ 'config' ]->get('modules.all') as $module) {
$controller = '\\app\\'.$module.'\\Controller';
if (!class_exists($controller)) {
continue;
}
if (property_exists($cont... | [
"private",
"function",
"adminModules",
"(",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"app",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'modules.all'",
")",
"as",
"$",
"module",
")",
"{",
"$",
"controller",
"=",
... | Returns a list of modules with admin sections.
@param array $modules input modules
@return array admin-enabled modules | [
"Returns",
"a",
"list",
"of",
"modules",
"with",
"admin",
"sections",
"."
] | ba54f1a623e6869835c6ee10f9cd1171c0e47a3c | https://github.com/infusephp/admin/blob/ba54f1a623e6869835c6ee10f9cd1171c0e47a3c/src/Controller.php#L178-L204 |
5,170 | infusephp/admin | src/Controller.php | Controller.fetchModelInfo | private function fetchModelInfo($module, $model = false)
{
// instantiate the controller
$controller = '\\app\\'.$module.'\\Controller';
$controllerObj = new $controller($this->app);
// get info about the controller
$properties = $controller::$properties;
// fetch a... | php | private function fetchModelInfo($module, $model = false)
{
// instantiate the controller
$controller = '\\app\\'.$module.'\\Controller';
$controllerObj = new $controller($this->app);
// get info about the controller
$properties = $controller::$properties;
// fetch a... | [
"private",
"function",
"fetchModelInfo",
"(",
"$",
"module",
",",
"$",
"model",
"=",
"false",
")",
"{",
"// instantiate the controller",
"$",
"controller",
"=",
"'\\\\app\\\\'",
".",
"$",
"module",
".",
"'\\\\Controller'",
";",
"$",
"controllerObj",
"=",
"new",
... | Takes the pluralized model name from the route and gets info about the model.
@param string $modelRouteName the name that comes from the route (i.e. the route "/users" would supply "users")
@return array|null model info | [
"Takes",
"the",
"pluralized",
"model",
"name",
"from",
"the",
"route",
"and",
"gets",
"info",
"about",
"the",
"model",
"."
] | ba54f1a623e6869835c6ee10f9cd1171c0e47a3c | https://github.com/infusephp/admin/blob/ba54f1a623e6869835c6ee10f9cd1171c0e47a3c/src/Controller.php#L258-L286 |
5,171 | infusephp/admin | src/Controller.php | Controller.models | private function models($controller)
{
$properties = $controller::$properties;
$module = $this->name($controller);
$models = [];
foreach ((array) U::array_value($properties, 'models') as $model) {
$modelClassName = '\\app\\'.$module.'\\models\\'.$model;
$in... | php | private function models($controller)
{
$properties = $controller::$properties;
$module = $this->name($controller);
$models = [];
foreach ((array) U::array_value($properties, 'models') as $model) {
$modelClassName = '\\app\\'.$module.'\\models\\'.$model;
$in... | [
"private",
"function",
"models",
"(",
"$",
"controller",
")",
"{",
"$",
"properties",
"=",
"$",
"controller",
"::",
"$",
"properties",
";",
"$",
"module",
"=",
"$",
"this",
"->",
"name",
"(",
"$",
"controller",
")",
";",
"$",
"models",
"=",
"[",
"]",... | Fetches the models for a given controller.
@param object $controller
@return array | [
"Fetches",
"the",
"models",
"for",
"a",
"given",
"controller",
"."
] | ba54f1a623e6869835c6ee10f9cd1171c0e47a3c | https://github.com/infusephp/admin/blob/ba54f1a623e6869835c6ee10f9cd1171c0e47a3c/src/Controller.php#L295-L312 |
5,172 | nano7/Database | src/Model/HasScopes.php | HasScopes.applyScopes | protected function applyScopes(QueryBuilder $query, Model $model, $ignoreScopes = [])
{
// Verificar se deve ignorar todos os scopes
if (in_array('*', $ignoreScopes)) {
return;
}
// Carregar lista de scopes
$class = get_called_class();
$scopes = Arr::get(... | php | protected function applyScopes(QueryBuilder $query, Model $model, $ignoreScopes = [])
{
// Verificar se deve ignorar todos os scopes
if (in_array('*', $ignoreScopes)) {
return;
}
// Carregar lista de scopes
$class = get_called_class();
$scopes = Arr::get(... | [
"protected",
"function",
"applyScopes",
"(",
"QueryBuilder",
"$",
"query",
",",
"Model",
"$",
"model",
",",
"$",
"ignoreScopes",
"=",
"[",
"]",
")",
"{",
"// Verificar se deve ignorar todos os scopes",
"if",
"(",
"in_array",
"(",
"'*'",
",",
"$",
"ignoreScopes",... | Apply scopes in query.
@param QueryBuilder $query
@param Model $model
@param array $ignoreScopes
@return void | [
"Apply",
"scopes",
"in",
"query",
"."
] | 7d8c10af415c469a317f40471f657104e4d5b52a | https://github.com/nano7/Database/blob/7d8c10af415c469a317f40471f657104e4d5b52a/src/Model/HasScopes.php#L36-L54 |
5,173 | webriq/core | module/User/src/Grid/User/Model/User/Structure.php | Structure.setGroupId | public function setGroupId( $groupId )
{
$this->groupId = (int) $groupId ?: null;
if ( $this->group && $this->group->id != $this->groupId )
{
$this->group = null;
}
return $this;
} | php | public function setGroupId( $groupId )
{
$this->groupId = (int) $groupId ?: null;
if ( $this->group && $this->group->id != $this->groupId )
{
$this->group = null;
}
return $this;
} | [
"public",
"function",
"setGroupId",
"(",
"$",
"groupId",
")",
"{",
"$",
"this",
"->",
"groupId",
"=",
"(",
"int",
")",
"$",
"groupId",
"?",
":",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"group",
"&&",
"$",
"this",
"->",
"group",
"->",
"id",
"!=... | Set group-id
@param int $groupId
@return \User\Model\User\Structure | [
"Set",
"group",
"-",
"id"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/User/src/Grid/User/Model/User/Structure.php#L277-L287 |
5,174 | webriq/core | module/User/src/Grid/User/Model/User/Structure.php | Structure.getUri | public function getUri( $locale = null )
{
if ( empty( $locale ) )
{
$locale = $this->getLocale();
}
return '/app/'
. $locale
. '/user/view/'
. rawurlencode( $this->displayName );
} | php | public function getUri( $locale = null )
{
if ( empty( $locale ) )
{
$locale = $this->getLocale();
}
return '/app/'
. $locale
. '/user/view/'
. rawurlencode( $this->displayName );
} | [
"public",
"function",
"getUri",
"(",
"$",
"locale",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"locale",
")",
")",
"{",
"$",
"locale",
"=",
"$",
"this",
"->",
"getLocale",
"(",
")",
";",
"}",
"return",
"'/app/'",
".",
"$",
"locale",
"."... | Get url for view user
@param string|null $locale
@return string | [
"Get",
"url",
"for",
"view",
"user"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/User/src/Grid/User/Model/User/Structure.php#L389-L400 |
5,175 | iwyg/template | Section.php | Section.getContent | public function getContent($index = null, $raw = false)
{
if (null === $index) {
return (bool)$raw ? $this->cbuff : join('', $this->cbuff);
}
if (isset($this->cbuff[(int)$index])) {
return $this->cbuff[(int)$index];
}
throw new \OutOfBoundsException(... | php | public function getContent($index = null, $raw = false)
{
if (null === $index) {
return (bool)$raw ? $this->cbuff : join('', $this->cbuff);
}
if (isset($this->cbuff[(int)$index])) {
return $this->cbuff[(int)$index];
}
throw new \OutOfBoundsException(... | [
"public",
"function",
"getContent",
"(",
"$",
"index",
"=",
"null",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"index",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"raw",
"?",
"$",
"this",
"->",
"cbuff",
":",
"join",
... | Get the contents.
@param int|null $index
@param boolean $raw
@throws \OutOfBoundsException if the given indenx is invalid.
@return string|array | [
"Get",
"the",
"contents",
"."
] | ad7c8e79ce3b8fc7fcf82bc3e53737a4d7ecc16e | https://github.com/iwyg/template/blob/ad7c8e79ce3b8fc7fcf82bc3e53737a4d7ecc16e/Section.php#L70-L81 |
5,176 | phlexible/bundler | Builder/ResolvingBuilder.php | ResolvingBuilder.build | public function build()
{
$file = rtrim($this->cacheDir, '/').'/'.$this->getFilename();
$mapFile = $file.'.map';
$cache = new PuliResourceCollectionCache($file, $this->isDebug());
$resources = $this->resourceFinder->findByType($this->getType());
if (!$cache->isFresh($resou... | php | public function build()
{
$file = rtrim($this->cacheDir, '/').'/'.$this->getFilename();
$mapFile = $file.'.map';
$cache = new PuliResourceCollectionCache($file, $this->isDebug());
$resources = $this->resourceFinder->findByType($this->getType());
if (!$cache->isFresh($resou... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"file",
"=",
"rtrim",
"(",
"$",
"this",
"->",
"cacheDir",
",",
"'/'",
")",
".",
"'/'",
".",
"$",
"this",
"->",
"getFilename",
"(",
")",
";",
"$",
"mapFile",
"=",
"$",
"file",
".",
"'.map'",
";",
... | Get all javascripts for the given section.
@return MappedAsset | [
"Get",
"all",
"javascripts",
"for",
"the",
"given",
"section",
"."
] | 4b126e8aff03e87e8d5f7e6de6f26b19a3116dfb | https://github.com/phlexible/bundler/blob/4b126e8aff03e87e8d5f7e6de6f26b19a3116dfb/Builder/ResolvingBuilder.php#L88-L115 |
5,177 | LaBlog/LaBlog | src/controllers/PostController.php | PostController.showPosts | public function showPosts($pagenumber = 1)
{
$posts = $this->post->findAll();
$viewParamaters = array(
'global' => $this->global,
'posts' => $posts,
'pageNumber' => $pagenumber
);
return \View::make($this->theme.'.posts', $viewParamaters);
} | php | public function showPosts($pagenumber = 1)
{
$posts = $this->post->findAll();
$viewParamaters = array(
'global' => $this->global,
'posts' => $posts,
'pageNumber' => $pagenumber
);
return \View::make($this->theme.'.posts', $viewParamaters);
} | [
"public",
"function",
"showPosts",
"(",
"$",
"pagenumber",
"=",
"1",
")",
"{",
"$",
"posts",
"=",
"$",
"this",
"->",
"post",
"->",
"findAll",
"(",
")",
";",
"$",
"viewParamaters",
"=",
"array",
"(",
"'global'",
"=>",
"$",
"this",
"->",
"global",
",",... | Show all of the posts.
@return \View | [
"Show",
"all",
"of",
"the",
"posts",
"."
] | d23f7848bd9a3993cbb5913d967626e9914a009c | https://github.com/LaBlog/LaBlog/blob/d23f7848bd9a3993cbb5913d967626e9914a009c/src/controllers/PostController.php#L27-L38 |
5,178 | LaBlog/LaBlog | src/controllers/PostController.php | PostController.showPost | public function showPost($category, $postName)
{
if (!$this->post->exists($category, $postName)) {
return \Response::view($this->theme.'.404', array('global' => $this->global), 404);
}
$post = $this->post->getPost($category, $postName);
$category = $this->category->getCa... | php | public function showPost($category, $postName)
{
if (!$this->post->exists($category, $postName)) {
return \Response::view($this->theme.'.404', array('global' => $this->global), 404);
}
$post = $this->post->getPost($category, $postName);
$category = $this->category->getCa... | [
"public",
"function",
"showPost",
"(",
"$",
"category",
",",
"$",
"postName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"post",
"->",
"exists",
"(",
"$",
"category",
",",
"$",
"postName",
")",
")",
"{",
"return",
"\\",
"Response",
"::",
"view",
... | Show a single post.
@param string $postName The name of the post to retrieve.
@return \View | [
"Show",
"a",
"single",
"post",
"."
] | d23f7848bd9a3993cbb5913d967626e9914a009c | https://github.com/LaBlog/LaBlog/blob/d23f7848bd9a3993cbb5913d967626e9914a009c/src/controllers/PostController.php#L45-L61 |
5,179 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/view.php | View.process_file | protected function process_file($file_override = false)
{
$clean_room = function($__file_name, array $__data)
{
extract($__data, EXTR_REFS);
// Capture the view output
ob_start();
try
{
// Load the view within the current scope
include $__file_name;
}
catch (\Exception $e)
{
/... | php | protected function process_file($file_override = false)
{
$clean_room = function($__file_name, array $__data)
{
extract($__data, EXTR_REFS);
// Capture the view output
ob_start();
try
{
// Load the view within the current scope
include $__file_name;
}
catch (\Exception $e)
{
/... | [
"protected",
"function",
"process_file",
"(",
"$",
"file_override",
"=",
"false",
")",
"{",
"$",
"clean_room",
"=",
"function",
"(",
"$",
"__file_name",
",",
"array",
"$",
"__data",
")",
"{",
"extract",
"(",
"$",
"__data",
",",
"EXTR_REFS",
")",
";",
"//... | Captures the output that is generated when a view is included.
The view data will be extracted to make local variables. This method
is static to prevent object scope resolution.
$output = $this->process_file();
@param string File override
@param array variables
@return string | [
"Captures",
"the",
"output",
"that",
"is",
"generated",
"when",
"a",
"view",
"is",
"included",
".",
"The",
"view",
"data",
"will",
"be",
"extracted",
"to",
"make",
"local",
"variables",
".",
"This",
"method",
"is",
"static",
"to",
"prevent",
"object",
"sco... | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/view.php#L228-L255 |
5,180 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/view.php | View.get_data | protected function get_data($scope = 'all')
{
$clean_it = function ($data, $rules, $auto_filter)
{
foreach ($data as $key => &$value)
{
$filter = array_key_exists($key, $rules) ? $rules[$key] : null;
$filter = is_null($filter) ? $auto_filter : $filter;
$value = $filter ? \Security::clean($value,... | php | protected function get_data($scope = 'all')
{
$clean_it = function ($data, $rules, $auto_filter)
{
foreach ($data as $key => &$value)
{
$filter = array_key_exists($key, $rules) ? $rules[$key] : null;
$filter = is_null($filter) ? $auto_filter : $filter;
$value = $filter ? \Security::clean($value,... | [
"protected",
"function",
"get_data",
"(",
"$",
"scope",
"=",
"'all'",
")",
"{",
"$",
"clean_it",
"=",
"function",
"(",
"$",
"data",
",",
"$",
"rules",
",",
"$",
"auto_filter",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"&",
"$",... | Retrieves all the data, both local and global. It filters the data if
necessary.
$data = $this->get_data();
@param string $scope local/glocal/all
@return array view data | [
"Retrieves",
"all",
"the",
"data",
"both",
"local",
"and",
"global",
".",
"It",
"filters",
"the",
"data",
"if",
"necessary",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/view.php#L266-L294 |
5,181 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/view.php | View.auto_filter | public function auto_filter($filter = true)
{
if (func_num_args() == 0)
{
return $this->auto_filter;
}
$this->auto_filter = $filter;
return $this;
} | php | public function auto_filter($filter = true)
{
if (func_num_args() == 0)
{
return $this->auto_filter;
}
$this->auto_filter = $filter;
return $this;
} | [
"public",
"function",
"auto_filter",
"(",
"$",
"filter",
"=",
"true",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"==",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"auto_filter",
";",
"}",
"$",
"this",
"->",
"auto_filter",
"=",
"$",
"filter",
";"... | Sets whether to filter the data or not.
$view->auto_filter(false);
@param bool whether to auto filter or not
@return View | [
"Sets",
"whether",
"to",
"filter",
"the",
"data",
"or",
"not",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/view.php#L358-L368 |
5,182 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/view.php | View.set_filename | public function set_filename($file)
{
// set find_file's one-time-only search paths
\Finder::instance()->flash($this->request_paths);
// locate the view file
if (($path = \Finder::search('views', $file, '.'.$this->extension, false, false)) === false)
{
throw new \FuelException('The requested view could n... | php | public function set_filename($file)
{
// set find_file's one-time-only search paths
\Finder::instance()->flash($this->request_paths);
// locate the view file
if (($path = \Finder::search('views', $file, '.'.$this->extension, false, false)) === false)
{
throw new \FuelException('The requested view could n... | [
"public",
"function",
"set_filename",
"(",
"$",
"file",
")",
"{",
"// set find_file's one-time-only search paths",
"\\",
"Finder",
"::",
"instance",
"(",
")",
"->",
"flash",
"(",
"$",
"this",
"->",
"request_paths",
")",
";",
"// locate the view file",
"if",
"(",
... | Sets the view filename.
$view->set_filename($file);
@param string view filename
@return View
@throws FuelException | [
"Sets",
"the",
"view",
"filename",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/view.php#L380-L395 |
5,183 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/view.php | View.& | public function &get($key = null, $default = null)
{
if (func_num_args() === 0 or $key === null)
{
return $this->data;
}
elseif (array_key_exists($key, $this->data))
{
return $this->data[$key];
}
elseif (array_key_exists($key, static::$global_data))
{
return static::$global_data[$key];
}
... | php | public function &get($key = null, $default = null)
{
if (func_num_args() === 0 or $key === null)
{
return $this->data;
}
elseif (array_key_exists($key, $this->data))
{
return $this->data[$key];
}
elseif (array_key_exists($key, static::$global_data))
{
return static::$global_data[$key];
}
... | [
"public",
"function",
"&",
"get",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"0",
"or",
"$",
"key",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"data",
";",
"... | Searches for the given variable and returns its value.
Local variables will be returned before global variables.
$value = $view->get('foo', 'bar');
If the key is not given or null, the entire data array is returned.
If a default parameter is not given and the variable does not
exist, it will throw an OutOfBoundsExce... | [
"Searches",
"for",
"the",
"given",
"variable",
"and",
"returns",
"its",
"value",
".",
"Local",
"variables",
"will",
"be",
"returned",
"before",
"global",
"variables",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/view.php#L413-L438 |
5,184 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/view.php | View.render | public function render($file = null)
{
// reactivate the correct request
if (class_exists('Request', false))
{
$current_request = \Request::active();
\Request::active($this->active_request);
}
// store the current language, and set the correct render language
if ($this->active_language)
{
$curr... | php | public function render($file = null)
{
// reactivate the correct request
if (class_exists('Request', false))
{
$current_request = \Request::active();
\Request::active($this->active_request);
}
// store the current language, and set the correct render language
if ($this->active_language)
{
$curr... | [
"public",
"function",
"render",
"(",
"$",
"file",
"=",
"null",
")",
"{",
"// reactivate the correct request",
"if",
"(",
"class_exists",
"(",
"'Request'",
",",
"false",
")",
")",
"{",
"$",
"current_request",
"=",
"\\",
"Request",
"::",
"active",
"(",
")",
... | Renders the view object to a string. Global and local data are merged
and extracted to create local variables within the view file.
$output = $view->render();
[!!] Global variables with the same key name as local variables will be
overwritten by the local variable.
@param string view filename
@return string
@t... | [
"Renders",
"the",
"view",
"object",
"to",
"a",
"string",
".",
"Global",
"and",
"local",
"data",
"are",
"merged",
"and",
"extracted",
"to",
"create",
"local",
"variables",
"within",
"the",
"view",
"file",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/view.php#L536-L577 |
5,185 | tekkla/core-html | Core/Html/AbstractHtml.php | AbstractHtml.addCss | public function addCss($css)
{
if (!is_array($css)) {
// Clean css argument from unnecessary spaces
$css = preg_replace('/[ ]+/', ' ', $css);
// Do not trust the programmer and convert a possible
// string of multiple css class notations to array
... | php | public function addCss($css)
{
if (!is_array($css)) {
// Clean css argument from unnecessary spaces
$css = preg_replace('/[ ]+/', ' ', $css);
// Do not trust the programmer and convert a possible
// string of multiple css class notations to array
... | [
"public",
"function",
"addCss",
"(",
"$",
"css",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"css",
")",
")",
"{",
"// Clean css argument from unnecessary spaces",
"$",
"css",
"=",
"preg_replace",
"(",
"'/[ ]+/'",
",",
"' '",
",",
"$",
"css",
")",
";... | Add one or more css classes to the html object.
Accepts single value, a string of space separated classnames or an array of classnames.
@param string|array $css | [
"Add",
"one",
"or",
"more",
"css",
"classes",
"to",
"the",
"html",
"object",
".",
"Accepts",
"single",
"value",
"a",
"string",
"of",
"space",
"separated",
"classnames",
"or",
"an",
"array",
"of",
"classnames",
"."
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/AbstractHtml.php#L233-L248 |
5,186 | tekkla/core-html | Core/Html/AbstractHtml.php | AbstractHtml.isHidden | public function isHidden(int $state = null)
{
$attrib = 'hidden';
if (empty($state)) {
return $this->checkAttribute($attrib);
}
if ($state == 0) {
$this->removeAttribute($attrib);
}
else {
$this->addAttribute($attrib);
}
... | php | public function isHidden(int $state = null)
{
$attrib = 'hidden';
if (empty($state)) {
return $this->checkAttribute($attrib);
}
if ($state == 0) {
$this->removeAttribute($attrib);
}
else {
$this->addAttribute($attrib);
}
... | [
"public",
"function",
"isHidden",
"(",
"int",
"$",
"state",
"=",
"null",
")",
"{",
"$",
"attrib",
"=",
"'hidden'",
";",
"if",
"(",
"empty",
"(",
"$",
"state",
")",
")",
"{",
"return",
"$",
"this",
"->",
"checkAttribute",
"(",
"$",
"attrib",
")",
";... | Hidden attribute setter and checker
Accepts parameter "null", "0" and "1".
"null" eg no parameter means to check for a set hidden attribute
"0" means to remove hidden attribute
"1" means to set hidden attribute
@param int $state | [
"Hidden",
"attribute",
"setter",
"and",
"checker"
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/AbstractHtml.php#L551-L565 |
5,187 | tekkla/core-html | Core/Html/AbstractHtml.php | AbstractHtml.build | public function build(): string
{
$html_attr = [];
if (!$this->element) {
$this->element = strtolower((new \ReflectionClass($this))->getShortName());
}
if (!empty($this->id)) {
$html_attr['id'] = $this->id;
}
if (!empty($this->name)) {
... | php | public function build(): string
{
$html_attr = [];
if (!$this->element) {
$this->element = strtolower((new \ReflectionClass($this))->getShortName());
}
if (!empty($this->id)) {
$html_attr['id'] = $this->id;
}
if (!empty($this->name)) {
... | [
"public",
"function",
"build",
"(",
")",
":",
"string",
"{",
"$",
"html_attr",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"element",
")",
"{",
"$",
"this",
"->",
"element",
"=",
"strtolower",
"(",
"(",
"new",
"\\",
"ReflectionClass",
"(... | Builds and returns the html code created out of all set attributes and their values
@return string | [
"Builds",
"and",
"returns",
"the",
"html",
"code",
"created",
"out",
"of",
"all",
"set",
"attributes",
"and",
"their",
"values"
] | 00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3 | https://github.com/tekkla/core-html/blob/00bf3fa8e060e8aadf1c341f6e3c548c7a76cfd3/Core/Html/AbstractHtml.php#L572-L653 |
5,188 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByYear | public function filterByYear($year = null, $comparison = null)
{
if (is_array($year)) {
$useMinMax = false;
if (isset($year['min'])) {
$this->addUsingAlias(ReferenceTableMap::COL_YEAR, $year['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | php | public function filterByYear($year = null, $comparison = null)
{
if (is_array($year)) {
$useMinMax = false;
if (isset($year['min'])) {
$this->addUsingAlias(ReferenceTableMap::COL_YEAR, $year['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
... | [
"public",
"function",
"filterByYear",
"(",
"$",
"year",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"year",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"year",
... | Filter the query on the year column
Example usage:
<code>
$query->filterByYear(1234); // WHERE year = 1234
$query->filterByYear(array(12, 34)); // WHERE year IN (12, 34)
$query->filterByYear(array('min' => 12)); // WHERE year > 12
</code>
@param mixed $year The value to use as filter.
Use scalar values for equali... | [
"Filter",
"the",
"query",
"on",
"the",
"year",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L447-L468 |
5,189 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByPublisher | public function filterByPublisher($publisher = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($publisher)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $publisher)) {
$publisher = str_replace('*', '%', $publisher... | php | public function filterByPublisher($publisher = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($publisher)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $publisher)) {
$publisher = str_replace('*', '%', $publisher... | [
"public",
"function",
"filterByPublisher",
"(",
"$",
"publisher",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"publisher",
")",
")",
"{",
"$",
"co... | Filter the query on the publisher column
Example usage:
<code>
$query->filterByPublisher('fooValue'); // WHERE publisher = 'fooValue'
$query->filterByPublisher('%fooValue%'); // WHERE publisher LIKE '%fooValue%'
</code>
@param string $publisher The value to use as filter.
Accepts wildcards (* and % trigger a LI... | [
"Filter",
"the",
"query",
"on",
"the",
"publisher",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L485-L497 |
5,190 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByJournal | public function filterByJournal($journal = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($journal)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $journal)) {
$journal = str_replace('*', '%', $journal);
... | php | public function filterByJournal($journal = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($journal)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $journal)) {
$journal = str_replace('*', '%', $journal);
... | [
"public",
"function",
"filterByJournal",
"(",
"$",
"journal",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"journal",
")",
")",
"{",
"$",
"comparis... | Filter the query on the journal column
Example usage:
<code>
$query->filterByJournal('fooValue'); // WHERE journal = 'fooValue'
$query->filterByJournal('%fooValue%'); // WHERE journal LIKE '%fooValue%'
</code>
@param string $journal The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param ... | [
"Filter",
"the",
"query",
"on",
"the",
"journal",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L514-L526 |
5,191 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByNumber | public function filterByNumber($number = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($number)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $number)) {
$number = str_replace('*', '%', $number);
... | php | public function filterByNumber($number = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($number)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $number)) {
$number = str_replace('*', '%', $number);
... | [
"public",
"function",
"filterByNumber",
"(",
"$",
"number",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"number",
")",
")",
"{",
"$",
"comparison"... | Filter the query on the number column
Example usage:
<code>
$query->filterByNumber('fooValue'); // WHERE number = 'fooValue'
$query->filterByNumber('%fooValue%'); // WHERE number LIKE '%fooValue%'
</code>
@param string $number The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param str... | [
"Filter",
"the",
"query",
"on",
"the",
"number",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L543-L555 |
5,192 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterBySchool | public function filterBySchool($school = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($school)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $school)) {
$school = str_replace('*', '%', $school);
... | php | public function filterBySchool($school = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($school)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $school)) {
$school = str_replace('*', '%', $school);
... | [
"public",
"function",
"filterBySchool",
"(",
"$",
"school",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"school",
")",
")",
"{",
"$",
"comparison"... | Filter the query on the school column
Example usage:
<code>
$query->filterBySchool('fooValue'); // WHERE school = 'fooValue'
$query->filterBySchool('%fooValue%'); // WHERE school LIKE '%fooValue%'
</code>
@param string $school The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param str... | [
"Filter",
"the",
"query",
"on",
"the",
"school",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L572-L584 |
5,193 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByEdition | public function filterByEdition($edition = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($edition)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $edition)) {
$edition = str_replace('*', '%', $edition);
... | php | public function filterByEdition($edition = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($edition)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $edition)) {
$edition = str_replace('*', '%', $edition);
... | [
"public",
"function",
"filterByEdition",
"(",
"$",
"edition",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"edition",
")",
")",
"{",
"$",
"comparis... | Filter the query on the edition column
Example usage:
<code>
$query->filterByEdition('fooValue'); // WHERE edition = 'fooValue'
$query->filterByEdition('%fooValue%'); // WHERE edition LIKE '%fooValue%'
</code>
@param string $edition The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param ... | [
"Filter",
"the",
"query",
"on",
"the",
"edition",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L630-L642 |
5,194 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByVolume | public function filterByVolume($volume = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($volume)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $volume)) {
$volume = str_replace('*', '%', $volume);
... | php | public function filterByVolume($volume = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($volume)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $volume)) {
$volume = str_replace('*', '%', $volume);
... | [
"public",
"function",
"filterByVolume",
"(",
"$",
"volume",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"volume",
")",
")",
"{",
"$",
"comparison"... | Filter the query on the volume column
Example usage:
<code>
$query->filterByVolume('fooValue'); // WHERE volume = 'fooValue'
$query->filterByVolume('%fooValue%'); // WHERE volume LIKE '%fooValue%'
</code>
@param string $volume The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param str... | [
"Filter",
"the",
"query",
"on",
"the",
"volume",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L659-L671 |
5,195 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByAddress | public function filterByAddress($address = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($address)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $address)) {
$address = str_replace('*', '%', $address);
... | php | public function filterByAddress($address = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($address)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $address)) {
$address = str_replace('*', '%', $address);
... | [
"public",
"function",
"filterByAddress",
"(",
"$",
"address",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"address",
")",
")",
"{",
"$",
"comparis... | Filter the query on the address column
Example usage:
<code>
$query->filterByAddress('fooValue'); // WHERE address = 'fooValue'
$query->filterByAddress('%fooValue%'); // WHERE address LIKE '%fooValue%'
</code>
@param string $address The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param ... | [
"Filter",
"the",
"query",
"on",
"the",
"address",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L688-L700 |
5,196 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByEditor | public function filterByEditor($editor = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($editor)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $editor)) {
$editor = str_replace('*', '%', $editor);
... | php | public function filterByEditor($editor = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($editor)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $editor)) {
$editor = str_replace('*', '%', $editor);
... | [
"public",
"function",
"filterByEditor",
"(",
"$",
"editor",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"editor",
")",
")",
"{",
"$",
"comparison"... | Filter the query on the editor column
Example usage:
<code>
$query->filterByEditor('fooValue'); // WHERE editor = 'fooValue'
$query->filterByEditor('%fooValue%'); // WHERE editor LIKE '%fooValue%'
</code>
@param string $editor The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param str... | [
"Filter",
"the",
"query",
"on",
"the",
"editor",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L717-L729 |
5,197 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByHowpublished | public function filterByHowpublished($howpublished = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($howpublished)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $howpublished)) {
$howpublished = str_replace('*', ... | php | public function filterByHowpublished($howpublished = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($howpublished)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $howpublished)) {
$howpublished = str_replace('*', ... | [
"public",
"function",
"filterByHowpublished",
"(",
"$",
"howpublished",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"howpublished",
")",
")",
"{",
"... | Filter the query on the howpublished column
Example usage:
<code>
$query->filterByHowpublished('fooValue'); // WHERE howpublished = 'fooValue'
$query->filterByHowpublished('%fooValue%'); // WHERE howpublished LIKE '%fooValue%'
</code>
@param string $howpublished The value to use as filter.
Accepts wildcards (* ... | [
"Filter",
"the",
"query",
"on",
"the",
"howpublished",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L746-L758 |
5,198 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByNote | public function filterByNote($note = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($note)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $note)) {
$note = str_replace('*', '%', $note);
$comparison... | php | public function filterByNote($note = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($note)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $note)) {
$note = str_replace('*', '%', $note);
$comparison... | [
"public",
"function",
"filterByNote",
"(",
"$",
"note",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"note",
")",
")",
"{",
"$",
"comparison",
"=... | Filter the query on the note column
Example usage:
<code>
$query->filterByNote('fooValue'); // WHERE note = 'fooValue'
$query->filterByNote('%fooValue%'); // WHERE note LIKE '%fooValue%'
</code>
@param string $note The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $compari... | [
"Filter",
"the",
"query",
"on",
"the",
"note",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L775-L787 |
5,199 | gossi/trixionary | src/model/Base/ReferenceQuery.php | ReferenceQuery.filterByBooktitle | public function filterByBooktitle($booktitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($booktitle)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $booktitle)) {
$booktitle = str_replace('*', '%', $booktitle... | php | public function filterByBooktitle($booktitle = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($booktitle)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $booktitle)) {
$booktitle = str_replace('*', '%', $booktitle... | [
"public",
"function",
"filterByBooktitle",
"(",
"$",
"booktitle",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"booktitle",
")",
")",
"{",
"$",
"co... | Filter the query on the booktitle column
Example usage:
<code>
$query->filterByBooktitle('fooValue'); // WHERE booktitle = 'fooValue'
$query->filterByBooktitle('%fooValue%'); // WHERE booktitle LIKE '%fooValue%'
</code>
@param string $booktitle The value to use as filter.
Accepts wildcards (* and % trigger a LI... | [
"Filter",
"the",
"query",
"on",
"the",
"booktitle",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/ReferenceQuery.php#L804-L816 |
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.