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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9,600 | extendsframework/extends-event | src/Publisher/EventPublisher.php | EventPublisher.addEventListener | public function addEventListener(EventListenerInterface $eventListener, string $payloadName): EventPublisher
{
$this->eventListeners[$payloadName][] = $eventListener;
return $this;
} | php | public function addEventListener(EventListenerInterface $eventListener, string $payloadName): EventPublisher
{
$this->eventListeners[$payloadName][] = $eventListener;
return $this;
} | [
"public",
"function",
"addEventListener",
"(",
"EventListenerInterface",
"$",
"eventListener",
",",
"string",
"$",
"payloadName",
")",
":",
"EventPublisher",
"{",
"$",
"this",
"->",
"eventListeners",
"[",
"$",
"payloadName",
"]",
"[",
"]",
"=",
"$",
"eventListen... | Add event listener.
@param EventListenerInterface $eventListener
@param string $payloadName
@return EventPublisher | [
"Add",
"event",
"listener",
"."
] | 43344d3a803081431c688aa8eb11fd3680eb8956 | https://github.com/extendsframework/extends-event/blob/43344d3a803081431c688aa8eb11fd3680eb8956/src/Publisher/EventPublisher.php#L36-L41 |
9,601 | emaphp/eMapper | lib/eMapper/Dynamic/Provider/EnvironmentProvider.php | EnvironmentProvider.getEnvironment | public static function getEnvironment($id) {
if (!array_key_exists($id, self::$environments))
throw new \InvalidArgumentException("Environment with ID $id does not exists");
return self::$environments[$id];
} | php | public static function getEnvironment($id) {
if (!array_key_exists($id, self::$environments))
throw new \InvalidArgumentException("Environment with ID $id does not exists");
return self::$environments[$id];
} | [
"public",
"static",
"function",
"getEnvironment",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"id",
",",
"self",
"::",
"$",
"environments",
")",
")",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Environment with ID $id ... | Obtains a dynamic SQL environment instance by ID
@param string $id
@throws \InvalidArgumentException | [
"Obtains",
"a",
"dynamic",
"SQL",
"environment",
"instance",
"by",
"ID"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Dynamic/Provider/EnvironmentProvider.php#L30-L35 |
9,602 | emaphp/eMapper | lib/eMapper/Dynamic/Provider/EnvironmentProvider.php | EnvironmentProvider.buildEnvironment | public static function buildEnvironment($id, $classname) {
//validate id
if (!is_string($id) || empty($id))
throw new \InvalidArgumentException("Environment id must be defined as a valid string");
//validate class name
if (!is_string($classname) || empty($classname))
throw new \InvalidArgumentException... | php | public static function buildEnvironment($id, $classname) {
//validate id
if (!is_string($id) || empty($id))
throw new \InvalidArgumentException("Environment id must be defined as a valid string");
//validate class name
if (!is_string($classname) || empty($classname))
throw new \InvalidArgumentException... | [
"public",
"static",
"function",
"buildEnvironment",
"(",
"$",
"id",
",",
"$",
"classname",
")",
"{",
"//validate id",
"if",
"(",
"!",
"is_string",
"(",
"$",
"id",
")",
"||",
"empty",
"(",
"$",
"id",
")",
")",
"throw",
"new",
"\\",
"InvalidArgumentExcepti... | Generates a new environment
@param string $id
@param string $classname
@throws \InvalidArgumentException
@return boolean | [
"Generates",
"a",
"new",
"environment"
] | df7100e601d2a1363d07028a786b6ceb22271829 | https://github.com/emaphp/eMapper/blob/df7100e601d2a1363d07028a786b6ceb22271829/lib/eMapper/Dynamic/Provider/EnvironmentProvider.php#L44-L63 |
9,603 | demmonico/yii2-helpers | src/ReflectionHelper.php | ReflectionHelper.parseGetterName | public static function parseGetterName($getterName)
{
if (false !== $pos = strpos($getterName, 'get'))
$getterName = substr($getterName, 3);
return strtolower($getterName);
} | php | public static function parseGetterName($getterName)
{
if (false !== $pos = strpos($getterName, 'get'))
$getterName = substr($getterName, 3);
return strtolower($getterName);
} | [
"public",
"static",
"function",
"parseGetterName",
"(",
"$",
"getterName",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"pos",
"=",
"strpos",
"(",
"$",
"getterName",
",",
"'get'",
")",
")",
"$",
"getterName",
"=",
"substr",
"(",
"$",
"getterName",
",",
"3... | Returns name of getter without 'get'
@param $getterName
@return string | [
"Returns",
"name",
"of",
"getter",
"without",
"get"
] | b6e1841d114b2f3eecfdd187ce2643a49cd5730d | https://github.com/demmonico/yii2-helpers/blob/b6e1841d114b2f3eecfdd187ce2643a49cd5730d/src/ReflectionHelper.php#L20-L25 |
9,604 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Infobar.php | Infobar.getRenderedPublished | public function getRenderedPublished()
{
$rendered = $this->getRenderedContent();
if ( $rendered instanceof Content )
{
return DateTime::max(
$rendered->publishedFrom,
$rendered->created
);
}
return null;
} | php | public function getRenderedPublished()
{
$rendered = $this->getRenderedContent();
if ( $rendered instanceof Content )
{
return DateTime::max(
$rendered->publishedFrom,
$rendered->created
);
}
return null;
} | [
"public",
"function",
"getRenderedPublished",
"(",
")",
"{",
"$",
"rendered",
"=",
"$",
"this",
"->",
"getRenderedContent",
"(",
")",
";",
"if",
"(",
"$",
"rendered",
"instanceof",
"Content",
")",
"{",
"return",
"DateTime",
"::",
"max",
"(",
"$",
"rendered... | Get published date
@return \DateTime | [
"Get",
"published",
"date"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Infobar.php#L152-L165 |
9,605 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Infobar.php | Infobar.setRootCreated | public function setRootCreated( $value )
{
$content = $this->getDependentContent();
if ( $content )
{
$content->created = $value;
}
return $this;
} | php | public function setRootCreated( $value )
{
$content = $this->getDependentContent();
if ( $content )
{
$content->created = $value;
}
return $this;
} | [
"public",
"function",
"setRootCreated",
"(",
"$",
"value",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getDependentContent",
"(",
")",
";",
"if",
"(",
"$",
"content",
")",
"{",
"$",
"content",
"->",
"created",
"=",
"$",
"value",
";",
"}",
"ret... | Set root's created time
@param string $value
@return \Paragraph\Model\Paragraph\Structure\Infobar | [
"Set",
"root",
"s",
"created",
"time"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Infobar.php#L190-L200 |
9,606 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Infobar.php | Infobar.setRootUserId | public function setRootUserId( $value )
{
$content = $this->getDependentContent();
if ( $content )
{
$content->userId = $value;
}
return $this;
} | php | public function setRootUserId( $value )
{
$content = $this->getDependentContent();
if ( $content )
{
$content->userId = $value;
}
return $this;
} | [
"public",
"function",
"setRootUserId",
"(",
"$",
"value",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getDependentContent",
"(",
")",
";",
"if",
"(",
"$",
"content",
")",
"{",
"$",
"content",
"->",
"userId",
"=",
"$",
"value",
";",
"}",
"retur... | Set root's user-id
@param string $value
@return \Paragraph\Model\Paragraph\Structure\Infobar | [
"Set",
"root",
"s",
"user",
"-",
"id"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Infobar.php#L225-L235 |
9,607 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/session.php | Session._init | public static function _init()
{
\Config::load('session', true);
if (\Config::get('session.auto_initialize', true))
{
static::instance();
}
if (\Config::get('session.native_emulation', false))
{
// emulate native PHP sessions
session_set_save_handler (
// open
function ($savePath, $sessi... | php | public static function _init()
{
\Config::load('session', true);
if (\Config::get('session.auto_initialize', true))
{
static::instance();
}
if (\Config::get('session.native_emulation', false))
{
// emulate native PHP sessions
session_set_save_handler (
// open
function ($savePath, $sessi... | [
"public",
"static",
"function",
"_init",
"(",
")",
"{",
"\\",
"Config",
"::",
"load",
"(",
"'session'",
",",
"true",
")",
";",
"if",
"(",
"\\",
"Config",
"::",
"get",
"(",
"'session.auto_initialize'",
",",
"true",
")",
")",
"{",
"static",
"::",
"instan... | Initialize by loading config & starting default session | [
"Initialize",
"by",
"loading",
"config",
"&",
"starting",
"default",
"session"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/session.php#L60-L109 |
9,608 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/MetaContent.php | MetaContent.setLayoutId | public function setLayoutId( $layoutId )
{
$this->_layout = null;
$this->layoutId = ( (int) $layoutId ) ?: null;
return $this;
} | php | public function setLayoutId( $layoutId )
{
$this->_layout = null;
$this->layoutId = ( (int) $layoutId ) ?: null;
return $this;
} | [
"public",
"function",
"setLayoutId",
"(",
"$",
"layoutId",
")",
"{",
"$",
"this",
"->",
"_layout",
"=",
"null",
";",
"$",
"this",
"->",
"layoutId",
"=",
"(",
"(",
"int",
")",
"$",
"layoutId",
")",
"?",
":",
"null",
";",
"return",
"$",
"this",
";",
... | Set layout-id
@param int $layoutId
@return \Paragraph\Model\Paragraph\Structure\Content | [
"Set",
"layout",
"-",
"id"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/MetaContent.php#L138-L143 |
9,609 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/MetaContent.php | MetaContent.getTags | function getTags()
{
if( $this->getRenderedMetaContent() instanceof TagsAwareInterface )
{
return array_unique(
array_merge(
parent::getTags(),
$this->getRenderedMetaContent()->getTags()
)... | php | function getTags()
{
if( $this->getRenderedMetaContent() instanceof TagsAwareInterface )
{
return array_unique(
array_merge(
parent::getTags(),
$this->getRenderedMetaContent()->getTags()
)... | [
"function",
"getTags",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getRenderedMetaContent",
"(",
")",
"instanceof",
"TagsAwareInterface",
")",
"{",
"return",
"array_unique",
"(",
"array_merge",
"(",
"parent",
"::",
"getTags",
"(",
")",
",",
"$",
"this",
... | Get tags of the paragraph
@return array | [
"Get",
"tags",
"of",
"the",
"paragraph"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/MetaContent.php#L218-L229 |
9,610 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/MetaContent.php | MetaContent.getTagIds | function getTagIds()
{
if( $this->getRenderedMetaContent() instanceof TagsAwareInterface )
{
return array_unique(
array_merge(
parent::getTagIds(),
$this->getRenderedMetaContent()->getTagIds()
... | php | function getTagIds()
{
if( $this->getRenderedMetaContent() instanceof TagsAwareInterface )
{
return array_unique(
array_merge(
parent::getTagIds(),
$this->getRenderedMetaContent()->getTagIds()
... | [
"function",
"getTagIds",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getRenderedMetaContent",
"(",
")",
"instanceof",
"TagsAwareInterface",
")",
"{",
"return",
"array_unique",
"(",
"array_merge",
"(",
"parent",
"::",
"getTagIds",
"(",
")",
",",
"$",
"this"... | Get tag ids of the paragraph
@return array | [
"Get",
"tag",
"ids",
"of",
"the",
"paragraph"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/MetaContent.php#L236-L247 |
9,611 | webriq/core | module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/MetaContent.php | MetaContent.getLocaleTags | function getLocaleTags()
{
if( $this->getRenderedMetaContent() instanceof TagsAwareInterface )
{
return array_unique(
array_merge(
parent::getLocaleTags(),
$this->getRenderedMetaContent()->getLocaleTags()
... | php | function getLocaleTags()
{
if( $this->getRenderedMetaContent() instanceof TagsAwareInterface )
{
return array_unique(
array_merge(
parent::getLocaleTags(),
$this->getRenderedMetaContent()->getLocaleTags()
... | [
"function",
"getLocaleTags",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getRenderedMetaContent",
"(",
")",
"instanceof",
"TagsAwareInterface",
")",
"{",
"return",
"array_unique",
"(",
"array_merge",
"(",
"parent",
"::",
"getLocaleTags",
"(",
")",
",",
"$",
... | Get locale-tags of the paragraph
@return array | [
"Get",
"locale",
"-",
"tags",
"of",
"the",
"paragraph"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/MetaContent.php#L254-L265 |
9,612 | BlackBoxRepo/PandoContentBundle | Service/BlockVariableService.php | BlockVariableService.populateBlockVariables | public function populateBlockVariables()
{
/** @var BlockVariableDocument $variable */
foreach ($this->block->getVariables() as $variable) {
$this->setBlockVariable($variable->getName(), $this->methodService->call($variable->getMethodArgument()));
}
} | php | public function populateBlockVariables()
{
/** @var BlockVariableDocument $variable */
foreach ($this->block->getVariables() as $variable) {
$this->setBlockVariable($variable->getName(), $this->methodService->call($variable->getMethodArgument()));
}
} | [
"public",
"function",
"populateBlockVariables",
"(",
")",
"{",
"/** @var BlockVariableDocument $variable */",
"foreach",
"(",
"$",
"this",
"->",
"block",
"->",
"getVariables",
"(",
")",
"as",
"$",
"variable",
")",
"{",
"$",
"this",
"->",
"setBlockVariable",
"(",
... | Sets the blocks viewVariables where the keys are the BlockVariableDocument names
and the values are the return of the associated method
@return ArrayCollection | [
"Sets",
"the",
"blocks",
"viewVariables",
"where",
"the",
"keys",
"are",
"the",
"BlockVariableDocument",
"names",
"and",
"the",
"values",
"are",
"the",
"return",
"of",
"the",
"associated",
"method"
] | fa54d0c7542c1d359a5dbb4f32dab3e195e41007 | https://github.com/BlackBoxRepo/PandoContentBundle/blob/fa54d0c7542c1d359a5dbb4f32dab3e195e41007/Service/BlockVariableService.php#L59-L65 |
9,613 | AlphaLabs/FilterEngine | src/FilterBag/Factory/ExpressionParserFactory.php | ExpressionParserFactory.getFilterBagFromExpression | public function getFilterBagFromExpression($filtersExpression)
{
$parser = new Parser($filtersExpression);
$filtersAST = $parser->getAST();
$filterBag = new FilterBag();
$filterBag->set('filter_' . md5($filtersExpression), $filtersAST);
return $filterBag;
} | php | public function getFilterBagFromExpression($filtersExpression)
{
$parser = new Parser($filtersExpression);
$filtersAST = $parser->getAST();
$filterBag = new FilterBag();
$filterBag->set('filter_' . md5($filtersExpression), $filtersAST);
return $filterBag;
} | [
"public",
"function",
"getFilterBagFromExpression",
"(",
"$",
"filtersExpression",
")",
"{",
"$",
"parser",
"=",
"new",
"Parser",
"(",
"$",
"filtersExpression",
")",
";",
"$",
"filtersAST",
"=",
"$",
"parser",
"->",
"getAST",
"(",
")",
";",
"$",
"filterBag",... | Build a FilterBag object by parsing the given filters expression
@param $filtersExpression
@return FilterBagInterface | [
"Build",
"a",
"FilterBag",
"object",
"by",
"parsing",
"the",
"given",
"filters",
"expression"
] | 806a7c31e50839033dbf0d41aed34b8d14c347f6 | https://github.com/AlphaLabs/FilterEngine/blob/806a7c31e50839033dbf0d41aed34b8d14c347f6/src/FilterBag/Factory/ExpressionParserFactory.php#L26-L35 |
9,614 | mszewcz/php-light-framework | src/Html/Controlls/Text.php | Text.textarea | public static function textarea(string $name = '', $value = '', array $attributes = []): string
{
$defaultAttributes = ['method-get' => false, 'cols' => 20, 'rows' => 40, 'class' => 'form-textarea'];
$userAttributes = \array_merge($defaultAttributes, $attributes);
$attributes = [];
$... | php | public static function textarea(string $name = '', $value = '', array $attributes = []): string
{
$defaultAttributes = ['method-get' => false, 'cols' => 20, 'rows' => 40, 'class' => 'form-textarea'];
$userAttributes = \array_merge($defaultAttributes, $attributes);
$attributes = [];
$... | [
"public",
"static",
"function",
"textarea",
"(",
"string",
"$",
"name",
"=",
"''",
",",
"$",
"value",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"defaultAttributes",
"=",
"[",
"'method-get'",
"=>",
"false",... | This method returns textarea controll
@param string $name
@param mixed $value
@param array $attributes
@return string | [
"This",
"method",
"returns",
"textarea",
"controll"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Html/Controlls/Text.php#L97-L107 |
9,615 | getconnect/connect-php | src/Client.php | Client.pushEvent | private function pushEvent($collection, $eventDetails) {
$event = new Event($eventDetails);
return $this->client->pushEvent($collection, $event->getDetails());
} | php | private function pushEvent($collection, $eventDetails) {
$event = new Event($eventDetails);
return $this->client->pushEvent($collection, $event->getDetails());
} | [
"private",
"function",
"pushEvent",
"(",
"$",
"collection",
",",
"$",
"eventDetails",
")",
"{",
"$",
"event",
"=",
"new",
"Event",
"(",
"$",
"eventDetails",
")",
";",
"return",
"$",
"this",
"->",
"client",
"->",
"pushEvent",
"(",
"$",
"collection",
",",
... | Push an event to the API client.
@param string $collection The name of the collection to push to
@param array $eventDetails The event details
@return Response | [
"Push",
"an",
"event",
"to",
"the",
"API",
"client",
"."
] | cbce3daae58eca16450df811ac6f1280fc1ef6b1 | https://github.com/getconnect/connect-php/blob/cbce3daae58eca16450df811ac6f1280fc1ef6b1/src/Client.php#L47-L50 |
9,616 | novuso/common | src/Domain/Value/Money/Money.php | Money.add | public function add(Money $other): Money
{
$this->guardCurrency($other);
$amount = $this->amount + $other->amount;
$this->guardAmountInBounds($amount);
return $this->withAmount($amount);
} | php | public function add(Money $other): Money
{
$this->guardCurrency($other);
$amount = $this->amount + $other->amount;
$this->guardAmountInBounds($amount);
return $this->withAmount($amount);
} | [
"public",
"function",
"add",
"(",
"Money",
"$",
"other",
")",
":",
"Money",
"{",
"$",
"this",
"->",
"guardCurrency",
"(",
"$",
"other",
")",
";",
"$",
"amount",
"=",
"$",
"this",
"->",
"amount",
"+",
"$",
"other",
"->",
"amount",
";",
"$",
"this",
... | Creates instance that adds the given monetary value
@param Money $other The other monetary value
@return Money
@throws DomainException When other has different currency
@throws RangeException When integer overflow occurs | [
"Creates",
"instance",
"that",
"adds",
"the",
"given",
"monetary",
"value"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Value/Money/Money.php#L173-L182 |
9,617 | novuso/common | src/Domain/Value/Money/Money.php | Money.subtract | public function subtract(Money $other): Money
{
$this->guardCurrency($other);
$amount = $this->amount - $other->amount;
$this->guardAmountInBounds($amount);
return $this->withAmount($amount);
} | php | public function subtract(Money $other): Money
{
$this->guardCurrency($other);
$amount = $this->amount - $other->amount;
$this->guardAmountInBounds($amount);
return $this->withAmount($amount);
} | [
"public",
"function",
"subtract",
"(",
"Money",
"$",
"other",
")",
":",
"Money",
"{",
"$",
"this",
"->",
"guardCurrency",
"(",
"$",
"other",
")",
";",
"$",
"amount",
"=",
"$",
"this",
"->",
"amount",
"-",
"$",
"other",
"->",
"amount",
";",
"$",
"th... | Creates instance that subtracts the given monetary value
@param Money $other The other monetary value
@return Money
@throws DomainException When other has different currency
@throws RangeException When integer overflow occurs | [
"Creates",
"instance",
"that",
"subtracts",
"the",
"given",
"monetary",
"value"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Value/Money/Money.php#L194-L203 |
9,618 | novuso/common | src/Domain/Value/Money/Money.php | Money.multiply | public function multiply($multiplier, ?RoundingMode $mode = null): Money
{
if ($mode === null) {
$mode = RoundingMode::HALF_UP();
}
$this->guardOperand($multiplier);
$amount = round($this->amount * $multiplier, 0, $mode->value());
$amount = $this->castToInteger(... | php | public function multiply($multiplier, ?RoundingMode $mode = null): Money
{
if ($mode === null) {
$mode = RoundingMode::HALF_UP();
}
$this->guardOperand($multiplier);
$amount = round($this->amount * $multiplier, 0, $mode->value());
$amount = $this->castToInteger(... | [
"public",
"function",
"multiply",
"(",
"$",
"multiplier",
",",
"?",
"RoundingMode",
"$",
"mode",
"=",
"null",
")",
":",
"Money",
"{",
"if",
"(",
"$",
"mode",
"===",
"null",
")",
"{",
"$",
"mode",
"=",
"RoundingMode",
"::",
"HALF_UP",
"(",
")",
";",
... | Creates instance that multiplies this value by the given value
@param int|float $multiplier The multiplier
@param RoundingMode|null $mode The rounding mode; null for HALF_UP
@return Money
@throws DomainException When multiplier is not an int or float
@throws RangeException When integer overflow occurs | [
"Creates",
"instance",
"that",
"multiplies",
"this",
"value",
"by",
"the",
"given",
"value"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Value/Money/Money.php#L216-L228 |
9,619 | novuso/common | src/Domain/Value/Money/Money.php | Money.divide | public function divide($divisor, ?RoundingMode $mode = null): Money
{
if ($mode === null) {
$mode = RoundingMode::HALF_UP();
}
$this->guardOperand($divisor);
if ($divisor === 0 || $divisor === 0.0) {
throw new DomainException('Division by zero');
}
... | php | public function divide($divisor, ?RoundingMode $mode = null): Money
{
if ($mode === null) {
$mode = RoundingMode::HALF_UP();
}
$this->guardOperand($divisor);
if ($divisor === 0 || $divisor === 0.0) {
throw new DomainException('Division by zero');
}
... | [
"public",
"function",
"divide",
"(",
"$",
"divisor",
",",
"?",
"RoundingMode",
"$",
"mode",
"=",
"null",
")",
":",
"Money",
"{",
"if",
"(",
"$",
"mode",
"===",
"null",
")",
"{",
"$",
"mode",
"=",
"RoundingMode",
"::",
"HALF_UP",
"(",
")",
";",
"}",... | Creates instance that divides this value by the given value
@param int|float $divisor The divisor
@param RoundingMode|null $mode The rounding mode; null for HALF_UP
@return Money
@throws DomainException When divisor is not an int or float
@throws DomainException When the divisor is zero
@throws RangeExcep... | [
"Creates",
"instance",
"that",
"divides",
"this",
"value",
"by",
"the",
"given",
"value"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Value/Money/Money.php#L242-L258 |
9,620 | novuso/common | src/Domain/Value/Money/Money.php | Money.allocate | public function allocate(array $ratios): array
{
$total = array_sum($ratios);
$remainder = $this->amount;
$shares = [];
foreach ($ratios as $ratio) {
$amount = $this->castToInteger($this->amount * $ratio / $total);
$shares[] = $this->withAmount($amount);
... | php | public function allocate(array $ratios): array
{
$total = array_sum($ratios);
$remainder = $this->amount;
$shares = [];
foreach ($ratios as $ratio) {
$amount = $this->castToInteger($this->amount * $ratio / $total);
$shares[] = $this->withAmount($amount);
... | [
"public",
"function",
"allocate",
"(",
"array",
"$",
"ratios",
")",
":",
"array",
"{",
"$",
"total",
"=",
"array_sum",
"(",
"$",
"ratios",
")",
";",
"$",
"remainder",
"=",
"$",
"this",
"->",
"amount",
";",
"$",
"shares",
"=",
"[",
"]",
";",
"foreac... | Allocates the money according to a list of ratios
@param array $ratios The list of ratios
@return Money[] | [
"Allocates",
"the",
"money",
"according",
"to",
"a",
"list",
"of",
"ratios"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Value/Money/Money.php#L267-L284 |
9,621 | novuso/common | src/Domain/Value/Money/Money.php | Money.split | public function split(int $num): array
{
if ($num <= 0) {
$message = sprintf('%s expects $num to be greater than zero', __METHOD__);
throw new DomainException($message);
}
$amount = $this->castToInteger($this->amount / $num);
$remainder = $this->amount % $num... | php | public function split(int $num): array
{
if ($num <= 0) {
$message = sprintf('%s expects $num to be greater than zero', __METHOD__);
throw new DomainException($message);
}
$amount = $this->castToInteger($this->amount / $num);
$remainder = $this->amount % $num... | [
"public",
"function",
"split",
"(",
"int",
"$",
"num",
")",
":",
"array",
"{",
"if",
"(",
"$",
"num",
"<=",
"0",
")",
"{",
"$",
"message",
"=",
"sprintf",
"(",
"'%s expects $num to be greater than zero'",
",",
"__METHOD__",
")",
";",
"throw",
"new",
"Dom... | Allocates the money among a given number of targets
@param int $num The number of targets
@return Money[]
@throws DomainException When num is not greater than zero | [
"Allocates",
"the",
"money",
"among",
"a",
"given",
"number",
"of",
"targets"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Value/Money/Money.php#L295-L315 |
9,622 | novuso/common | src/Domain/Value/Money/Money.php | Money.guardOperand | protected function guardOperand($operand): void
{
if (!is_int($operand) && !is_float($operand)) {
$message = sprintf(
'Operand must be an integer or float; received (%s) %s',
gettype($operand),
VarPrinter::toString($operand)
);
... | php | protected function guardOperand($operand): void
{
if (!is_int($operand) && !is_float($operand)) {
$message = sprintf(
'Operand must be an integer or float; received (%s) %s',
gettype($operand),
VarPrinter::toString($operand)
);
... | [
"protected",
"function",
"guardOperand",
"(",
"$",
"operand",
")",
":",
"void",
"{",
"if",
"(",
"!",
"is_int",
"(",
"$",
"operand",
")",
"&&",
"!",
"is_float",
"(",
"$",
"operand",
")",
")",
"{",
"$",
"message",
"=",
"sprintf",
"(",
"'Operand must be a... | Validates monetary operand is an integer or float
@param mixed $operand The operand
@return void
@throws DomainException When operand is not an int or float | [
"Validates",
"monetary",
"operand",
"is",
"an",
"integer",
"or",
"float"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/Value/Money/Money.php#L460-L470 |
9,623 | silvercommerce/settings | src/extensions/ControllerExtension.php | ControllerExtension.onBeforeInit | public function onBeforeInit()
{
$disallowed_controllers = [
DevelopmentAdmin::class,
DevBuildController::class,
DatabaseAdmin::class
];
// Don't run this during dev/build or dev/tasks
if (!in_array(get_class($this->owner), $disallowed_controllers... | php | public function onBeforeInit()
{
$disallowed_controllers = [
DevelopmentAdmin::class,
DevBuildController::class,
DatabaseAdmin::class
];
// Don't run this during dev/build or dev/tasks
if (!in_array(get_class($this->owner), $disallowed_controllers... | [
"public",
"function",
"onBeforeInit",
"(",
")",
"{",
"$",
"disallowed_controllers",
"=",
"[",
"DevelopmentAdmin",
"::",
"class",
",",
"DevBuildController",
"::",
"class",
",",
"DatabaseAdmin",
"::",
"class",
"]",
";",
"// Don't run this during dev/build or dev/tasks",
... | Customise the default silverstripe locale config | [
"Customise",
"the",
"default",
"silverstripe",
"locale",
"config"
] | 632e4443866a3b4de57c3e641fac33a8b5c76308 | https://github.com/silvercommerce/settings/blob/632e4443866a3b4de57c3e641fac33a8b5c76308/src/extensions/ControllerExtension.php#L19-L38 |
9,624 | PSESD/cascade-core-types | TypeTime/widgets/SummaryWidget.php | SummaryWidget.getModule | public function getModule()
{
$method = ArrayHelper::getValue($this->parentWidget->settings, 'queryRole', 'all');
$relationship = ArrayHelper::getValue($this->parentWidget->settings, 'relationship', false);
if ($method === 'children') {
return $relationship->child;
} else... | php | public function getModule()
{
$method = ArrayHelper::getValue($this->parentWidget->settings, 'queryRole', 'all');
$relationship = ArrayHelper::getValue($this->parentWidget->settings, 'relationship', false);
if ($method === 'children') {
return $relationship->child;
} else... | [
"public",
"function",
"getModule",
"(",
")",
"{",
"$",
"method",
"=",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"this",
"->",
"parentWidget",
"->",
"settings",
",",
"'queryRole'",
",",
"'all'",
")",
";",
"$",
"relationship",
"=",
"ArrayHelper",
"::",
"get... | Get module.
@return [[@doctodo return_type:getModule]] [[@doctodo return_description:getModule]] | [
"Get",
"module",
"."
] | 5a2bc524bd89545f0f28230e34518c9f92e7db1f | https://github.com/PSESD/cascade-core-types/blob/5a2bc524bd89545f0f28230e34518c9f92e7db1f/TypeTime/widgets/SummaryWidget.php#L87-L98 |
9,625 | mtils/beetree | src/BeeTree/Eloquent/ActAsEloquentNode.php | ActAsEloquentNode.getChildren | public function getChildren()
{
if (isset($this->relations['children'])) {
return $this->relations['children'];
}
$children = $this->getAttribute('children');
return $children === null ? [] : $children;
} | php | public function getChildren()
{
if (isset($this->relations['children'])) {
return $this->relations['children'];
}
$children = $this->getAttribute('children');
return $children === null ? [] : $children;
} | [
"public",
"function",
"getChildren",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"relations",
"[",
"'children'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"relations",
"[",
"'children'",
"]",
";",
"}",
"$",
"children",
"=",
"$",... | Returns the childs of this node
@return \BeeTree\Contracts\Children | [
"Returns",
"the",
"childs",
"of",
"this",
"node"
] | 4a68fc94ec14d5faef773b1628c9060db7bf1ce2 | https://github.com/mtils/beetree/blob/4a68fc94ec14d5faef773b1628c9060db7bf1ce2/src/BeeTree/Eloquent/ActAsEloquentNode.php#L73-L82 |
9,626 | mtils/beetree | src/BeeTree/Eloquent/ActAsEloquentNode.php | ActAsEloquentNode.getLevel | public function getLevel()
{
if ($this->_level !== null) {
return $this->_level;
}
if ($this->isRoot()) {
$this->_level = -1;
return $this->_level;
}
$parents = array($this);
$node = $this;
while ($parent = $node->getPare... | php | public function getLevel()
{
if ($this->_level !== null) {
return $this->_level;
}
if ($this->isRoot()) {
$this->_level = -1;
return $this->_level;
}
$parents = array($this);
$node = $this;
while ($parent = $node->getPare... | [
"public",
"function",
"getLevel",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_level",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_level",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isRoot",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_... | Returns the level of this node
@return int | [
"Returns",
"the",
"level",
"of",
"this",
"node"
] | 4a68fc94ec14d5faef773b1628c9060db7bf1ce2 | https://github.com/mtils/beetree/blob/4a68fc94ec14d5faef773b1628c9060db7bf1ce2/src/BeeTree/Eloquent/ActAsEloquentNode.php#L155-L179 |
9,627 | fluxbb/commonmark | src/DocumentParser.php | DocumentParser.convert | public function convert($markdown)
{
$root = new Container();
$this->inlineParser = new InlineParser($this->links, $this->titles);
$parser = $this->buildParserStack();
$text = new Text($markdown);
$this->prepare($text);
$parser->parseBlock($text, $root);
$... | php | public function convert($markdown)
{
$root = new Container();
$this->inlineParser = new InlineParser($this->links, $this->titles);
$parser = $this->buildParserStack();
$text = new Text($markdown);
$this->prepare($text);
$parser->parseBlock($text, $root);
$... | [
"public",
"function",
"convert",
"(",
"$",
"markdown",
")",
"{",
"$",
"root",
"=",
"new",
"Container",
"(",
")",
";",
"$",
"this",
"->",
"inlineParser",
"=",
"new",
"InlineParser",
"(",
"$",
"this",
"->",
"links",
",",
"$",
"this",
"->",
"titles",
")... | Parse the given Markdown text into a document tree.
@param string $markdown
@return Container | [
"Parse",
"the",
"given",
"Markdown",
"text",
"into",
"a",
"document",
"tree",
"."
] | a61795a074aac19d8509f5673d5ee230dca292bc | https://github.com/fluxbb/commonmark/blob/a61795a074aac19d8509f5673d5ee230dca292bc/src/DocumentParser.php#L65-L80 |
9,628 | fluxbb/commonmark | src/DocumentParser.php | DocumentParser.prepare | protected function prepare(Text $text)
{
// Unify line endings
$text->replaceString("\r\n", "\n");
$text->replaceString("\r", "\n");
// Replace tabs by spaces
$text->replace('/(.*?)\t/', function (Text $whole, Text $string) {
$tabWidth = 4;
return $st... | php | protected function prepare(Text $text)
{
// Unify line endings
$text->replaceString("\r\n", "\n");
$text->replaceString("\r", "\n");
// Replace tabs by spaces
$text->replace('/(.*?)\t/', function (Text $whole, Text $string) {
$tabWidth = 4;
return $st... | [
"protected",
"function",
"prepare",
"(",
"Text",
"$",
"text",
")",
"{",
"// Unify line endings",
"$",
"text",
"->",
"replaceString",
"(",
"\"\\r\\n\"",
",",
"\"\\n\"",
")",
";",
"$",
"text",
"->",
"replaceString",
"(",
"\"\\r\"",
",",
"\"\\n\"",
")",
";",
... | Preprocess the text.
This unifies line endings and replaces tabs by spaces.
@param Text $text
@return void | [
"Preprocess",
"the",
"text",
"."
] | a61795a074aac19d8509f5673d5ee230dca292bc | https://github.com/fluxbb/commonmark/blob/a61795a074aac19d8509f5673d5ee230dca292bc/src/DocumentParser.php#L90-L101 |
9,629 | prastowoagungwidodo/mvc | src/Transformatika/MVC/View.php | View.includeBlock | public function includeBlock($blockName)
{
$blockName = str_replace('/', DIRECTORY_SEPARATOR, $blockName);
$blockContent = '';
$blockFile = BASE_PATH . DIRECTORY_SEPARATOR . 'storage' . DIRECTORY_SEPARATOR . 'share' . DIRECTORY_SEPARATOR . 'layout' . DIRECTORY_SEPARATOR . $blockName . '.' . ... | php | public function includeBlock($blockName)
{
$blockName = str_replace('/', DIRECTORY_SEPARATOR, $blockName);
$blockContent = '';
$blockFile = BASE_PATH . DIRECTORY_SEPARATOR . 'storage' . DIRECTORY_SEPARATOR . 'share' . DIRECTORY_SEPARATOR . 'layout' . DIRECTORY_SEPARATOR . $blockName . '.' . ... | [
"public",
"function",
"includeBlock",
"(",
"$",
"blockName",
")",
"{",
"$",
"blockName",
"=",
"str_replace",
"(",
"'/'",
",",
"DIRECTORY_SEPARATOR",
",",
"$",
"blockName",
")",
";",
"$",
"blockContent",
"=",
"''",
";",
"$",
"blockFile",
"=",
"BASE_PATH",
"... | Include Block Layout | [
"Include",
"Block",
"Layout"
] | 56ce9d4589e5951690388e0a115466750c148adb | https://github.com/prastowoagungwidodo/mvc/blob/56ce9d4589e5951690388e0a115466750c148adb/src/Transformatika/MVC/View.php#L96-L120 |
9,630 | prastowoagungwidodo/mvc | src/Transformatika/MVC/View.php | View.includeFile | public function includeFile($templateFile = '')
{
if (!empty($templateFile)) {
str_replace('/', DIRECTORY_SEPARATOR, $templateFile);
if (file_exists($this->appPath . DIRECTORY_SEPARATOR . $templateFile)) {
require_once $this->appPath . DIRECTORY_SEPARATOR . $templateF... | php | public function includeFile($templateFile = '')
{
if (!empty($templateFile)) {
str_replace('/', DIRECTORY_SEPARATOR, $templateFile);
if (file_exists($this->appPath . DIRECTORY_SEPARATOR . $templateFile)) {
require_once $this->appPath . DIRECTORY_SEPARATOR . $templateF... | [
"public",
"function",
"includeFile",
"(",
"$",
"templateFile",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"templateFile",
")",
")",
"{",
"str_replace",
"(",
"'/'",
",",
"DIRECTORY_SEPARATOR",
",",
"$",
"templateFile",
")",
";",
"if",
"(",
... | Include other file
@param string $templateFile | [
"Include",
"other",
"file"
] | 56ce9d4589e5951690388e0a115466750c148adb | https://github.com/prastowoagungwidodo/mvc/blob/56ce9d4589e5951690388e0a115466750c148adb/src/Transformatika/MVC/View.php#L138-L146 |
9,631 | neonbug/meexo-common | src/Providers/BaseServiceProvider.php | BaseServiceProvider.bootTraits | protected static function bootTraits()
{
foreach (class_uses_recursive(get_called_class()) as $trait) {
if (method_exists(get_called_class(), $method = 'boot'.class_basename($trait))) {
forward_static_call([get_called_class(), $method]);
//$this->$method();
}
}
} | php | protected static function bootTraits()
{
foreach (class_uses_recursive(get_called_class()) as $trait) {
if (method_exists(get_called_class(), $method = 'boot'.class_basename($trait))) {
forward_static_call([get_called_class(), $method]);
//$this->$method();
}
}
} | [
"protected",
"static",
"function",
"bootTraits",
"(",
")",
"{",
"foreach",
"(",
"class_uses_recursive",
"(",
"get_called_class",
"(",
")",
")",
"as",
"$",
"trait",
")",
"{",
"if",
"(",
"method_exists",
"(",
"get_called_class",
"(",
")",
",",
"$",
"method",
... | Boot all of the bootable traits on the ServiceProvider.
@return void | [
"Boot",
"all",
"of",
"the",
"bootable",
"traits",
"on",
"the",
"ServiceProvider",
"."
] | 8fe9a5d1b73311c65a7c5a0ce8a4e859d39351c6 | https://github.com/neonbug/meexo-common/blob/8fe9a5d1b73311c65a7c5a0ce8a4e859d39351c6/src/Providers/BaseServiceProvider.php#L37-L45 |
9,632 | franzip/serp-fetcher | src/Fetchers/YahooFetcher.php | YahooFetcher.getPageTitles | protected function getPageTitles($SHDObject)
{
$titles = array();
foreach($SHDObject->find('.compTitle h3.title') as $object) {
// extract and clean anchors innertext
$titleText = $object->innertext;
$titles[] = $this->cleanText($titleText);
}
// ... | php | protected function getPageTitles($SHDObject)
{
$titles = array();
foreach($SHDObject->find('.compTitle h3.title') as $object) {
// extract and clean anchors innertext
$titleText = $object->innertext;
$titles[] = $this->cleanText($titleText);
}
// ... | [
"protected",
"function",
"getPageTitles",
"(",
"$",
"SHDObject",
")",
"{",
"$",
"titles",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"SHDObject",
"->",
"find",
"(",
"'.compTitle h3.title'",
")",
"as",
"$",
"object",
")",
"{",
"// extract and clean anc... | Get all titles for a given Yahoo SERP page.
@param SimpleHtmlDom $SHDObject
@return array | [
"Get",
"all",
"titles",
"for",
"a",
"given",
"Yahoo",
"SERP",
"page",
"."
] | 0554b682a8e4aec6e5d615866087b34e731e0d88 | https://github.com/franzip/serp-fetcher/blob/0554b682a8e4aec6e5d615866087b34e731e0d88/src/Fetchers/YahooFetcher.php#L42-L52 |
9,633 | franzip/serp-fetcher | src/Fetchers/YahooFetcher.php | YahooFetcher.getPageSnippets | protected function getPageSnippets($SHDObject)
{
$snippets = array();
foreach ($SHDObject->find('.aAbs') as $object) {
$snippetText = $this->cleanText($object->innertext);
$snippets[] = $this->fixRepeatedSpace($snippetText);
}
// fetch only organic results
... | php | protected function getPageSnippets($SHDObject)
{
$snippets = array();
foreach ($SHDObject->find('.aAbs') as $object) {
$snippetText = $this->cleanText($object->innertext);
$snippets[] = $this->fixRepeatedSpace($snippetText);
}
// fetch only organic results
... | [
"protected",
"function",
"getPageSnippets",
"(",
"$",
"SHDObject",
")",
"{",
"$",
"snippets",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"SHDObject",
"->",
"find",
"(",
"'.aAbs'",
")",
"as",
"$",
"object",
")",
"{",
"$",
"snippetText",
"=",
"$",... | Get all snippets for a given Yahoo SERP page.
@param SimpleHtmlDom $SHDObject
@return array | [
"Get",
"all",
"snippets",
"for",
"a",
"given",
"Yahoo",
"SERP",
"page",
"."
] | 0554b682a8e4aec6e5d615866087b34e731e0d88 | https://github.com/franzip/serp-fetcher/blob/0554b682a8e4aec6e5d615866087b34e731e0d88/src/Fetchers/YahooFetcher.php#L59-L68 |
9,634 | dlds/yii2-rels | components/Interpreter.php | Interpreter.interpretAttribute | public function interpretAttribute($attribute, $index = null)
{
if ($index) {
$availables = $this->getInterpretations();
if (isset($availables[$index])) {
return $availables[$index]->{$attribute};
}
}
$current = $this->getCurrentInterpret... | php | public function interpretAttribute($attribute, $index = null)
{
if ($index) {
$availables = $this->getInterpretations();
if (isset($availables[$index])) {
return $availables[$index]->{$attribute};
}
}
$current = $this->getCurrentInterpret... | [
"public",
"function",
"interpretAttribute",
"(",
"$",
"attribute",
",",
"$",
"index",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"index",
")",
"{",
"$",
"availables",
"=",
"$",
"this",
"->",
"getInterpretations",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"... | Retrieves attribute interpretation for current hasMany relation
@param string $attribute attribute name
@return mixed Attribute value if interpretation exists otherwise NULL | [
"Retrieves",
"attribute",
"interpretation",
"for",
"current",
"hasMany",
"relation"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L111-L128 |
9,635 | dlds/yii2-rels | components/Interpreter.php | Interpreter.getInterpretations | public function getInterpretations($data = null)
{
$condition = [$this->relPrimaryKey => $this->owner->primaryKey];
$restriction = $this->_getRestriction($data, $this->relSecondaryKey, false);
if ($restriction) {
$condition = ArrayHelper::merge($condition, $restriction);
... | php | public function getInterpretations($data = null)
{
$condition = [$this->relPrimaryKey => $this->owner->primaryKey];
$restriction = $this->_getRestriction($data, $this->relSecondaryKey, false);
if ($restriction) {
$condition = ArrayHelper::merge($condition, $restriction);
... | [
"public",
"function",
"getInterpretations",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"$",
"condition",
"=",
"[",
"$",
"this",
"->",
"relPrimaryKey",
"=>",
"$",
"this",
"->",
"owner",
"->",
"primaryKey",
"]",
";",
"$",
"restriction",
"=",
"$",
"this",
"... | Retrieves interpretations based on gived data
@param array $data | [
"Retrieves",
"interpretations",
"based",
"on",
"gived",
"data"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L148-L163 |
9,636 | dlds/yii2-rels | components/Interpreter.php | Interpreter.setInterpretations | public function setInterpretations($data)
{
if ($data && ArrayHelper::getValue($data, $this->viaModel->formName(), false)) {
$data = $this->pushSecondaryKeys($data, $this->viaModel->formName());
$this->_relationsToSave = $this->pushMissingInterpretations($this->getInterpretations($d... | php | public function setInterpretations($data)
{
if ($data && ArrayHelper::getValue($data, $this->viaModel->formName(), false)) {
$data = $this->pushSecondaryKeys($data, $this->viaModel->formName());
$this->_relationsToSave = $this->pushMissingInterpretations($this->getInterpretations($d... | [
"public",
"function",
"setInterpretations",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"&&",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"data",
",",
"$",
"this",
"->",
"viaModel",
"->",
"formName",
"(",
")",
",",
"false",
")",
")",
"{",
"$",... | Sets specific model relations attributes
@param array $data relations data to be set | [
"Sets",
"specific",
"model",
"relations",
"attributes"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L169-L184 |
9,637 | dlds/yii2-rels | components/Interpreter.php | Interpreter.getAllInterpretations | public function getAllInterpretations()
{
$hash = $this->_getInterpreterHash();
if (!$this->allowCache || empty($this->_allInterpretations[$hash])) {
$this->_allInterpretations[$hash] = $this->pushMissingInterpretations($this->getInterpretations());
}
return $this->_all... | php | public function getAllInterpretations()
{
$hash = $this->_getInterpreterHash();
if (!$this->allowCache || empty($this->_allInterpretations[$hash])) {
$this->_allInterpretations[$hash] = $this->pushMissingInterpretations($this->getInterpretations());
}
return $this->_all... | [
"public",
"function",
"getAllInterpretations",
"(",
")",
"{",
"$",
"hash",
"=",
"$",
"this",
"->",
"_getInterpreterHash",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"allowCache",
"||",
"empty",
"(",
"$",
"this",
"->",
"_allInterpretations",
"[",
"... | Retrieves all possible hasMany relation models for owner.
@return array hasMany relation models array | [
"Retrieves",
"all",
"possible",
"hasMany",
"relation",
"models",
"for",
"owner",
"."
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L201-L210 |
9,638 | dlds/yii2-rels | components/Interpreter.php | Interpreter.setAllInterpretations | public function setAllInterpretations($data)
{
$model = $this->viaModel;
$this->_relationsToSave = $this->getAllInterpretations();
$model::loadMultiple($this->_relationsToSave, $data);
return $this;
} | php | public function setAllInterpretations($data)
{
$model = $this->viaModel;
$this->_relationsToSave = $this->getAllInterpretations();
$model::loadMultiple($this->_relationsToSave, $data);
return $this;
} | [
"public",
"function",
"setAllInterpretations",
"(",
"$",
"data",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"viaModel",
";",
"$",
"this",
"->",
"_relationsToSave",
"=",
"$",
"this",
"->",
"getAllInterpretations",
"(",
")",
";",
"$",
"model",
"::",
"... | Sets all model relations attributes
@param array $data relations data to be set | [
"Sets",
"all",
"model",
"relations",
"attributes"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L216-L225 |
9,639 | dlds/yii2-rels | components/Interpreter.php | Interpreter.pushSecondaryKeys | protected function pushSecondaryKeys($data, $form)
{
if (isset($data[$form]) && is_array($data[$form])) {
foreach ($data[$form] as $secondaryKey => $values) {
$data[$form][$secondaryKey][$this->relSecondaryKey] = $secondaryKey;
}
}
return $data;
} | php | protected function pushSecondaryKeys($data, $form)
{
if (isset($data[$form]) && is_array($data[$form])) {
foreach ($data[$form] as $secondaryKey => $values) {
$data[$form][$secondaryKey][$this->relSecondaryKey] = $secondaryKey;
}
}
return $data;
} | [
"protected",
"function",
"pushSecondaryKeys",
"(",
"$",
"data",
",",
"$",
"form",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"$",
"form",
"]",
")",
"&&",
"is_array",
"(",
"$",
"data",
"[",
"$",
"form",
"]",
")",
")",
"{",
"foreach",
"("... | Pushes secondary keys to given data
@param array $data
@param string $form | [
"Pushes",
"secondary",
"keys",
"to",
"given",
"data"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L286-L295 |
9,640 | dlds/yii2-rels | components/Interpreter.php | Interpreter.pushMissingInterpretations | protected function pushMissingInterpretations($availables, $data = null)
{
/* @var $secondaryModel \yii\db\ActiveRecord */
$secondaryModel = new $this->relSecondary->modelClass;
$queryModel = $secondaryModel->find();
$restriction = $this->_getRestriction($data, $this->_getPrimaryKe... | php | protected function pushMissingInterpretations($availables, $data = null)
{
/* @var $secondaryModel \yii\db\ActiveRecord */
$secondaryModel = new $this->relSecondary->modelClass;
$queryModel = $secondaryModel->find();
$restriction = $this->_getRestriction($data, $this->_getPrimaryKe... | [
"protected",
"function",
"pushMissingInterpretations",
"(",
"$",
"availables",
",",
"$",
"data",
"=",
"null",
")",
"{",
"/* @var $secondaryModel \\yii\\db\\ActiveRecord */",
"$",
"secondaryModel",
"=",
"new",
"$",
"this",
"->",
"relSecondary",
"->",
"modelClass",
";",... | Default method for getting all owner's possible hasMany relation models.
This can be overloaded and changed in owner's model class. | [
"Default",
"method",
"for",
"getting",
"all",
"owner",
"s",
"possible",
"hasMany",
"relation",
"models",
".",
"This",
"can",
"be",
"overloaded",
"and",
"changed",
"in",
"owner",
"s",
"model",
"class",
"."
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L301-L329 |
9,641 | dlds/yii2-rels | components/Interpreter.php | Interpreter._getRestriction | private function _getRestriction($data, $secodaryKey, $allowGlobal = true)
{
$restriction = [];
if ($data) {
$restriction[$secodaryKey] = $this->_getSecondaryKeys($data, $this->viaModel->formName());
}
if ($allowGlobal && $this->restriction) {
$restriction =... | php | private function _getRestriction($data, $secodaryKey, $allowGlobal = true)
{
$restriction = [];
if ($data) {
$restriction[$secodaryKey] = $this->_getSecondaryKeys($data, $this->viaModel->formName());
}
if ($allowGlobal && $this->restriction) {
$restriction =... | [
"private",
"function",
"_getRestriction",
"(",
"$",
"data",
",",
"$",
"secodaryKey",
",",
"$",
"allowGlobal",
"=",
"true",
")",
"{",
"$",
"restriction",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"data",
")",
"{",
"$",
"restriction",
"[",
"$",
"secodaryKey",
... | Parses and retrieves keys from given data
@param type $data | [
"Parses",
"and",
"retrieves",
"keys",
"from",
"given",
"data"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L335-L348 |
9,642 | dlds/yii2-rels | components/Interpreter.php | Interpreter._getSecondaryKeys | private function _getSecondaryKeys($data, $key = null)
{
if ($key) {
$data = ArrayHelper::getValue($data, $key, []);
}
return ArrayHelper::getColumn($data, $this->relSecondaryKey);
} | php | private function _getSecondaryKeys($data, $key = null)
{
if ($key) {
$data = ArrayHelper::getValue($data, $key, []);
}
return ArrayHelper::getColumn($data, $this->relSecondaryKey);
} | [
"private",
"function",
"_getSecondaryKeys",
"(",
"$",
"data",
",",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
")",
"{",
"$",
"data",
"=",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"data",
",",
"$",
"key",
",",
"[",
"]",
")",
";",
... | Retrieves secondary keys
@param type $data | [
"Retrieves",
"secondary",
"keys"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L354-L361 |
9,643 | dlds/yii2-rels | components/Interpreter.php | Interpreter._getPrimaryKeyName | private function _getPrimaryKeyName(\yii\db\ActiveRecord $model, $composite = false)
{
$primaryKey = $model->primaryKey();
if (!$composite && count($primaryKey) > 1) {
throw new Exception('Model has composit key which is not allowed. Relations cannot be established');
}
... | php | private function _getPrimaryKeyName(\yii\db\ActiveRecord $model, $composite = false)
{
$primaryKey = $model->primaryKey();
if (!$composite && count($primaryKey) > 1) {
throw new Exception('Model has composit key which is not allowed. Relations cannot be established');
}
... | [
"private",
"function",
"_getPrimaryKeyName",
"(",
"\\",
"yii",
"\\",
"db",
"\\",
"ActiveRecord",
"$",
"model",
",",
"$",
"composite",
"=",
"false",
")",
"{",
"$",
"primaryKey",
"=",
"$",
"model",
"->",
"primaryKey",
"(",
")",
";",
"if",
"(",
"!",
"$",
... | Retrieves primary key name | [
"Retrieves",
"primary",
"key",
"name"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L366-L375 |
9,644 | dlds/yii2-rels | components/Interpreter.php | Interpreter._createInterpretation | private function _createInterpretation($secondaryKey)
{
$model = new $this->viaModel;
$model->{$this->relPrimaryKey} = $this->owner->primaryKey;
$model->{$this->relSecondaryKey} = $secondaryKey;
return $model;
} | php | private function _createInterpretation($secondaryKey)
{
$model = new $this->viaModel;
$model->{$this->relPrimaryKey} = $this->owner->primaryKey;
$model->{$this->relSecondaryKey} = $secondaryKey;
return $model;
} | [
"private",
"function",
"_createInterpretation",
"(",
"$",
"secondaryKey",
")",
"{",
"$",
"model",
"=",
"new",
"$",
"this",
"->",
"viaModel",
";",
"$",
"model",
"->",
"{",
"$",
"this",
"->",
"relPrimaryKey",
"}",
"=",
"$",
"this",
"->",
"owner",
"->",
"... | Creates new interpretation and assigns it with owner
@param \yii\db\ActiveRecord $secondary given secondary instance | [
"Creates",
"new",
"interpretation",
"and",
"assigns",
"it",
"with",
"owner"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L381-L389 |
9,645 | dlds/yii2-rels | components/Interpreter.php | Interpreter._loadInterpreterConfig | private function _loadInterpreterConfig($config)
{
if (count($config) < 3) {
throw new \yii\base\Exception(\Yii::t('ib', 'Invalid config for interpreter. Missing required keys.'));
}
$this->viaModel = new $config[self::INDEX_VIA_CLASS];
if (isset($config[self::INDEX_VIA... | php | private function _loadInterpreterConfig($config)
{
if (count($config) < 3) {
throw new \yii\base\Exception(\Yii::t('ib', 'Invalid config for interpreter. Missing required keys.'));
}
$this->viaModel = new $config[self::INDEX_VIA_CLASS];
if (isset($config[self::INDEX_VIA... | [
"private",
"function",
"_loadInterpreterConfig",
"(",
"$",
"config",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"config",
")",
"<",
"3",
")",
"{",
"throw",
"new",
"\\",
"yii",
"\\",
"base",
"\\",
"Exception",
"(",
"\\",
"Yii",
"::",
"t",
"(",
"'ib'",
... | Loads interpreter config
@param string $key Given config key
@throws Exception throws when confign nor exists or is invalid | [
"Loads",
"interpreter",
"config"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L401-L420 |
9,646 | dlds/yii2-rels | components/Interpreter.php | Interpreter._removeDisabledRelations | private function _removeDisabledRelations()
{
if (!$this->attrActive) {
return false;
}
foreach ($this->_relationsToSave as $key => $rel) {
if (!isset($rel->{$this->attrActive})) {
continue;
}
if (!$rel->validate() && !$rel->... | php | private function _removeDisabledRelations()
{
if (!$this->attrActive) {
return false;
}
foreach ($this->_relationsToSave as $key => $rel) {
if (!isset($rel->{$this->attrActive})) {
continue;
}
if (!$rel->validate() && !$rel->... | [
"private",
"function",
"_removeDisabledRelations",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"attrActive",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"_relationsToSave",
"as",
"$",
"key",
"=>",
"$",
"rel",
")",
"{... | Removed disabled relations when are not valid
@return boolean | [
"Removed",
"disabled",
"relations",
"when",
"are",
"not",
"valid"
] | fb73064f2db98a751f9a93ab1146c0a133eba8f2 | https://github.com/dlds/yii2-rels/blob/fb73064f2db98a751f9a93ab1146c0a133eba8f2/components/Interpreter.php#L426-L444 |
9,647 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.extractNumeroFromAdresseString | private function extractNumeroFromAdresseString($strAdresse = "")
{
$retour="";
for ($i=0; $i < pia_strlen($strAdresse); $i++) {
if (!is_numeric(pia_substr($strAdresse, $i, 1))) {
$retour.=pia_substr($strAdresse, $i, 1);
}
}
return $retour;... | php | private function extractNumeroFromAdresseString($strAdresse = "")
{
$retour="";
for ($i=0; $i < pia_strlen($strAdresse); $i++) {
if (!is_numeric(pia_substr($strAdresse, $i, 1))) {
$retour.=pia_substr($strAdresse, $i, 1);
}
}
return $retour;... | [
"private",
"function",
"extractNumeroFromAdresseString",
"(",
"$",
"strAdresse",
"=",
"\"\"",
")",
"{",
"$",
"retour",
"=",
"\"\"",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"pia_strlen",
"(",
"$",
"strAdresse",
")",
";",
"$",
"i",
"++... | fonction qui renvoi enleve les numeros de rue des chaines de caracteres d'adresses | [
"fonction",
"qui",
"renvoi",
"enleve",
"les",
"numeros",
"de",
"rue",
"des",
"chaines",
"de",
"caracteres",
"d",
"adresses"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L857-L870 |
9,648 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getUrlImageFrom | public function getUrlImageFrom($idAdresse = 0, $format = 'mini', $sqlWhere = '')
{
$url="";
$dateUpload = "";
$idHistoriqueImage = "";
$string = new stringObject();
/* inutile a cause de l'url rewriting
switch($format)
{
case 'mini':
$chemin = $this->getUrlImage("m... | php | public function getUrlImageFrom($idAdresse = 0, $format = 'mini', $sqlWhere = '')
{
$url="";
$dateUpload = "";
$idHistoriqueImage = "";
$string = new stringObject();
/* inutile a cause de l'url rewriting
switch($format)
{
case 'mini':
$chemin = $this->getUrlImage("m... | [
"public",
"function",
"getUrlImageFrom",
"(",
"$",
"idAdresse",
"=",
"0",
",",
"$",
"format",
"=",
"'mini'",
",",
"$",
"sqlWhere",
"=",
"''",
")",
"{",
"$",
"url",
"=",
"\"\"",
";",
"$",
"dateUpload",
"=",
"\"\"",
";",
"$",
"idHistoriqueImage",
"=",
... | fonction recuperant l'image de la demolition | [
"fonction",
"recuperant",
"l",
"image",
"de",
"la",
"demolition"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L2315-L2392 |
9,649 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getArrayAdresseFromIdAdresse | public function getArrayAdresseFromIdAdresse($idAdresse = 0)
{
$req = "
select ha.idAdresse as idAdresse,
ha.date as date,
ha.description as description,
ha.nom as nom,
ha.idHistoriqueAdresse as idHistoriqueAdresse,
ha.numero as numero,
IF(ha.idIndicatif='0','',i.nom) as nomIndic... | php | public function getArrayAdresseFromIdAdresse($idAdresse = 0)
{
$req = "
select ha.idAdresse as idAdresse,
ha.date as date,
ha.description as description,
ha.nom as nom,
ha.idHistoriqueAdresse as idHistoriqueAdresse,
ha.numero as numero,
IF(ha.idIndicatif='0','',i.nom) as nomIndic... | [
"public",
"function",
"getArrayAdresseFromIdAdresse",
"(",
"$",
"idAdresse",
"=",
"0",
")",
"{",
"$",
"req",
"=",
"\"\n\t\t\t\tselect ha.idAdresse as idAdresse,\n\t\t\t\tha.date as date,\n\t\t\t\tha.description as description,\n\t\t\t\tha.nom as nom,\n\t\t\t\tha.idHistoriqueAdresse as idHi... | retourne un tableau contenant les infos de l'adresse | [
"retourne",
"un",
"tableau",
"contenant",
"les",
"infos",
"de",
"l",
"adresse"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L2550-L2589 |
9,650 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.afficheSelectVille | public function afficheSelectVille($params = array())
{
$html="";
$t=new Template('modules/archi/templates/');
$t->set_filenames((array('listeVille'=>'listeVilleSelect.tpl')));
$a = new archiAuthentification();
$u = new archiUtilisateur();
$sqlWhereVillesModerees =... | php | public function afficheSelectVille($params = array())
{
$html="";
$t=new Template('modules/archi/templates/');
$t->set_filenames((array('listeVille'=>'listeVilleSelect.tpl')));
$a = new archiAuthentification();
$u = new archiUtilisateur();
$sqlWhereVillesModerees =... | [
"public",
"function",
"afficheSelectVille",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"html",
"=",
"\"\"",
";",
"$",
"t",
"=",
"new",
"Template",
"(",
"'modules/archi/templates/'",
")",
";",
"$",
"t",
"->",
"set_filenames",
"(",
"(",
"... | affichage de la liste des villes sous forme d'un champ select | [
"affichage",
"de",
"la",
"liste",
"des",
"villes",
"sous",
"forme",
"d",
"un",
"champ",
"select"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L6833-L6919 |
9,651 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.afficheSelectPays | public function afficheSelectPays($params = array())
{
$html="";
$t=new Template('modules/archi/templates/');
$t->set_filenames((array('listePays'=>'listePaysSelect.tpl')));
$a = new archiAuthentification();
$u = new archiUtilisateur();
$sqlWhereVillesModerees = "... | php | public function afficheSelectPays($params = array())
{
$html="";
$t=new Template('modules/archi/templates/');
$t->set_filenames((array('listePays'=>'listePaysSelect.tpl')));
$a = new archiAuthentification();
$u = new archiUtilisateur();
$sqlWhereVillesModerees = "... | [
"public",
"function",
"afficheSelectPays",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"html",
"=",
"\"\"",
";",
"$",
"t",
"=",
"new",
"Template",
"(",
"'modules/archi/templates/'",
")",
";",
"$",
"t",
"->",
"set_filenames",
"(",
"(",
"a... | affichage de la liste des pays sous forme d'un champ select | [
"affichage",
"de",
"la",
"liste",
"des",
"pays",
"sous",
"forme",
"d",
"un",
"champ",
"select"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L6922-L7013 |
9,652 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getFirstImageFromEvenement | public function getFirstImageFromEvenement($idEvenement = 0)
{
$fetch=array();
$reqVerifTri = "
SELECT ei.idImage
FROM _evenementImage ei
WHERE ei.idEvenement = '".$idEvenement."'
AND position<>0
";
$re... | php | public function getFirstImageFromEvenement($idEvenement = 0)
{
$fetch=array();
$reqVerifTri = "
SELECT ei.idImage
FROM _evenementImage ei
WHERE ei.idEvenement = '".$idEvenement."'
AND position<>0
";
$re... | [
"public",
"function",
"getFirstImageFromEvenement",
"(",
"$",
"idEvenement",
"=",
"0",
")",
"{",
"$",
"fetch",
"=",
"array",
"(",
")",
";",
"$",
"reqVerifTri",
"=",
"\"\n SELECT ei.idImage\n FROM _evenementImage ei\n WH... | recupere la premiere image d'un evenement en fonction de sa position | [
"recupere",
"la",
"premiere",
"image",
"d",
"un",
"evenement",
"en",
"fonction",
"de",
"sa",
"position"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L9842-L9922 |
9,653 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getInfosVille | public function getInfosVille($idVille = 0, $params = array())
{
$fieldList = " * ";
if (isset($params['fieldList']) && $params['fieldList']!='') {
$fieldList = $params['fieldList'];
}
$req = "SELECT $fieldList
FROM ville v
LEFT JOIN pays p... | php | public function getInfosVille($idVille = 0, $params = array())
{
$fieldList = " * ";
if (isset($params['fieldList']) && $params['fieldList']!='') {
$fieldList = $params['fieldList'];
}
$req = "SELECT $fieldList
FROM ville v
LEFT JOIN pays p... | [
"public",
"function",
"getInfosVille",
"(",
"$",
"idVille",
"=",
"0",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"fieldList",
"=",
"\" * \"",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'fieldList'",
"]",
")",
"&&",
"$",
"par... | renvoi un tableau contenant des infos sur la ville en parametre | [
"renvoi",
"un",
"tableau",
"contenant",
"des",
"infos",
"sur",
"la",
"ville",
"en",
"parametre"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L11317-L11329 |
9,654 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getIdVilleFromNomVille | public function getIdVilleFromNomVille($nomVille = '')
{
$retour = 0;
$req = "SELECT idVille FROM ville WHERE nom LIKE \"%".$nomVille."%\"";
$res = $this->connexionBdd->requete($req);
if (mysql_num_rows($res)>0) {
$fetch = mysql_fetch_assoc($res);
$retour = $f... | php | public function getIdVilleFromNomVille($nomVille = '')
{
$retour = 0;
$req = "SELECT idVille FROM ville WHERE nom LIKE \"%".$nomVille."%\"";
$res = $this->connexionBdd->requete($req);
if (mysql_num_rows($res)>0) {
$fetch = mysql_fetch_assoc($res);
$retour = $f... | [
"public",
"function",
"getIdVilleFromNomVille",
"(",
"$",
"nomVille",
"=",
"''",
")",
"{",
"$",
"retour",
"=",
"0",
";",
"$",
"req",
"=",
"\"SELECT idVille FROM ville WHERE nom LIKE \\\"%\"",
".",
"$",
"nomVille",
".",
"\"%\\\"\"",
";",
"$",
"res",
"=",
"$",
... | renvoi l'idVille a partir du nom de la ville en parametre | [
"renvoi",
"l",
"idVille",
"a",
"partir",
"du",
"nom",
"de",
"la",
"ville",
"en",
"parametre"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L11332-L11343 |
9,655 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.isParcoursActif | public function isParcoursActif($params = array())
{
$retour = false;
if (isset($params['idParcours']) && $params['idParcours']!='') {
$req = "SELECT isActif FROM parcoursArt WHERE idParcours = '".$params['idParcours']."'";
$res = $this->connexionBdd->requete($req);
... | php | public function isParcoursActif($params = array())
{
$retour = false;
if (isset($params['idParcours']) && $params['idParcours']!='') {
$req = "SELECT isActif FROM parcoursArt WHERE idParcours = '".$params['idParcours']."'";
$res = $this->connexionBdd->requete($req);
... | [
"public",
"function",
"isParcoursActif",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"retour",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'idParcours'",
"]",
")",
"&&",
"$",
"params",
"[",
"'idParcours'",
"]",
"!=... | si on precise un idParcours en parametre on regarde alors si ce parcours est actif | [
"si",
"on",
"precise",
"un",
"idParcours",
"en",
"parametre",
"on",
"regarde",
"alors",
"si",
"ce",
"parcours",
"est",
"actif"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L12607-L12631 |
9,656 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getPhotoFromEtape | public function getPhotoFromEtape($params = array())
{
$retour = array('trouve'=>false);
if (isset($params['idEtape']) && $params['idEtape']!='' && $params['idEtape']!='0') {
// recuperation du groupe d'adresse de l'etape
$req = "SELECT idEvenementGroupeAdresse FROM etapesParcou... | php | public function getPhotoFromEtape($params = array())
{
$retour = array('trouve'=>false);
if (isset($params['idEtape']) && $params['idEtape']!='' && $params['idEtape']!='0') {
// recuperation du groupe d'adresse de l'etape
$req = "SELECT idEvenementGroupeAdresse FROM etapesParcou... | [
"public",
"function",
"getPhotoFromEtape",
"(",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"retour",
"=",
"array",
"(",
"'trouve'",
"=>",
"false",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'idEtape'",
"]",
")",
"&&",
"$",
"... | renvoie la photo courante de l'adresse de l'etape | [
"renvoie",
"la",
"photo",
"courante",
"de",
"l",
"adresse",
"de",
"l",
"etape"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L12634-L12661 |
9,657 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getIdSousQuartier | public function getIdSousQuartier($idRue = null)
{
$idSousQuartier = null;
if (!isset($idRue) && $idRue != '') {
echo "Error while getting sub neighborhood id, no street informations were specified for this request.";
} else {
$req = "SELECT idSousQuartier
FROM... | php | public function getIdSousQuartier($idRue = null)
{
$idSousQuartier = null;
if (!isset($idRue) && $idRue != '') {
echo "Error while getting sub neighborhood id, no street informations were specified for this request.";
} else {
$req = "SELECT idSousQuartier
FROM... | [
"public",
"function",
"getIdSousQuartier",
"(",
"$",
"idRue",
"=",
"null",
")",
"{",
"$",
"idSousQuartier",
"=",
"null",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"idRue",
")",
"&&",
"$",
"idRue",
"!=",
"''",
")",
"{",
"echo",
"\"Error while getting sub ne... | Get the id of a sub neighborhood from the id of a street
@param string $idRue : id of the street
@return NULL|string : id of the neighborhood | [
"Get",
"the",
"id",
"of",
"a",
"sub",
"neighborhood",
"from",
"the",
"id",
"of",
"a",
"street"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L12722-L12737 |
9,658 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getIdQuartier | public function getIdQuartier($idSousQuartier)
{
$idQuartier = null;
if (!isset($idSousQuartier) && $idSousQuartier != '') {
echo "Error while getting neighborhood id, no sub neighborhood informations were specified for this request.";
} else {
$req = "
SELECT... | php | public function getIdQuartier($idSousQuartier)
{
$idQuartier = null;
if (!isset($idSousQuartier) && $idSousQuartier != '') {
echo "Error while getting neighborhood id, no sub neighborhood informations were specified for this request.";
} else {
$req = "
SELECT... | [
"public",
"function",
"getIdQuartier",
"(",
"$",
"idSousQuartier",
")",
"{",
"$",
"idQuartier",
"=",
"null",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"idSousQuartier",
")",
"&&",
"$",
"idSousQuartier",
"!=",
"''",
")",
"{",
"echo",
"\"Error while getting neig... | Get the id of a neighborhood from the id of a street
@param int $idSousQuartier : id of the sub neighborhood
@return int $idQuartier : id of the neighborhood (or null if error occurs) | [
"Get",
"the",
"id",
"of",
"a",
"neighborhood",
"from",
"the",
"id",
"of",
"a",
"street"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L12745-L12761 |
9,659 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getIdVille | public function getIdVille($idQuartier)
{
$idVille;
if (!isset($idQuartier) && $idQuartier != '') {
echo "Error while getting city id, no sub neighborhood informations were specified for this request.";
} else {
$req = "
SELECT idVille
FROM quartier
... | php | public function getIdVille($idQuartier)
{
$idVille;
if (!isset($idQuartier) && $idQuartier != '') {
echo "Error while getting city id, no sub neighborhood informations were specified for this request.";
} else {
$req = "
SELECT idVille
FROM quartier
... | [
"public",
"function",
"getIdVille",
"(",
"$",
"idQuartier",
")",
"{",
"$",
"idVille",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"idQuartier",
")",
"&&",
"$",
"idQuartier",
"!=",
"''",
")",
"{",
"echo",
"\"Error while getting city id, no sub neighborhood informatio... | Get the id of the city from neighborhood id
@param $idQuartier : neighborhood id
@return $idVille : id of the city | [
"Get",
"the",
"id",
"of",
"the",
"city",
"from",
"neighborhood",
"id"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L12769-L12785 |
9,660 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getIdPays | public function getIdPays($idVille)
{
$idPays;
if (!isset($idVille) && $idVille != '') {
echo "Error while getting country id, no sub neighborhood informations were specified for this request.";
} else {
$req = "
SELECT idPays
FROM ville
WHERE ... | php | public function getIdPays($idVille)
{
$idPays;
if (!isset($idVille) && $idVille != '') {
echo "Error while getting country id, no sub neighborhood informations were specified for this request.";
} else {
$req = "
SELECT idPays
FROM ville
WHERE ... | [
"public",
"function",
"getIdPays",
"(",
"$",
"idVille",
")",
"{",
"$",
"idPays",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"idVille",
")",
"&&",
"$",
"idVille",
"!=",
"''",
")",
"{",
"echo",
"\"Error while getting country id, no sub neighborhood informations were ... | Get id of the country from city id
@param $idVille : id of the city
@return $idPays : id of the country | [
"Get",
"id",
"of",
"the",
"country",
"from",
"city",
"id"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L12795-L12811 |
9,661 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.generatePaginationLinks | private function generatePaginationLinks($options = array())
{
//Pagination display
$nbResult = 0;
$nbPages = 0;
$currentPage = 0;
$nextPage = 0;
$previousPage = 0;
$nbResultPerPage = 10;
$offset=4;
$url = array();
// Checking if all t... | php | private function generatePaginationLinks($options = array())
{
//Pagination display
$nbResult = 0;
$nbPages = 0;
$currentPage = 0;
$nextPage = 0;
$previousPage = 0;
$nbResultPerPage = 10;
$offset=4;
$url = array();
// Checking if all t... | [
"private",
"function",
"generatePaginationLinks",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"//Pagination display",
"$",
"nbResult",
"=",
"0",
";",
"$",
"nbPages",
"=",
"0",
";",
"$",
"currentPage",
"=",
"0",
";",
"$",
"nextPage",
"=",
"0",
... | Generate pagination links
@param unknown $options
@return multitype:string | [
"Generate",
"pagination",
"links"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L13228-L13274 |
9,662 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getPaginationIndex | private function getPaginationIndex($optionsPagination = array())
{
$nbResult = 0;
$nbPages = 0;
$currentPage = 0;
$nextPage = 0;
$previousPage = 0;
$nbResultPerPage = 10;
$offset = 4;
$indexToDisplay = array();
//Setting vars
if (isse... | php | private function getPaginationIndex($optionsPagination = array())
{
$nbResult = 0;
$nbPages = 0;
$currentPage = 0;
$nextPage = 0;
$previousPage = 0;
$nbResultPerPage = 10;
$offset = 4;
$indexToDisplay = array();
//Setting vars
if (isse... | [
"private",
"function",
"getPaginationIndex",
"(",
"$",
"optionsPagination",
"=",
"array",
"(",
")",
")",
"{",
"$",
"nbResult",
"=",
"0",
";",
"$",
"nbPages",
"=",
"0",
";",
"$",
"currentPage",
"=",
"0",
";",
"$",
"nextPage",
"=",
"0",
";",
"$",
"prev... | Get pagination index
@param unknown $optionsPagination : array with the info of pagination (nb results, nb results per page, current page etc)
@return $indexRange = range of the index to display | [
"Get",
"pagination",
"index"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L13284-L13356 |
9,663 | Archi-Strasbourg/archi-wiki | modules/archi/includes/archiAdresse.class.php | archiAdresse.getTitre | public function getTitre($idAdresse)
{
$requete ="SELECT e2.titre
FROM evenements e1, evenements e2
LEFT JOIN _adresseEvenement ae on ae.idEvenement = e1.idEvenement
WHERE ae.idAdresse = $idAdresse
AND e2.idEvenement = e1.`idEvenementRecuperationTitre` ";
$result = $this->connexionBd... | php | public function getTitre($idAdresse)
{
$requete ="SELECT e2.titre
FROM evenements e1, evenements e2
LEFT JOIN _adresseEvenement ae on ae.idEvenement = e1.idEvenement
WHERE ae.idAdresse = $idAdresse
AND e2.idEvenement = e1.`idEvenementRecuperationTitre` ";
$result = $this->connexionBd... | [
"public",
"function",
"getTitre",
"(",
"$",
"idAdresse",
")",
"{",
"$",
"requete",
"=",
"\"SELECT e2.titre\n\t\t\t\tFROM evenements e1, evenements e2\n\t\t\t\tLEFT JOIN _adresseEvenement ae on ae.idEvenement = e1.idEvenement\n\t\t\t\tWHERE ae.idAdresse = $idAdresse\n\t\t\t\tAND e2.idEvenement ... | Get titre of an adresse
@param unknown $idAdresse
@return titre | [
"Get",
"titre",
"of",
"an",
"adresse"
] | b9fb39f43a78409890a7de96426c1f6c49d5c323 | https://github.com/Archi-Strasbourg/archi-wiki/blob/b9fb39f43a78409890a7de96426c1f6c49d5c323/modules/archi/includes/archiAdresse.class.php#L13505-L13515 |
9,664 | zepi/turbo-base | Zepi/Web/UserInterface/src/Layout/AbstractContainer.php | AbstractContainer.getHtmlId | public function getHtmlId()
{
$id = '';
if (is_object($this->parent)) {
$id = $this->parent->getHtmlId();
}
if ($this->key !== '') {
$id .= '-' . $this->key;
}
return $id;
} | php | public function getHtmlId()
{
$id = '';
if (is_object($this->parent)) {
$id = $this->parent->getHtmlId();
}
if ($this->key !== '') {
$id .= '-' . $this->key;
}
return $id;
} | [
"public",
"function",
"getHtmlId",
"(",
")",
"{",
"$",
"id",
"=",
"''",
";",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"parent",
")",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"parent",
"->",
"getHtmlId",
"(",
")",
";",
"}",
"if",
"(",... | Returns the html id for the container. The id is built by the keys
of this element and all parents.
@return string | [
"Returns",
"the",
"html",
"id",
"for",
"the",
"container",
".",
"The",
"id",
"is",
"built",
"by",
"the",
"keys",
"of",
"this",
"element",
"and",
"all",
"parents",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/UserInterface/src/Layout/AbstractContainer.php#L137-L149 |
9,665 | zepi/turbo-base | Zepi/Web/UserInterface/src/Layout/AbstractContainer.php | AbstractContainer.getPath | public function getPath(AbstractContainer $startingFrom = null)
{
$id = '';
if (is_object($this->parent) && $startingFrom !== $this->parent) {
$id = $this->parent->getPath($startingFrom);
}
if ($id != '' && substr($id, -1) != '.') {
$id .= '.';
}
... | php | public function getPath(AbstractContainer $startingFrom = null)
{
$id = '';
if (is_object($this->parent) && $startingFrom !== $this->parent) {
$id = $this->parent->getPath($startingFrom);
}
if ($id != '' && substr($id, -1) != '.') {
$id .= '.';
}
... | [
"public",
"function",
"getPath",
"(",
"AbstractContainer",
"$",
"startingFrom",
"=",
"null",
")",
"{",
"$",
"id",
"=",
"''",
";",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"parent",
")",
"&&",
"$",
"startingFrom",
"!==",
"$",
"this",
"->",
"paren... | Returns the path for the element, starting from the given
AbstractContainer
@return string | [
"Returns",
"the",
"path",
"for",
"the",
"element",
"starting",
"from",
"the",
"given",
"AbstractContainer"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/UserInterface/src/Layout/AbstractContainer.php#L157-L173 |
9,666 | zepi/turbo-base | Zepi/Web/UserInterface/src/Layout/AbstractContainer.php | AbstractContainer.getPart | public function getPart($key)
{
foreach ($this->parts as $part) {
if ($part->getKey() === $key) {
return $part;
}
}
return false;
} | php | public function getPart($key)
{
foreach ($this->parts as $part) {
if ($part->getKey() === $key) {
return $part;
}
}
return false;
} | [
"public",
"function",
"getPart",
"(",
"$",
"key",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"parts",
"as",
"$",
"part",
")",
"{",
"if",
"(",
"$",
"part",
"->",
"getKey",
"(",
")",
"===",
"$",
"key",
")",
"{",
"return",
"$",
"part",
";",
"}",... | Returns the part for the given key, if there is no part
with this key registred return false.
@access public
@return false|\Zepi\Web\UserInterface\Layout\Part | [
"Returns",
"the",
"part",
"for",
"the",
"given",
"key",
"if",
"there",
"is",
"no",
"part",
"with",
"this",
"key",
"registred",
"return",
"false",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/UserInterface/src/Layout/AbstractContainer.php#L194-L203 |
9,667 | zepi/turbo-base | Zepi/Web/UserInterface/src/Layout/AbstractContainer.php | AbstractContainer.searchPartByKeyAndType | public function searchPartByKeyAndType($key, $type = '\\Zepi\\Web\\UserInterface\\Layout\\AbstractContainer')
{
foreach ($this->parts as $part) {
if ((is_a($part, $type) || is_subclass_of($part, $type)) && $part->getKey() === $key) {
return $part;
}
... | php | public function searchPartByKeyAndType($key, $type = '\\Zepi\\Web\\UserInterface\\Layout\\AbstractContainer')
{
foreach ($this->parts as $part) {
if ((is_a($part, $type) || is_subclass_of($part, $type)) && $part->getKey() === $key) {
return $part;
}
... | [
"public",
"function",
"searchPartByKeyAndType",
"(",
"$",
"key",
",",
"$",
"type",
"=",
"'\\\\Zepi\\\\Web\\\\UserInterface\\\\Layout\\\\AbstractContainer'",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"parts",
"as",
"$",
"part",
")",
"{",
"if",
"(",
"(",
"is_a"... | Returns the object for the given key and type or false
if the object doesn't exists.
@access public
@param string $key
@param string $type
@return false|mixed | [
"Returns",
"the",
"object",
"for",
"the",
"given",
"key",
"and",
"type",
"or",
"false",
"if",
"the",
"object",
"doesn",
"t",
"exists",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/UserInterface/src/Layout/AbstractContainer.php#L280-L294 |
9,668 | zepi/turbo-base | Zepi/Web/UserInterface/src/Layout/AbstractContainer.php | AbstractContainer.getParentOfType | public function getParentOfType($type)
{
if (is_a($this, $type)) {
return $this;
}
if ($this->parent !== null) {
return $this->parent->getParentOfType($type);
}
return false;
} | php | public function getParentOfType($type)
{
if (is_a($this, $type)) {
return $this;
}
if ($this->parent !== null) {
return $this->parent->getParentOfType($type);
}
return false;
} | [
"public",
"function",
"getParentOfType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"this",
",",
"$",
"type",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"parent",
"!==",
"null",
")",
"{",
"return",... | Returns the next parent of this container for the given type
If there is no type like that the function will return false
@access public
@param string $type
@return false|mixed | [
"Returns",
"the",
"next",
"parent",
"of",
"this",
"container",
"for",
"the",
"given",
"type",
"If",
"there",
"is",
"no",
"type",
"like",
"that",
"the",
"function",
"will",
"return",
"false"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/UserInterface/src/Layout/AbstractContainer.php#L304-L315 |
9,669 | zepi/turbo-base | Zepi/Web/UserInterface/src/Layout/AbstractContainer.php | AbstractContainer.getChildrenByType | public function getChildrenByType($type, $recursive = true)
{
$results = array();
foreach ($this->parts as $part) {
if (is_a($part, $type) || is_subclass_of($part, $type)) {
$results[] = $part;
}
if ($recursive) {
$res... | php | public function getChildrenByType($type, $recursive = true)
{
$results = array();
foreach ($this->parts as $part) {
if (is_a($part, $type) || is_subclass_of($part, $type)) {
$results[] = $part;
}
if ($recursive) {
$res... | [
"public",
"function",
"getChildrenByType",
"(",
"$",
"type",
",",
"$",
"recursive",
"=",
"true",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"parts",
"as",
"$",
"part",
")",
"{",
"if",
"(",
"is_a",
"(",... | Returns all children with the given type.
@access public
@param string $type
@param boolean $recursive
@return array | [
"Returns",
"all",
"children",
"with",
"the",
"given",
"type",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/UserInterface/src/Layout/AbstractContainer.php#L325-L340 |
9,670 | tekkla/core-router | Core/Router/Router.php | Router.getInstance | public function getInstance(): Router
{
if (! isset(self::$instance)) {
self::$instance = new self();
}
return self::$instance;
} | php | public function getInstance(): Router
{
if (! isset(self::$instance)) {
self::$instance = new self();
}
return self::$instance;
} | [
"public",
"function",
"getInstance",
"(",
")",
":",
"Router",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"instance",
")",
")",
"{",
"self",
"::",
"$",
"instance",
"=",
"new",
"self",
"(",
")",
";",
"}",
"return",
"self",
"::",
"$",
"in... | Singleton instance factory
@return Router | [
"Singleton",
"instance",
"factory"
] | 5ee6c6e816824e92115509766afec3daed1d5a43 | https://github.com/tekkla/core-router/blob/5ee6c6e816824e92115509766afec3daed1d5a43/Core/Router/Router.php#L64-L71 |
9,671 | tekkla/core-router | Core/Router/Router.php | Router.getParam | public function getParam(string $param)
{
if (! empty($this->match['params'][$param])) {
return $this->match['params'][$param];
}
} | php | public function getParam(string $param)
{
if (! empty($this->match['params'][$param])) {
return $this->match['params'][$param];
}
} | [
"public",
"function",
"getParam",
"(",
"string",
"$",
"param",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"match",
"[",
"'params'",
"]",
"[",
"$",
"param",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"match",
"[",
"'params'",
... | Returns a parameter value
@param string $param
Name of param to return value of
@return mixed | [
"Returns",
"a",
"parameter",
"value"
] | 5ee6c6e816824e92115509766afec3daed1d5a43 | https://github.com/tekkla/core-router/blob/5ee6c6e816824e92115509766afec3daed1d5a43/Core/Router/Router.php#L146-L151 |
9,672 | tekkla/core-router | Core/Router/Router.php | Router.match | public function match($request_url = null, $request_method = null)
{
// Set Request Url if it isn't passed as parameter
if ($request_url === null) {
$request_url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
}
$this->request_url = $request_url... | php | public function match($request_url = null, $request_method = null)
{
// Set Request Url if it isn't passed as parameter
if ($request_url === null) {
$request_url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
}
$this->request_url = $request_url... | [
"public",
"function",
"match",
"(",
"$",
"request_url",
"=",
"null",
",",
"$",
"request_method",
"=",
"null",
")",
"{",
"// Set Request Url if it isn't passed as parameter",
"if",
"(",
"$",
"request_url",
"===",
"null",
")",
"{",
"$",
"request_url",
"=",
"isset"... | Match a given request url against stored routes
@param string $request_url
@param string $request_method
@return array boolean with route information on success, false on failure (no match). | [
"Match",
"a",
"given",
"request",
"url",
"against",
"stored",
"routes"
] | 5ee6c6e816824e92115509766afec3daed1d5a43 | https://github.com/tekkla/core-router/blob/5ee6c6e816824e92115509766afec3daed1d5a43/Core/Router/Router.php#L207-L275 |
9,673 | tekkla/core-router | Core/Router/Router.php | Router.getStatus | public function getStatus(): array
{
return [
'url' => $this->request_url,
'route' => $this->getCurrentRoute(),
'ajax' => $this->ajax,
'method' => $_SERVER['REQUEST_METHOD'],
'format' => $this->format,
'match' => $this->match
];... | php | public function getStatus(): array
{
return [
'url' => $this->request_url,
'route' => $this->getCurrentRoute(),
'ajax' => $this->ajax,
'method' => $_SERVER['REQUEST_METHOD'],
'format' => $this->format,
'match' => $this->match
];... | [
"public",
"function",
"getStatus",
"(",
")",
":",
"array",
"{",
"return",
"[",
"'url'",
"=>",
"$",
"this",
"->",
"request_url",
",",
"'route'",
"=>",
"$",
"this",
"->",
"getCurrentRoute",
"(",
")",
",",
"'ajax'",
"=>",
"$",
"this",
"->",
"ajax",
",",
... | Returns all request related data in one array
@return array | [
"Returns",
"all",
"request",
"related",
"data",
"in",
"one",
"array"
] | 5ee6c6e816824e92115509766afec3daed1d5a43 | https://github.com/tekkla/core-router/blob/5ee6c6e816824e92115509766afec3daed1d5a43/Core/Router/Router.php#L336-L346 |
9,674 | tekkla/core-router | Core/Router/Router.php | Router.getTarget | public function getTarget(string $target)
{
if (! empty($this->match['target'][$target])) {
return $this->match['target'][$target];
}
} | php | public function getTarget(string $target)
{
if (! empty($this->match['target'][$target])) {
return $this->match['target'][$target];
}
} | [
"public",
"function",
"getTarget",
"(",
"string",
"$",
"target",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"match",
"[",
"'target'",
"]",
"[",
"$",
"target",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"match",
"[",
"'target'"... | Returns a specific target
@param string $target
A target can be 'app', 'controller' or 'action'
@return string|null | [
"Returns",
"a",
"specific",
"target"
] | 5ee6c6e816824e92115509766afec3daed1d5a43 | https://github.com/tekkla/core-router/blob/5ee6c6e816824e92115509766afec3daed1d5a43/Core/Router/Router.php#L356-L361 |
9,675 | qunabu/silverstripe-htmlblocks | code/HTMLBlock.php | HTMLBlock.parse_shortcode | public static function parse_shortcode($attributes, $content, $parser, $shortcode)
{
// check the gallery exists
if (isset($attributes['id']) && $gallery = HTMLBlock::get()->byID($attributes['id'])) {
return HTMLBlock::get()->byID($attributes['id'])->forTemplate();
}
} | php | public static function parse_shortcode($attributes, $content, $parser, $shortcode)
{
// check the gallery exists
if (isset($attributes['id']) && $gallery = HTMLBlock::get()->byID($attributes['id'])) {
return HTMLBlock::get()->byID($attributes['id'])->forTemplate();
}
} | [
"public",
"static",
"function",
"parse_shortcode",
"(",
"$",
"attributes",
",",
"$",
"content",
",",
"$",
"parser",
",",
"$",
"shortcode",
")",
"{",
"// check the gallery exists",
"if",
"(",
"isset",
"(",
"$",
"attributes",
"[",
"'id'",
"]",
")",
"&&",
"$"... | Parse the shortcode and render as a string, probably with a template
@param array $attributes the list of attributes of the shortcode
@param string $content the shortcode content
@param ShortcodeParser $parser the ShortcodeParser instance
@param string $shortcode the raw shortcode being parsed
@return String | [
"Parse",
"the",
"shortcode",
"and",
"render",
"as",
"a",
"string",
"probably",
"with",
"a",
"template"
] | a38a23739d61e845b658a70af8f0a7badfd030fb | https://github.com/qunabu/silverstripe-htmlblocks/blob/a38a23739d61e845b658a70af8f0a7badfd030fb/code/HTMLBlock.php#L84-L92 |
9,676 | jelix/php-redis-plugin | plugins/kvdb/redis_php/redis_php.kvdriver.php | redis_phpKVDriver._connect | protected function _connect() {
// A host is needed
if (! isset($this->_profile['host'])) {
throw new jException(
'jelix~kvstore.error.no.host', $this->_profileName);
}
// A port is needed as well
if (! isset($this->_profile['port'])) {
t... | php | protected function _connect() {
// A host is needed
if (! isset($this->_profile['host'])) {
throw new jException(
'jelix~kvstore.error.no.host', $this->_profileName);
}
// A port is needed as well
if (! isset($this->_profile['port'])) {
t... | [
"protected",
"function",
"_connect",
"(",
")",
"{",
"// A host is needed",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_profile",
"[",
"'host'",
"]",
")",
")",
"{",
"throw",
"new",
"jException",
"(",
"'jelix~kvstore.error.no.host'",
",",
"$",
"this",
... | Connects to the redis server
@return \PhpRedis\Redis object
@throws jException | [
"Connects",
"to",
"the",
"redis",
"server"
] | bcb6f4a5265eeecfcfa8448f1b8571a9c336f92b | https://github.com/jelix/php-redis-plugin/blob/bcb6f4a5265eeecfcfa8448f1b8571a9c336f92b/plugins/kvdb/redis_php/redis_php.kvdriver.php#L36-L68 |
9,677 | blenderdeluxe/khipu | src/KhipuService/KhipuServiceCreatePaymentURL.php | KhipuServiceCreatePaymentURL.createUrl | public function createUrl() {
$string_data = $this->dataToString();
$data_to_send = array(
'hash' => $this->doHash($string_data),
);
// Adicionalmente adjuntamos el resto de los valores iniciados en $data
foreach ($this->data as $name => $value) {
$data_to_send[$name] = $value;
}
... | php | public function createUrl() {
$string_data = $this->dataToString();
$data_to_send = array(
'hash' => $this->doHash($string_data),
);
// Adicionalmente adjuntamos el resto de los valores iniciados en $data
foreach ($this->data as $name => $value) {
$data_to_send[$name] = $value;
}
... | [
"public",
"function",
"createUrl",
"(",
")",
"{",
"$",
"string_data",
"=",
"$",
"this",
"->",
"dataToString",
"(",
")",
";",
"$",
"data_to_send",
"=",
"array",
"(",
"'hash'",
"=>",
"$",
"this",
"->",
"doHash",
"(",
"$",
"string_data",
")",
",",
")",
... | Metodo que solicita la generacion de la url | [
"Metodo",
"que",
"solicita",
"la",
"generacion",
"de",
"la",
"url"
] | ef78fa8ba372c7784936ce95a3d0bd46a35e0143 | https://github.com/blenderdeluxe/khipu/blob/ef78fa8ba372c7784936ce95a3d0bd46a35e0143/src/KhipuService/KhipuServiceCreatePaymentURL.php#L49-L76 |
9,678 | wigedev/simple-mvc | src/Utility/HTTPUtilities.php | HTTPUtilities.getFileExtension | public static function getFileExtension($name)
{
if (is_array($name)) {
$name = array_pop($name);
}
$extension = static::splitFilename($name)[1];
if (is_string($extension)) {
$extension = strtolower($extension);
}
return $extension;
} | php | public static function getFileExtension($name)
{
if (is_array($name)) {
$name = array_pop($name);
}
$extension = static::splitFilename($name)[1];
if (is_string($extension)) {
$extension = strtolower($extension);
}
return $extension;
} | [
"public",
"static",
"function",
"getFileExtension",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"array_pop",
"(",
"$",
"name",
")",
";",
"}",
"$",
"extension",
"=",
"static",
"::",
"splitFilen... | Parse the passed filename to get the extension only. If passed an array, uses the last element of the array.
@param string|array $name
@return string | [
"Parse",
"the",
"passed",
"filename",
"to",
"get",
"the",
"extension",
"only",
".",
"If",
"passed",
"an",
"array",
"uses",
"the",
"last",
"element",
"of",
"the",
"array",
"."
] | b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94 | https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Utility/HTTPUtilities.php#L35-L45 |
9,679 | wigedev/simple-mvc | src/Utility/HTTPUtilities.php | HTTPUtilities.splitFilename | private static function splitFilename($name)
{
if (is_array($name)) {
$name = array_pop($name);
} else {
$name = explode('/', $name);
$name = array_pop($name);
}
if (strrpos($name, '.') !== false) {
return explode('.', $name);
}... | php | private static function splitFilename($name)
{
if (is_array($name)) {
$name = array_pop($name);
} else {
$name = explode('/', $name);
$name = array_pop($name);
}
if (strrpos($name, '.') !== false) {
return explode('.', $name);
}... | [
"private",
"static",
"function",
"splitFilename",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"array_pop",
"(",
"$",
"name",
")",
";",
"}",
"else",
"{",
"$",
"name",
"=",
"explode",
"(",
"... | Splits the passed filename into a name and extension and returns an array. The first element is the name, the
second is the extension.
@param string|array $name
@return string[] The first element is the name, the second element is the extension, or null if no extension | [
"Splits",
"the",
"passed",
"filename",
"into",
"a",
"name",
"and",
"extension",
"and",
"returns",
"an",
"array",
".",
"The",
"first",
"element",
"is",
"the",
"name",
"the",
"second",
"is",
"the",
"extension",
"."
] | b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94 | https://github.com/wigedev/simple-mvc/blob/b722eff02c5dcd8c6f09c8d78f72bc71cb9e1a94/src/Utility/HTTPUtilities.php#L55-L68 |
9,680 | native5/native5-sdk-common-php | src/Native5/Core/Log/Impl/SysLogHandler.php | SysLogHandler.writeLog | public function writeLog($message, $priority='LOG_INFO')
{
$this->logger->addRecord(
self::$_mapping[$priority],
$this->_transform($message)
);
} | php | public function writeLog($message, $priority='LOG_INFO')
{
$this->logger->addRecord(
self::$_mapping[$priority],
$this->_transform($message)
);
} | [
"public",
"function",
"writeLog",
"(",
"$",
"message",
",",
"$",
"priority",
"=",
"'LOG_INFO'",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"addRecord",
"(",
"self",
"::",
"$",
"_mapping",
"[",
"$",
"priority",
"]",
",",
"$",
"this",
"->",
"_transform... | Writes log to file.
@param mixed $message Message to write
@param mixed $priority Priority of message to be written
@access public
@return void | [
"Writes",
"log",
"to",
"file",
"."
] | c8bd5b219bd05ea4d317d21ae9c0c8dddcede7fe | https://github.com/native5/native5-sdk-common-php/blob/c8bd5b219bd05ea4d317d21ae9c0c8dddcede7fe/src/Native5/Core/Log/Impl/SysLogHandler.php#L96-L103 |
9,681 | larriereguichet/DoctrineRepositoryBundle | DependencyInjection/RepositoryCompilerPass.php | RepositoryCompilerPass.process | public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('lag.repository.repository_pool')) {
return;
}
// find service with doctrine.repository tag
$repositoryTags = $container->findTaggedServiceIds('doctrine.repository');
// get pool... | php | public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('lag.repository.repository_pool')) {
return;
}
// find service with doctrine.repository tag
$repositoryTags = $container->findTaggedServiceIds('doctrine.repository');
// get pool... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"!",
"$",
"container",
"->",
"hasDefinition",
"(",
"'lag.repository.repository_pool'",
")",
")",
"{",
"return",
";",
"}",
"// find service with doctrine.repository tag",
... | Load tagged repositories and add it to the repository pool
@param ContainerBuilder $container | [
"Load",
"tagged",
"repositories",
"and",
"add",
"it",
"to",
"the",
"repository",
"pool"
] | d98e91d115a6c9f0fe9e9fb03de92f1268b51c10 | https://github.com/larriereguichet/DoctrineRepositoryBundle/blob/d98e91d115a6c9f0fe9e9fb03de92f1268b51c10/DependencyInjection/RepositoryCompilerPass.php#L19-L35 |
9,682 | ItinerisLtd/preflight-command | src/Checkers/Traits/CompiledBlacklistAwareTrait.php | CompiledBlacklistAwareTrait.errorIfCompiledBlacklistIsEmpty | protected function errorIfCompiledBlacklistIsEmpty(Config $config): ?Error
{
$blacklist = $config->compileBlacklist();
return empty($blacklist)
? ResultFactory::makeError($this, 'Blacklist is empty.')
: null;
} | php | protected function errorIfCompiledBlacklistIsEmpty(Config $config): ?Error
{
$blacklist = $config->compileBlacklist();
return empty($blacklist)
? ResultFactory::makeError($this, 'Blacklist is empty.')
: null;
} | [
"protected",
"function",
"errorIfCompiledBlacklistIsEmpty",
"(",
"Config",
"$",
"config",
")",
":",
"?",
"Error",
"{",
"$",
"blacklist",
"=",
"$",
"config",
"->",
"compileBlacklist",
"(",
")",
";",
"return",
"empty",
"(",
"$",
"blacklist",
")",
"?",
"ResultF... | Returns error if compiled blacklist is empty.
@param Config $config The config instance.
@return Error|null | [
"Returns",
"error",
"if",
"compiled",
"blacklist",
"is",
"empty",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/Checkers/Traits/CompiledBlacklistAwareTrait.php#L19-L26 |
9,683 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.serialize | public function serialize()
{
$device = $this->getDevice();
$spec = array(
'browser_type' => $this->_browserType,
'config' => $this->_config,
'device_class' => get_class($device),
'device' => $device->serialize(),
'user_agent' ... | php | public function serialize()
{
$device = $this->getDevice();
$spec = array(
'browser_type' => $this->_browserType,
'config' => $this->_config,
'device_class' => get_class($device),
'device' => $device->serialize(),
'user_agent' ... | [
"public",
"function",
"serialize",
"(",
")",
"{",
"$",
"device",
"=",
"$",
"this",
"->",
"getDevice",
"(",
")",
";",
"$",
"spec",
"=",
"array",
"(",
"'browser_type'",
"=>",
"$",
"this",
"->",
"_browserType",
",",
"'config'",
"=>",
"$",
"this",
"->",
... | Serialized representation of the object
@return string | [
"Serialized",
"representation",
"of",
"the",
"object"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L172-L184 |
9,684 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.unserialize | public function unserialize($serialized)
{
$spec = unserialize($serialized);
$this->setOptions($spec);
// Determine device class and ensure the class is loaded
$deviceClass = $spec['device_class'];
if (!class_exists($deviceClass)) {
$this->_getUserAgent... | php | public function unserialize($serialized)
{
$spec = unserialize($serialized);
$this->setOptions($spec);
// Determine device class and ensure the class is loaded
$deviceClass = $spec['device_class'];
if (!class_exists($deviceClass)) {
$this->_getUserAgent... | [
"public",
"function",
"unserialize",
"(",
"$",
"serialized",
")",
"{",
"$",
"spec",
"=",
"unserialize",
"(",
"$",
"serialized",
")",
";",
"$",
"this",
"->",
"setOptions",
"(",
"$",
"spec",
")",
";",
"// Determine device class and ensure the class is loaded",
"$"... | Unserialize a previous representation of the object
@param string $serialized
@return void | [
"Unserialize",
"a",
"previous",
"representation",
"of",
"the",
"object"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L192-L209 |
9,685 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent._match | protected function _match($deviceClass)
{
// Validate device class
$r = new ReflectionClass($deviceClass);
if (!$r->implementsInterface('Zend_Http_UserAgent_Device')) {
throw new Zend_Http_UserAgent_Exception(sprintf(
'Invalid device class provided ("%s"); must im... | php | protected function _match($deviceClass)
{
// Validate device class
$r = new ReflectionClass($deviceClass);
if (!$r->implementsInterface('Zend_Http_UserAgent_Device')) {
throw new Zend_Http_UserAgent_Exception(sprintf(
'Invalid device class provided ("%s"); must im... | [
"protected",
"function",
"_match",
"(",
"$",
"deviceClass",
")",
"{",
"// Validate device class",
"$",
"r",
"=",
"new",
"ReflectionClass",
"(",
"$",
"deviceClass",
")",
";",
"if",
"(",
"!",
"$",
"r",
"->",
"implementsInterface",
"(",
"'Zend_Http_UserAgent_Device... | Comparison of the UserAgent chain and browser signatures.
The comparison is case-insensitive : the browser signatures must be in lower
case
@param string $deviceClass Name of class against which a match will be attempted
@return bool | [
"Comparison",
"of",
"the",
"UserAgent",
"chain",
"and",
"browser",
"signatures",
"."
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L284-L303 |
9,686 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent._getUserAgentDevice | protected function _getUserAgentDevice($browserType)
{
$browserType = strtolower($browserType);
if (isset($this->_browserTypeClass[$browserType])) {
return $this->_browserTypeClass[$browserType];
}
if (isset($this->_config[$browserType])
&& isset($this->_conf... | php | protected function _getUserAgentDevice($browserType)
{
$browserType = strtolower($browserType);
if (isset($this->_browserTypeClass[$browserType])) {
return $this->_browserTypeClass[$browserType];
}
if (isset($this->_config[$browserType])
&& isset($this->_conf... | [
"protected",
"function",
"_getUserAgentDevice",
"(",
"$",
"browserType",
")",
"{",
"$",
"browserType",
"=",
"strtolower",
"(",
"$",
"browserType",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_browserTypeClass",
"[",
"$",
"browserType",
"]",
")",
... | Loads class for a user agent device
@param string $browserType Browser type
@return string
@throws Zend_Loader_PluginLoader_Exception if unable to load UA device | [
"Loads",
"class",
"for",
"a",
"user",
"agent",
"device"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L312-L352 |
9,687 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.getUserAgent | public function getUserAgent()
{
if (null === ($ua = $this->getServerValue('http_user_agent'))) {
$ua = self::DEFAULT_HTTP_USER_AGENT;
$this->setUserAgent($ua);
}
return $ua;
} | php | public function getUserAgent()
{
if (null === ($ua = $this->getServerValue('http_user_agent'))) {
$ua = self::DEFAULT_HTTP_USER_AGENT;
$this->setUserAgent($ua);
}
return $ua;
} | [
"public",
"function",
"getUserAgent",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"(",
"$",
"ua",
"=",
"$",
"this",
"->",
"getServerValue",
"(",
"'http_user_agent'",
")",
")",
")",
"{",
"$",
"ua",
"=",
"self",
"::",
"DEFAULT_HTTP_USER_AGENT",
";",
"$",
"t... | Returns the User Agent value
If $userAgent param is null, the value of $_server['HTTP_USER_AGENT'] is
returned.
@return string | [
"Returns",
"the",
"User",
"Agent",
"value"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L362-L370 |
9,688 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.getHttpAccept | public function getHttpAccept($httpAccept = null)
{
if (null === ($accept = $this->getServerValue('http_accept'))) {
$accept = self::DEFAULT_HTTP_ACCEPT;
$this->setHttpAccept($accept);
}
return $accept;
} | php | public function getHttpAccept($httpAccept = null)
{
if (null === ($accept = $this->getServerValue('http_accept'))) {
$accept = self::DEFAULT_HTTP_ACCEPT;
$this->setHttpAccept($accept);
}
return $accept;
} | [
"public",
"function",
"getHttpAccept",
"(",
"$",
"httpAccept",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"(",
"$",
"accept",
"=",
"$",
"this",
"->",
"getServerValue",
"(",
"'http_accept'",
")",
")",
")",
"{",
"$",
"accept",
"=",
"self",
"::",
... | Returns the HTTP Accept server param
@param string $httpAccept (option) forced HTTP Accept chain
@return string | [
"Returns",
"the",
"HTTP",
"Accept",
"server",
"param"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L390-L397 |
9,689 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.setStorage | public function setStorage(Zend_Http_UserAgent_Storage $storage)
{
if ($this->_immutable) {
throw new Zend_Http_UserAgent_Exception(
'The User-Agent device object has already been retrieved; the storage object is now immutable'
);
}
$this->_storage =... | php | public function setStorage(Zend_Http_UserAgent_Storage $storage)
{
if ($this->_immutable) {
throw new Zend_Http_UserAgent_Exception(
'The User-Agent device object has already been retrieved; the storage object is now immutable'
);
}
$this->_storage =... | [
"public",
"function",
"setStorage",
"(",
"Zend_Http_UserAgent_Storage",
"$",
"storage",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_immutable",
")",
"{",
"throw",
"new",
"Zend_Http_UserAgent_Exception",
"(",
"'The User-Agent device object has already been retrieved; the stora... | Sets the persistent storage handler
@param Zend_Http_UserAgent_Storage $storage
@return Zend_Http_UserAgent | [
"Sets",
"the",
"persistent",
"storage",
"handler"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L450-L461 |
9,690 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.setConfig | public function setConfig($config = array())
{
if ($config instanceof Zend_Config) {
$config = $config->toArray();
}
// Verify that Config parameters are in an array.
if (!is_array($config) && !$config instanceof Traversable) {
throw new Zend_Http_UserAgent_... | php | public function setConfig($config = array())
{
if ($config instanceof Zend_Config) {
$config = $config->toArray();
}
// Verify that Config parameters are in an array.
if (!is_array($config) && !$config instanceof Traversable) {
throw new Zend_Http_UserAgent_... | [
"public",
"function",
"setConfig",
"(",
"$",
"config",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"config",
"instanceof",
"Zend_Config",
")",
"{",
"$",
"config",
"=",
"$",
"config",
"->",
"toArray",
"(",
")",
";",
"}",
"// Verify that Config param... | Config parameters is an Array or a Zend_Config object
The allowed parameters are :
- the identification sequence (can be empty) => desktop browser type is the
default browser type returned
$config['identification_sequence'] : ',' separated browser types
- the persistent storage adapter
$config['persistent_storage_adap... | [
"Config",
"parameters",
"is",
"an",
"Array",
"or",
"a",
"Zend_Config",
"object"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L503-L529 |
9,691 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.getDevice | public function getDevice()
{
if (null !== $this->_device) {
return $this->_device;
}
$userAgent = $this->getUserAgent();
// search an existing identification in the session
$storage = $this->getStorage($userAgent);
if (!$storage->isEmpty()) {
... | php | public function getDevice()
{
if (null !== $this->_device) {
return $this->_device;
}
$userAgent = $this->getUserAgent();
// search an existing identification in the session
$storage = $this->getStorage($userAgent);
if (!$storage->isEmpty()) {
... | [
"public",
"function",
"getDevice",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"_device",
")",
"{",
"return",
"$",
"this",
"->",
"_device",
";",
"}",
"$",
"userAgent",
"=",
"$",
"this",
"->",
"getUserAgent",
"(",
")",
";",
"// search ... | Returns the device object
This is the object that will contain the various discovered device
capabilities.
@return Zend_Http_UserAgent_Device $device | [
"Returns",
"the",
"device",
"object"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L539-L571 |
9,692 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.getServerValue | public function getServerValue($key)
{
$key = strtolower($key);
$server = $this->getServer();
$return = null;
if (isset($server[$key])) {
$return = $server[$key];
}
unset($server);
return $return;
} | php | public function getServerValue($key)
{
$key = strtolower($key);
$server = $this->getServer();
$return = null;
if (isset($server[$key])) {
$return = $server[$key];
}
unset($server);
return $return;
} | [
"public",
"function",
"getServerValue",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"strtolower",
"(",
"$",
"key",
")",
";",
"$",
"server",
"=",
"$",
"this",
"->",
"getServer",
"(",
")",
";",
"$",
"return",
"=",
"null",
";",
"if",
"(",
"isset",
"... | Retrieve a server value
@param string $key
@return mixed | [
"Retrieve",
"a",
"server",
"value"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L673-L683 |
9,693 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.setServerValue | public function setServerValue($key, $value)
{
if ($this->_immutable) {
throw new Zend_Http_UserAgent_Exception(
'The User-Agent device object has already been retrieved; the server array is now immutable'
);
}
$server = $this->getServer(); // ensure... | php | public function setServerValue($key, $value)
{
if ($this->_immutable) {
throw new Zend_Http_UserAgent_Exception(
'The User-Agent device object has already been retrieved; the server array is now immutable'
);
}
$server = $this->getServer(); // ensure... | [
"public",
"function",
"setServerValue",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_immutable",
")",
"{",
"throw",
"new",
"Zend_Http_UserAgent_Exception",
"(",
"'The User-Agent device object has already been retrieved; the server array ... | Set a server value
@param string|int|float $key
@param mixed $value
@return void | [
"Set",
"a",
"server",
"value"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L692-L705 |
9,694 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.setPluginLoader | public function setPluginLoader($type, $loader)
{
$type = $this->_validateLoaderType($type);
if (is_string($loader)) {
if (!class_exists($loader)) {
Zend_Loader::loadClass($loader);
}
$loader = new $loader();
} elseif (!is_object($l... | php | public function setPluginLoader($type, $loader)
{
$type = $this->_validateLoaderType($type);
if (is_string($loader)) {
if (!class_exists($loader)) {
Zend_Loader::loadClass($loader);
}
$loader = new $loader();
} elseif (!is_object($l... | [
"public",
"function",
"setPluginLoader",
"(",
"$",
"type",
",",
"$",
"loader",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"_validateLoaderType",
"(",
"$",
"type",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
"loader",
")",
")",
"{",
"if",
"(",
"... | Set plugin loader
@param string $type Type of plugin loader; one of 'storage', (?)
@param string|Zend_Loader_PluginLoader $loader
@return Zend_Http_UserAgent | [
"Set",
"plugin",
"loader"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L714-L754 |
9,695 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent.getPluginLoader | public function getPluginLoader($type)
{
$type = $this->_validateLoaderType($type);
if (!isset($this->_loaders[$type])) {
$this->setPluginLoader($type, new Zend_Loader_PluginLoader());
}
return $this->_loaders[$type];
} | php | public function getPluginLoader($type)
{
$type = $this->_validateLoaderType($type);
if (!isset($this->_loaders[$type])) {
$this->setPluginLoader($type, new Zend_Loader_PluginLoader());
}
return $this->_loaders[$type];
} | [
"public",
"function",
"getPluginLoader",
"(",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"_validateLoaderType",
"(",
"$",
"type",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_loaders",
"[",
"$",
"type",
"]",
")",
")... | Get a plugin loader
@param string $type A valid plugin loader type; see {@link $_loaderTypes}
@return Zend_Loader_PluginLoader | [
"Get",
"a",
"plugin",
"loader"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L762-L770 |
9,696 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent._validateLoaderType | protected function _validateLoaderType($type)
{
$type = strtolower($type);
if (!in_array($type, $this->_loaderTypes)) {
$types = implode(', ', $this->_loaderTypes);
throw new Zend_Http_UserAgent_Exception(sprintf(
'Expected one of "%s" for plugin loader type;... | php | protected function _validateLoaderType($type)
{
$type = strtolower($type);
if (!in_array($type, $this->_loaderTypes)) {
$types = implode(', ', $this->_loaderTypes);
throw new Zend_Http_UserAgent_Exception(sprintf(
'Expected one of "%s" for plugin loader type;... | [
"protected",
"function",
"_validateLoaderType",
"(",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"strtolower",
"(",
"$",
"type",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"type",
",",
"$",
"this",
"->",
"_loaderTypes",
")",
")",
"{",
"$",
"types",... | Validate a plugin loader type
Verifies that it is in {@link $_loaderTypes}, and returns a normalized
version of the type.
@param string $type
@return string
@throws Zend_Http_UserAgent_Exception on invalid type | [
"Validate",
"a",
"plugin",
"loader",
"type"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L782-L795 |
9,697 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent._matchUserAgent | protected function _matchUserAgent()
{
$type = self::DEFAULT_BROWSER_TYPE;
// If we have no identification sequence, just return the default type
if (empty($this->_config['identification_sequence'])) {
return $type;
}
// Get sequence against which to match
... | php | protected function _matchUserAgent()
{
$type = self::DEFAULT_BROWSER_TYPE;
// If we have no identification sequence, just return the default type
if (empty($this->_config['identification_sequence'])) {
return $type;
}
// Get sequence against which to match
... | [
"protected",
"function",
"_matchUserAgent",
"(",
")",
"{",
"$",
"type",
"=",
"self",
"::",
"DEFAULT_BROWSER_TYPE",
";",
"// If we have no identification sequence, just return the default type",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_config",
"[",
"'identification... | Run the identification sequence to match the right browser type according to the
user agent
@return Zend_Http_UserAgent_Result | [
"Run",
"the",
"identification",
"sequence",
"to",
"match",
"the",
"right",
"browser",
"type",
"according",
"to",
"the",
"user",
"agent"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L803-L839 |
9,698 | joegreen88/zf1-component-http | src/Zend/Http/UserAgent.php | Zend_Http_UserAgent._createDevice | protected function _createDevice()
{
$browserType = $this->getBrowserType();
$classname = $this->_getUserAgentDevice($browserType);
$this->_device = new $classname($this->getUserAgent(), $this->getServer(), $this->getConfig());
} | php | protected function _createDevice()
{
$browserType = $this->getBrowserType();
$classname = $this->_getUserAgentDevice($browserType);
$this->_device = new $classname($this->getUserAgent(), $this->getServer(), $this->getConfig());
} | [
"protected",
"function",
"_createDevice",
"(",
")",
"{",
"$",
"browserType",
"=",
"$",
"this",
"->",
"getBrowserType",
"(",
")",
";",
"$",
"classname",
"=",
"$",
"this",
"->",
"_getUserAgentDevice",
"(",
"$",
"browserType",
")",
";",
"$",
"this",
"->",
"... | Creates device object instance
@return void | [
"Creates",
"device",
"object",
"instance"
] | 39e834e8f0393cf4223d099a0acaab5fa05e9ad4 | https://github.com/joegreen88/zf1-component-http/blob/39e834e8f0393cf4223d099a0acaab5fa05e9ad4/src/Zend/Http/UserAgent.php#L846-L851 |
9,699 | phunc-org/Phunc | src/Time/TimeConversion.php | TimeConversion.convertToHours | function convertToHours()
{
$totalMinutes = $this->minutes;
$Mins = ($totalMinutes % 60);
$Hours = floor(abs($totalMinutes) / 60);
if ($totalMinutes < 0) {
$Hours = '-' . $Hours;
$Mins = substr($Mins, 1);
} else {
$Hours = floor($totalMinut... | php | function convertToHours()
{
$totalMinutes = $this->minutes;
$Mins = ($totalMinutes % 60);
$Hours = floor(abs($totalMinutes) / 60);
if ($totalMinutes < 0) {
$Hours = '-' . $Hours;
$Mins = substr($Mins, 1);
} else {
$Hours = floor($totalMinut... | [
"function",
"convertToHours",
"(",
")",
"{",
"$",
"totalMinutes",
"=",
"$",
"this",
"->",
"minutes",
";",
"$",
"Mins",
"=",
"(",
"$",
"totalMinutes",
"%",
"60",
")",
";",
"$",
"Hours",
"=",
"floor",
"(",
"abs",
"(",
"$",
"totalMinutes",
")",
"/",
"... | Umwandlung der Minuten in Stunden und Minuten. Z.B. 3170 Min. = 52 Std. und 50 Min.
@return $this | [
"Umwandlung",
"der",
"Minuten",
"in",
"Stunden",
"und",
"Minuten",
".",
"Z",
".",
"B",
".",
"3170",
"Min",
".",
"=",
"52",
"Std",
".",
"und",
"50",
"Min",
"."
] | 80c69d5a63e352c8e0c3330e3b8bb1288d0a9256 | https://github.com/phunc-org/Phunc/blob/80c69d5a63e352c8e0c3330e3b8bb1288d0a9256/src/Time/TimeConversion.php#L50-L65 |
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.