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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22,000 | surebert/surebert-framework | src/sb/PDO/Debugger.php | Debugger.s2o | public function s2o($sql, $params = null, $class_name = '', $prepare_and_store = 1)
{
try {
return parent::s2o($sql, $params, $class_name, $prepare_and_store);
} catch (\Exception $e) {
throw(new \sb\PDO\Exception('CALLED: ' . __METHOD__ . "\nERROR RETURNED: " . print_r($e, ... | php | public function s2o($sql, $params = null, $class_name = '', $prepare_and_store = 1)
{
try {
return parent::s2o($sql, $params, $class_name, $prepare_and_store);
} catch (\Exception $e) {
throw(new \sb\PDO\Exception('CALLED: ' . __METHOD__ . "\nERROR RETURNED: " . print_r($e, ... | [
"public",
"function",
"s2o",
"(",
"$",
"sql",
",",
"$",
"params",
"=",
"null",
",",
"$",
"class_name",
"=",
"''",
",",
"$",
"prepare_and_store",
"=",
"1",
")",
"{",
"try",
"{",
"return",
"parent",
"::",
"s2o",
"(",
"$",
"sql",
",",
"$",
"params",
... | Additionally Logs the errors | [
"Additionally",
"Logs",
"the",
"errors"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/PDO/Debugger.php#L39-L47 |
22,001 | fkooman/php-lib-http | src/fkooman/Http/Response.php | Response.setHeader | public function setHeader($keyName, $value)
{
$normalizedKeyName = self::normalizeHeaderKeyName($keyName);
$this->headers[$normalizedKeyName] = $value;
} | php | public function setHeader($keyName, $value)
{
$normalizedKeyName = self::normalizeHeaderKeyName($keyName);
$this->headers[$normalizedKeyName] = $value;
} | [
"public",
"function",
"setHeader",
"(",
"$",
"keyName",
",",
"$",
"value",
")",
"{",
"$",
"normalizedKeyName",
"=",
"self",
"::",
"normalizeHeaderKeyName",
"(",
"$",
"keyName",
")",
";",
"$",
"this",
"->",
"headers",
"[",
"$",
"normalizedKeyName",
"]",
"="... | Set a header. If it already exists the value is overwritten with the
new one.
@param string $keyName the name of the header
@param string|int $value the value of the header | [
"Set",
"a",
"header",
".",
"If",
"it",
"already",
"exists",
"the",
"value",
"is",
"overwritten",
"with",
"the",
"new",
"one",
"."
] | 94956a480459b7f6b880d61f21ef03e683deb995 | https://github.com/fkooman/php-lib-http/blob/94956a480459b7f6b880d61f21ef03e683deb995/src/fkooman/Http/Response.php#L124-L128 |
22,002 | fkooman/php-lib-http | src/fkooman/Http/Response.php | Response.send | public function send()
{
header(
sprintf(
'HTTP/1.1 %s %s',
$this->statusCode,
self::codeToReason($this->statusCode)
)
);
foreach ($this->headers as $k => $v) {
header(
sprintf('%s: %s', $k, $... | php | public function send()
{
header(
sprintf(
'HTTP/1.1 %s %s',
$this->statusCode,
self::codeToReason($this->statusCode)
)
);
foreach ($this->headers as $k => $v) {
header(
sprintf('%s: %s', $k, $... | [
"public",
"function",
"send",
"(",
")",
"{",
"header",
"(",
"sprintf",
"(",
"'HTTP/1.1 %s %s'",
",",
"$",
"this",
"->",
"statusCode",
",",
"self",
"::",
"codeToReason",
"(",
"$",
"this",
"->",
"statusCode",
")",
")",
")",
";",
"foreach",
"(",
"$",
"thi... | Construct the response and send it out. | [
"Construct",
"the",
"response",
"and",
"send",
"it",
"out",
"."
] | 94956a480459b7f6b880d61f21ef03e683deb995 | https://github.com/fkooman/php-lib-http/blob/94956a480459b7f6b880d61f21ef03e683deb995/src/fkooman/Http/Response.php#L152-L167 |
22,003 | fkooman/php-lib-http | src/fkooman/Http/Response.php | Response.toArray | public function toArray()
{
$output = [];
$output[] = sprintf(
'HTTP/1.1 %s %s',
$this->statusCode,
self::codeToReason($this->statusCode)
);
foreach ($this->headers as $k => $v) {
$output[] = sprintf('%s: %s', $k, $v);
}
... | php | public function toArray()
{
$output = [];
$output[] = sprintf(
'HTTP/1.1 %s %s',
$this->statusCode,
self::codeToReason($this->statusCode)
);
foreach ($this->headers as $k => $v) {
$output[] = sprintf('%s: %s', $k, $v);
}
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"output",
"[",
"]",
"=",
"sprintf",
"(",
"'HTTP/1.1 %s %s'",
",",
"$",
"this",
"->",
"statusCode",
",",
"self",
"::",
"codeToReason",
"(",
"$",
"this",
"->",
"sta... | Convert the full response to array for the purpose of unit testing. | [
"Convert",
"the",
"full",
"response",
"to",
"array",
"for",
"the",
"purpose",
"of",
"unit",
"testing",
"."
] | 94956a480459b7f6b880d61f21ef03e683deb995 | https://github.com/fkooman/php-lib-http/blob/94956a480459b7f6b880d61f21ef03e683deb995/src/fkooman/Http/Response.php#L172-L187 |
22,004 | ekuiter/feature-php | FeaturePhp/Renderer.php | Renderer.render | public function render($textOnly = false) {
if ($textOnly)
return $this->renderText();
$str = $this->getStyle();
$str .= "<table><tr><td valign='top'>";
$str .= $this->_render(false);
$str .= "</td></tr></table>";
return $str;
} | php | public function render($textOnly = false) {
if ($textOnly)
return $this->renderText();
$str = $this->getStyle();
$str .= "<table><tr><td valign='top'>";
$str .= $this->_render(false);
$str .= "</td></tr></table>";
return $str;
} | [
"public",
"function",
"render",
"(",
"$",
"textOnly",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"textOnly",
")",
"return",
"$",
"this",
"->",
"renderText",
"(",
")",
";",
"$",
"str",
"=",
"$",
"this",
"->",
"getStyle",
"(",
")",
";",
"$",
"str",
".... | Returns the renderer's web page.
@param bool $textOnly whether to render text or HTML
@return string | [
"Returns",
"the",
"renderer",
"s",
"web",
"page",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Renderer.php#L46-L55 |
22,005 | spiral-modules/listing | source/Listing/Filters/ValueFilter.php | ValueFilter.normalizeValue | private function normalizeValue($value)
{
switch ($this->type) {
case self::TYPE_STRING:
return trim((string)$value);
case self::TYPE_INT:
return intval($value);
case self::TYPE_FLOAT:
return floatval($value);
}
... | php | private function normalizeValue($value)
{
switch ($this->type) {
case self::TYPE_STRING:
return trim((string)$value);
case self::TYPE_INT:
return intval($value);
case self::TYPE_FLOAT:
return floatval($value);
}
... | [
"private",
"function",
"normalizeValue",
"(",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"type",
")",
"{",
"case",
"self",
"::",
"TYPE_STRING",
":",
"return",
"trim",
"(",
"(",
"string",
")",
"$",
"value",
")",
";",
"case",
"self",
"::... | Normalize input value
@param mixed $value
@return float|int|string | [
"Normalize",
"input",
"value"
] | 89abe8939ce91cbf61b51b99e93ce1e57c8af83c | https://github.com/spiral-modules/listing/blob/89abe8939ce91cbf61b51b99e93ce1e57c8af83c/source/Listing/Filters/ValueFilter.php#L116-L128 |
22,006 | phpcq/branch-alias-validation | src/Command/ValidateBranchAlias.php | ValidateBranchAlias.getTagFromBranch | protected function getTagFromBranch($branch)
{
$git = new GitRepository($this->input->getArgument('git-dir'));
$tag = trim($git->describe()->tags()->always()->execute($branch));
$hash = trim($git->revParse()->short(false)->execute($branch));
return $hash !== $tag ? $tag : null;
... | php | protected function getTagFromBranch($branch)
{
$git = new GitRepository($this->input->getArgument('git-dir'));
$tag = trim($git->describe()->tags()->always()->execute($branch));
$hash = trim($git->revParse()->short(false)->execute($branch));
return $hash !== $tag ? $tag : null;
... | [
"protected",
"function",
"getTagFromBranch",
"(",
"$",
"branch",
")",
"{",
"$",
"git",
"=",
"new",
"GitRepository",
"(",
"$",
"this",
"->",
"input",
"->",
"getArgument",
"(",
"'git-dir'",
")",
")",
";",
"$",
"tag",
"=",
"trim",
"(",
"$",
"git",
"->",
... | Retrieve the latest tag from a branch.
@param string $branch The branch name to retrieve the tag from.
@return null|string Returns null when no tag has been found, the tag name otherwise. | [
"Retrieve",
"the",
"latest",
"tag",
"from",
"a",
"branch",
"."
] | 99ff083af418aad87a6da1331d3924c32137fc76 | https://github.com/phpcq/branch-alias-validation/blob/99ff083af418aad87a6da1331d3924c32137fc76/src/Command/ValidateBranchAlias.php#L86-L92 |
22,007 | phpcq/branch-alias-validation | src/Command/ValidateBranchAlias.php | ValidateBranchAlias.validate | public function validate($tag, $alias)
{
$simpleAlias = preg_replace('~(\.x)?-dev~', '', $alias);
$versionLevel = count(explode('.', $simpleAlias));
$reducedTag = preg_replace('~-.*$~', '', $tag);
$reducedTag = implode('.', array_slice(explode('.', $reducedTag), 0, $versionLevel... | php | public function validate($tag, $alias)
{
$simpleAlias = preg_replace('~(\.x)?-dev~', '', $alias);
$versionLevel = count(explode('.', $simpleAlias));
$reducedTag = preg_replace('~-.*$~', '', $tag);
$reducedTag = implode('.', array_slice(explode('.', $reducedTag), 0, $versionLevel... | [
"public",
"function",
"validate",
"(",
"$",
"tag",
",",
"$",
"alias",
")",
"{",
"$",
"simpleAlias",
"=",
"preg_replace",
"(",
"'~(\\.x)?-dev~'",
",",
"''",
",",
"$",
"alias",
")",
";",
"$",
"versionLevel",
"=",
"count",
"(",
"explode",
"(",
"'.'",
",",... | Validate the given branch.
Returns true on success, the name of the offending tag on failure.
@param string $tag The tag to check.
@param string $alias The alias for the given branch.
@return bool|string | [
"Validate",
"the",
"given",
"branch",
"."
] | 99ff083af418aad87a6da1331d3924c32137fc76 | https://github.com/phpcq/branch-alias-validation/blob/99ff083af418aad87a6da1331d3924c32137fc76/src/Command/ValidateBranchAlias.php#L105-L113 |
22,008 | tttptd/laravel-responder | src/Traits/ConvertsParameters.php | ConvertsParameters.getConvertedParameters | protected function getConvertedParameters():array
{
$parameters = $this->all();
$parameters = $this->castBooleans($parameters);
$parameters = $this->convertToSnakeCase($parameters);
if (method_exists($this, 'convertParameters')) {
$parameters = $this->convertParameters($... | php | protected function getConvertedParameters():array
{
$parameters = $this->all();
$parameters = $this->castBooleans($parameters);
$parameters = $this->convertToSnakeCase($parameters);
if (method_exists($this, 'convertParameters')) {
$parameters = $this->convertParameters($... | [
"protected",
"function",
"getConvertedParameters",
"(",
")",
":",
"array",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"all",
"(",
")",
";",
"$",
"parameters",
"=",
"$",
"this",
"->",
"castBooleans",
"(",
"$",
"parameters",
")",
";",
"$",
"parameters... | Cast and convert parameters.
@return array | [
"Cast",
"and",
"convert",
"parameters",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/ConvertsParameters.php#L62-L73 |
22,009 | tttptd/laravel-responder | src/Traits/ConvertsParameters.php | ConvertsParameters.castBooleans | protected function castBooleans($input):array
{
if ($this->castToBooleanIsDisabled()) {
return [];
}
$casted = [];
foreach ($input as $key => $value) {
$casted[$key] = $this->castValueToBoolean($value);
}
return $casted;
} | php | protected function castBooleans($input):array
{
if ($this->castToBooleanIsDisabled()) {
return [];
}
$casted = [];
foreach ($input as $key => $value) {
$casted[$key] = $this->castValueToBoolean($value);
}
return $casted;
} | [
"protected",
"function",
"castBooleans",
"(",
"$",
"input",
")",
":",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"castToBooleanIsDisabled",
"(",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"casted",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"... | Cast all string booleans to real boolean values.
@param mixed $input
@return array | [
"Cast",
"all",
"string",
"booleans",
"to",
"real",
"boolean",
"values",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/ConvertsParameters.php#L88-L101 |
22,010 | tttptd/laravel-responder | src/Traits/ConvertsParameters.php | ConvertsParameters.convertToSnakeCase | protected function convertToSnakeCase($input)
{
if ($this->convertToSnakeCaseIsDisabled()) {
return;
}
if (is_null($input)) {
return null;
} elseif (is_array($input)) {
return $this->convertArrayToSnakeCase($input);
}
return snake... | php | protected function convertToSnakeCase($input)
{
if ($this->convertToSnakeCaseIsDisabled()) {
return;
}
if (is_null($input)) {
return null;
} elseif (is_array($input)) {
return $this->convertArrayToSnakeCase($input);
}
return snake... | [
"protected",
"function",
"convertToSnakeCase",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"convertToSnakeCaseIsDisabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"input",
")",
")",
"{",
"return",
"null",
... | Convert a string or array to snake case.
@param mixed $input
@return mixed | [
"Convert",
"a",
"string",
"or",
"array",
"to",
"snake",
"case",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/ConvertsParameters.php#L134-L147 |
22,011 | tttptd/laravel-responder | src/Traits/ConvertsParameters.php | ConvertsParameters.convertArrayToSnakeCase | protected function convertArrayToSnakeCase(array $input):array
{
$converted = [];
foreach ($input as $key => $value) {
$converted[snake_case($key)] = $value;
}
return $converted;
} | php | protected function convertArrayToSnakeCase(array $input):array
{
$converted = [];
foreach ($input as $key => $value) {
$converted[snake_case($key)] = $value;
}
return $converted;
} | [
"protected",
"function",
"convertArrayToSnakeCase",
"(",
"array",
"$",
"input",
")",
":",
"array",
"{",
"$",
"converted",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"input",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"converted",
"[",
"snake_ca... | Convert all keys of an array to snake case.
@param array $input
@return array | [
"Convert",
"all",
"keys",
"of",
"an",
"array",
"to",
"snake",
"case",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Traits/ConvertsParameters.php#L165-L174 |
22,012 | ajgarlag/AjglSessionConcurrency | src/Http/Session/Registry/SessionRegistry.php | SessionRegistry.refreshLastUsed | public function refreshLastUsed($sessionId, $lastUsed = null)
{
if ($sessionInformation = $this->getSessionInformation($sessionId)) {
if ($sessionInformation->getLastUsed() !== $lastUsed) {
$sessionInformation->refreshLastUsed($lastUsed);
$this->saveSessionInforma... | php | public function refreshLastUsed($sessionId, $lastUsed = null)
{
if ($sessionInformation = $this->getSessionInformation($sessionId)) {
if ($sessionInformation->getLastUsed() !== $lastUsed) {
$sessionInformation->refreshLastUsed($lastUsed);
$this->saveSessionInforma... | [
"public",
"function",
"refreshLastUsed",
"(",
"$",
"sessionId",
",",
"$",
"lastUsed",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"sessionInformation",
"=",
"$",
"this",
"->",
"getSessionInformation",
"(",
"$",
"sessionId",
")",
")",
"{",
"if",
"(",
"$",
"ses... | Updates the given sessionId so its last request time is equal to the present date and time.
@param string $sessionId the session identifier key.
@param int|null $lastUsed the last request timestamp | [
"Updates",
"the",
"given",
"sessionId",
"so",
"its",
"last",
"request",
"time",
"is",
"equal",
"to",
"the",
"present",
"date",
"and",
"time",
"."
] | daa3b1ff3ad4951947f7192e12b2496555e135fb | https://github.com/ajgarlag/AjglSessionConcurrency/blob/daa3b1ff3ad4951947f7192e12b2496555e135fb/src/Http/Session/Registry/SessionRegistry.php#L64-L72 |
22,013 | ajgarlag/AjglSessionConcurrency | src/Http/Session/Registry/SessionRegistry.php | SessionRegistry.expireNow | public function expireNow($sessionId)
{
if ($sessionInformation = $this->getSessionInformation($sessionId)) {
$sessionInformation->expireNow();
$this->saveSessionInformation($sessionInformation);
}
} | php | public function expireNow($sessionId)
{
if ($sessionInformation = $this->getSessionInformation($sessionId)) {
$sessionInformation->expireNow();
$this->saveSessionInformation($sessionInformation);
}
} | [
"public",
"function",
"expireNow",
"(",
"$",
"sessionId",
")",
"{",
"if",
"(",
"$",
"sessionInformation",
"=",
"$",
"this",
"->",
"getSessionInformation",
"(",
"$",
"sessionId",
")",
")",
"{",
"$",
"sessionInformation",
"->",
"expireNow",
"(",
")",
";",
"$... | Expires the given sessionId.
@param string $sessionId the session identifier key. | [
"Expires",
"the",
"given",
"sessionId",
"."
] | daa3b1ff3ad4951947f7192e12b2496555e135fb | https://github.com/ajgarlag/AjglSessionConcurrency/blob/daa3b1ff3ad4951947f7192e12b2496555e135fb/src/Http/Session/Registry/SessionRegistry.php#L79-L85 |
22,014 | ajgarlag/AjglSessionConcurrency | src/Http/Session/Registry/SessionRegistry.php | SessionRegistry.registerNewSession | public function registerNewSession($sessionId, $username, $lastUsed = null)
{
$sessionInformation = new SessionInformation($sessionId, $username, $lastUsed ?: time());
$this->saveSessionInformation($sessionInformation);
} | php | public function registerNewSession($sessionId, $username, $lastUsed = null)
{
$sessionInformation = new SessionInformation($sessionId, $username, $lastUsed ?: time());
$this->saveSessionInformation($sessionInformation);
} | [
"public",
"function",
"registerNewSession",
"(",
"$",
"sessionId",
",",
"$",
"username",
",",
"$",
"lastUsed",
"=",
"null",
")",
"{",
"$",
"sessionInformation",
"=",
"new",
"SessionInformation",
"(",
"$",
"sessionId",
",",
"$",
"username",
",",
"$",
"lastUse... | Registers a new session for the given user.
@param string $sessionId the session identifier key.
@param string $username the given user.
@param int $lastUsed | [
"Registers",
"a",
"new",
"session",
"for",
"the",
"given",
"user",
"."
] | daa3b1ff3ad4951947f7192e12b2496555e135fb | https://github.com/ajgarlag/AjglSessionConcurrency/blob/daa3b1ff3ad4951947f7192e12b2496555e135fb/src/Http/Session/Registry/SessionRegistry.php#L94-L99 |
22,015 | ajgarlag/AjglSessionConcurrency | src/Http/Session/Registry/SessionRegistry.php | SessionRegistry.collectGarbage | public function collectGarbage($maxLifetime = null)
{
$maxLifetime = $maxLifetime ?: ini_get('session.gc_maxlifetime');
$this->sessionRegistryStorage->collectGarbage($maxLifetime);
} | php | public function collectGarbage($maxLifetime = null)
{
$maxLifetime = $maxLifetime ?: ini_get('session.gc_maxlifetime');
$this->sessionRegistryStorage->collectGarbage($maxLifetime);
} | [
"public",
"function",
"collectGarbage",
"(",
"$",
"maxLifetime",
"=",
"null",
")",
"{",
"$",
"maxLifetime",
"=",
"$",
"maxLifetime",
"?",
":",
"ini_get",
"(",
"'session.gc_maxlifetime'",
")",
";",
"$",
"this",
"->",
"sessionRegistryStorage",
"->",
"collectGarbag... | Removes sessions information which last used timestamp is older
than the given lifetime.
@param int $maxLifetime | [
"Removes",
"sessions",
"information",
"which",
"last",
"used",
"timestamp",
"is",
"older",
"than",
"the",
"given",
"lifetime",
"."
] | daa3b1ff3ad4951947f7192e12b2496555e135fb | https://github.com/ajgarlag/AjglSessionConcurrency/blob/daa3b1ff3ad4951947f7192e12b2496555e135fb/src/Http/Session/Registry/SessionRegistry.php#L117-L121 |
22,016 | DevGroup-ru/yii2-users-module | src/models/RegistrationForm.php | RegistrationForm.register | public function register()
{
if (!$this->validate()) {
return false;
}
/** @var User $user */
$user = Yii::createObject(ModelMapHelper::User());
$user->setAttributes($this->attributes);
$result = $user->register();
if ($user->hasErrors()) {
... | php | public function register()
{
if (!$this->validate()) {
return false;
}
/** @var User $user */
$user = Yii::createObject(ModelMapHelper::User());
$user->setAttributes($this->attributes);
$result = $user->register();
if ($user->hasErrors()) {
... | [
"public",
"function",
"register",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validate",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"/** @var User $user */",
"$",
"user",
"=",
"Yii",
"::",
"createObject",
"(",
"ModelMapHelper",
"::",
"User",... | Performs registration of user.
Returns User object on success or false on failure.
@return bool|User
@throws \yii\base\InvalidConfigException | [
"Performs",
"registration",
"of",
"user",
".",
"Returns",
"User",
"object",
"on",
"success",
"or",
"false",
"on",
"failure",
"."
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/models/RegistrationForm.php#L64-L85 |
22,017 | mekras/atompub | src/Element/Workspace.php | Workspace.getCollections | public function getCollections()
{
return $this->getCachedProperty(
'collections',
function () {
$result = [];
/** @var \DOMNodeList $items */
// No REQUIRED — no exception.
$items = $this->query('app:collection');
... | php | public function getCollections()
{
return $this->getCachedProperty(
'collections',
function () {
$result = [];
/** @var \DOMNodeList $items */
// No REQUIRED — no exception.
$items = $this->query('app:collection');
... | [
"public",
"function",
"getCollections",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"getCachedProperty",
"(",
"'collections'",
",",
"function",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"/** @var \\DOMNodeList $items */",
"// No REQUIRED — no exception.",
... | Return collections.
@return Collection[]
@since 1.0 | [
"Return",
"collections",
"."
] | cfc9aab97cff7a822b720e1dd84ef16733183dbb | https://github.com/mekras/atompub/blob/cfc9aab97cff7a822b720e1dd84ef16733183dbb/src/Element/Workspace.php#L30-L46 |
22,018 | mekras/atompub | src/Element/Workspace.php | Workspace.addCollection | public function addCollection($title)
{
$collections = $this->getCollections();
/** @var Collection $collection */
$collection = $this->getExtensions()->createElement($this, 'app:collection');
$collection->addTitle($title);
$collections[] = $collection;
$this->setCa... | php | public function addCollection($title)
{
$collections = $this->getCollections();
/** @var Collection $collection */
$collection = $this->getExtensions()->createElement($this, 'app:collection');
$collection->addTitle($title);
$collections[] = $collection;
$this->setCa... | [
"public",
"function",
"addCollection",
"(",
"$",
"title",
")",
"{",
"$",
"collections",
"=",
"$",
"this",
"->",
"getCollections",
"(",
")",
";",
"/** @var Collection $collection */",
"$",
"collection",
"=",
"$",
"this",
"->",
"getExtensions",
"(",
")",
"->",
... | Add new Collection
@param string $title
@return Collection
@since 1.0 | [
"Add",
"new",
"Collection"
] | cfc9aab97cff7a822b720e1dd84ef16733183dbb | https://github.com/mekras/atompub/blob/cfc9aab97cff7a822b720e1dd84ef16733183dbb/src/Element/Workspace.php#L57-L69 |
22,019 | i-lateral/silverstripe-modeladminplus | src/GridFieldDateFinder.php | GridFieldDateFinder.convertDateFields | public function convertDateFields()
{
$grid_field = $this->getGridField();
$config = $grid_field->getConfig();
$db = Config::inst()->get($grid_field->getModelClass(), "db");
$dates = self::config()->date_fields;
$fields = $this->findDateFields();
// First setup colum... | php | public function convertDateFields()
{
$grid_field = $this->getGridField();
$config = $grid_field->getConfig();
$db = Config::inst()->get($grid_field->getModelClass(), "db");
$dates = self::config()->date_fields;
$fields = $this->findDateFields();
// First setup colum... | [
"public",
"function",
"convertDateFields",
"(",
")",
"{",
"$",
"grid_field",
"=",
"$",
"this",
"->",
"getGridField",
"(",
")",
";",
"$",
"config",
"=",
"$",
"grid_field",
"->",
"getConfig",
"(",
")",
";",
"$",
"db",
"=",
"Config",
"::",
"inst",
"(",
... | Get any date fields from the passed list and convert to .Nice format.
@param GridField $field GridField want to convert
@return self | [
"Get",
"any",
"date",
"fields",
"from",
"the",
"passed",
"list",
"and",
"convert",
"to",
".",
"Nice",
"format",
"."
] | c5209d9610cdb36ddc7b9231fad342df7e75ffc0 | https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/GridFieldDateFinder.php#L59-L104 |
22,020 | mikebarlow/html-helper | src/Helpers/Form.php | Form.open | public function open($method, $action = '', $attr = array())
{
// check if they wish to send a file
// default to post method and add the enctype needed to send files
$method = strtolower($method);
if ($method === 'file') {
$method = 'post';
$attr['enctype'] =... | php | public function open($method, $action = '', $attr = array())
{
// check if they wish to send a file
// default to post method and add the enctype needed to send files
$method = strtolower($method);
if ($method === 'file') {
$method = 'post';
$attr['enctype'] =... | [
"public",
"function",
"open",
"(",
"$",
"method",
",",
"$",
"action",
"=",
"''",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"// check if they wish to send a file",
"// default to post method and add the enctype needed to send files",
"$",
"method",
"=",
"st... | open a form
@param string Type of form, get / post / file (adds as post and adds enctype) etc...
@param string Action for the form
@param array Array of extra params
@return string | [
"open",
"a",
"form"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L57-L75 |
22,021 | mikebarlow/html-helper | src/Helpers/Form.php | Form.hidden | public function hidden($name, $attr = array())
{
return $this->input(
$name,
false,
array_merge(
$attr,
array('type' => 'hidden', 'wrapper' => false)
)
);
} | php | public function hidden($name, $attr = array())
{
return $this->input(
$name,
false,
array_merge(
$attr,
array('type' => 'hidden', 'wrapper' => false)
)
);
} | [
"public",
"function",
"hidden",
"(",
"$",
"name",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"input",
"(",
"$",
"name",
",",
"false",
",",
"array_merge",
"(",
"$",
"attr",
",",
"array",
"(",
"'type'",
"=>",
"... | shortcut for hidden input field
@param string input name (dot notation for multi-dimensional array)
@param array input attributes
@return string | [
"shortcut",
"for",
"hidden",
"input",
"field"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L106-L116 |
22,022 | mikebarlow/html-helper | src/Helpers/Form.php | Form.password | public function password($name, $label, $attr = array())
{
return $this->input(
$name,
$label,
array_merge(
$attr,
array('type' => 'password')
)
);
} | php | public function password($name, $label, $attr = array())
{
return $this->input(
$name,
$label,
array_merge(
$attr,
array('type' => 'password')
)
);
} | [
"public",
"function",
"password",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"input",
"(",
"$",
"name",
",",
"$",
"label",
",",
"array_merge",
"(",
"$",
"attr",
",",
"arra... | shortcut for password field
@param string input name (dot notation for multi-dimensional array)
@param string|array Label string or array of label value and attributes
@param array input attributes
@return string | [
"shortcut",
"for",
"password",
"field"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L126-L136 |
22,023 | mikebarlow/html-helper | src/Helpers/Form.php | Form.textarea | public function textarea($name, $label, $attr = array())
{
return $this->input(
$name,
$label,
array_merge(
$attr,
array('type' => 'textarea')
)
);
} | php | public function textarea($name, $label, $attr = array())
{
return $this->input(
$name,
$label,
array_merge(
$attr,
array('type' => 'textarea')
)
);
} | [
"public",
"function",
"textarea",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"input",
"(",
"$",
"name",
",",
"$",
"label",
",",
"array_merge",
"(",
"$",
"attr",
",",
"arra... | shortcut for textarea field
@param string input name (dot notation for multi-dimensional array)
@param string|array Label string or array of label value and attributes
@param array input attributes
@return string | [
"shortcut",
"for",
"textarea",
"field"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L146-L156 |
22,024 | mikebarlow/html-helper | src/Helpers/Form.php | Form.file | public function file($name, $label, $attr = array())
{
return $this->input(
$name,
$label,
array_merge(
$attr,
array('type' => 'file')
)
);
} | php | public function file($name, $label, $attr = array())
{
return $this->input(
$name,
$label,
array_merge(
$attr,
array('type' => 'file')
)
);
} | [
"public",
"function",
"file",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"input",
"(",
"$",
"name",
",",
"$",
"label",
",",
"array_merge",
"(",
"$",
"attr",
",",
"array",
... | shortcut for file field
@param string input name (dot notation for multi-dimensional array)
@param string|array Label string or array of label value and attributes
@param array input attributes
@return string | [
"shortcut",
"for",
"file",
"field"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L166-L176 |
22,025 | mikebarlow/html-helper | src/Helpers/Form.php | Form.checkbox | public function checkbox($name, $label, $attr = array())
{
return $this->input(
$name,
$label,
array_merge(
$attr,
array('type' => 'checkbox')
)
);
} | php | public function checkbox($name, $label, $attr = array())
{
return $this->input(
$name,
$label,
array_merge(
$attr,
array('type' => 'checkbox')
)
);
} | [
"public",
"function",
"checkbox",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"input",
"(",
"$",
"name",
",",
"$",
"label",
",",
"array_merge",
"(",
"$",
"attr",
",",
"arra... | shortcut for checkbox field
@param string input name (dot notation for multi-dimensional array)
@param string|array Label string or array of label value and attributes
@param array input attributes
@return string | [
"shortcut",
"for",
"checkbox",
"field"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L186-L196 |
22,026 | mikebarlow/html-helper | src/Helpers/Form.php | Form.submit | public function submit($name, $label, $attr = array())
{
return $this->input(
$name,
false,
array_merge(
$attr,
array(
'type' => 'submit',
'value' => $label
)
)
);
... | php | public function submit($name, $label, $attr = array())
{
return $this->input(
$name,
false,
array_merge(
$attr,
array(
'type' => 'submit',
'value' => $label
)
)
);
... | [
"public",
"function",
"submit",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"input",
"(",
"$",
"name",
",",
"false",
",",
"array_merge",
"(",
"$",
"attr",
",",
"array",
"("... | generate a submit input
@param string dot notation form for input - will match with Input handler and prefill if found
@param string label for form, pass false to not show label
@param array array of extra options for the input
@return string form element | [
"generate",
"a",
"submit",
"input"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L206-L219 |
22,027 | mikebarlow/html-helper | src/Helpers/Form.php | Form.button | public function button($name, $label, $attr = array())
{
return $this->input(
$name,
false,
array_merge(
$attr,
array(
'type' => 'button',
'value' => $label
)
)
);
... | php | public function button($name, $label, $attr = array())
{
return $this->input(
$name,
false,
array_merge(
$attr,
array(
'type' => 'button',
'value' => $label
)
)
);
... | [
"public",
"function",
"button",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"input",
"(",
"$",
"name",
",",
"false",
",",
"array_merge",
"(",
"$",
"attr",
",",
"array",
"("... | generate a button input
@param string dot notation form for input - will match with Input handler and prefill if found
@param string label for form, pass false to not show label
@param array array of extra options for the input
@return string form element | [
"generate",
"a",
"button",
"input"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L229-L242 |
22,028 | mikebarlow/html-helper | src/Helpers/Form.php | Form.radio | public function radio($name, $label, $options, $attr = array())
{
return $this->input(
$name,
$label,
array_merge(
$attr,
array(
'type' => 'radio',
'options' => $options
)
... | php | public function radio($name, $label, $options, $attr = array())
{
return $this->input(
$name,
$label,
array_merge(
$attr,
array(
'type' => 'radio',
'options' => $options
)
... | [
"public",
"function",
"radio",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"options",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"input",
"(",
"$",
"name",
",",
"$",
"label",
",",
"array_merge",
"(",
"$",
... | generate a group of radio buttons
@param string input name (dot notation for multi-dimensional array)
@param string|array Label string or array of label value and attributes
@param array radio Options
@param array input attributes
@return string | [
"generate",
"a",
"group",
"of",
"radio",
"buttons"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L277-L290 |
22,029 | mikebarlow/html-helper | src/Helpers/Form.php | Form.input | public function input($name, $label, $attr = array())
{
// generate an id if none exists
if (empty($attr['id'])) {
$attr['id'] = $this->transformNameForID($name);
}
// build the label
if ($label !== false) {
$labelAttr = [];
if (is_array($... | php | public function input($name, $label, $attr = array())
{
// generate an id if none exists
if (empty($attr['id'])) {
$attr['id'] = $this->transformNameForID($name);
}
// build the label
if ($label !== false) {
$labelAttr = [];
if (is_array($... | [
"public",
"function",
"input",
"(",
"$",
"name",
",",
"$",
"label",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"// generate an id if none exists",
"if",
"(",
"empty",
"(",
"$",
"attr",
"[",
"'id'",
"]",
")",
")",
"{",
"$",
"attr",
"[",
"'i... | generate a complete input with wrapped div and label
@param string input name (dot notation for multi-dimensional array)
@param string|array Label string or array of label value and attributes
@param array input attributes
@return string | [
"generate",
"a",
"complete",
"input",
"with",
"wrapped",
"div",
"and",
"label"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L325-L388 |
22,030 | mikebarlow/html-helper | src/Helpers/Form.php | Form.generateField | public function generateField($name, $attr = array())
{
$tag = 'input';
if (in_array($attr['type'], $this->customGenerate)) {
$tag = $attr['type'];
}
$attr['name'] = $this->transformName($name);
$attr = $this->getData($name, $attr);
if ($tag !== 'input'... | php | public function generateField($name, $attr = array())
{
$tag = 'input';
if (in_array($attr['type'], $this->customGenerate)) {
$tag = $attr['type'];
}
$attr['name'] = $this->transformName($name);
$attr = $this->getData($name, $attr);
if ($tag !== 'input'... | [
"public",
"function",
"generateField",
"(",
"$",
"name",
",",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"$",
"tag",
"=",
"'input'",
";",
"if",
"(",
"in_array",
"(",
"$",
"attr",
"[",
"'type'",
"]",
",",
"$",
"this",
"->",
"customGenerate",
")"... | generate a field
@param string The type of input field to create
@param array Array of attributes for the tag
@return string | [
"generate",
"a",
"field"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L429-L446 |
22,031 | mikebarlow/html-helper | src/Helpers/Form.php | Form.generateRadioField | public function generateRadioField($attr)
{
if (empty($attr['name'])) {
return '';
}
$out = '';
$options = array();
if (! empty($attr['options'])) {
$options = $attr['options'];
}
if (isset($attr['checked'])) {
$checkedIt... | php | public function generateRadioField($attr)
{
if (empty($attr['name'])) {
return '';
}
$out = '';
$options = array();
if (! empty($attr['options'])) {
$options = $attr['options'];
}
if (isset($attr['checked'])) {
$checkedIt... | [
"public",
"function",
"generateRadioField",
"(",
"$",
"attr",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"attr",
"[",
"'name'",
"]",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"out",
"=",
"''",
";",
"$",
"options",
"=",
"array",
"(",
")",
";",
... | generate a selection of radio buttons
@param array array of attributes
@return string | [
"generate",
"a",
"selection",
"of",
"radio",
"buttons"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L454-L506 |
22,032 | mikebarlow/html-helper | src/Helpers/Form.php | Form.generateCheckboxField | public function generateCheckboxField($attr)
{
if (empty($attr['name'])) {
return '';
}
$out = '';
if ((isset($attr['hiddenCheckbox']) && $attr['hiddenCheckbox']) || ! isset($attr['hiddenCheckbox'])) {
$out .= $this->input(
$attr['name'],
... | php | public function generateCheckboxField($attr)
{
if (empty($attr['name'])) {
return '';
}
$out = '';
if ((isset($attr['hiddenCheckbox']) && $attr['hiddenCheckbox']) || ! isset($attr['hiddenCheckbox'])) {
$out .= $this->input(
$attr['name'],
... | [
"public",
"function",
"generateCheckboxField",
"(",
"$",
"attr",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"attr",
"[",
"'name'",
"]",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"out",
"=",
"''",
";",
"if",
"(",
"(",
"isset",
"(",
"$",
"attr",
... | generate a checkbox
@param array array of attributes
@return string | [
"generate",
"a",
"checkbox"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L514-L542 |
22,033 | mikebarlow/html-helper | src/Helpers/Form.php | Form.generateButtonField | public function generateButtonField($attr)
{
$value = 'Submit';
if (! empty($attr['value'])) {
$value = $attr['value'];
}
unset($attr['value'], $attr['type']);
return $this->Html->tag('button', $attr, $value, true);
} | php | public function generateButtonField($attr)
{
$value = 'Submit';
if (! empty($attr['value'])) {
$value = $attr['value'];
}
unset($attr['value'], $attr['type']);
return $this->Html->tag('button', $attr, $value, true);
} | [
"public",
"function",
"generateButtonField",
"(",
"$",
"attr",
")",
"{",
"$",
"value",
"=",
"'Submit'",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"attr",
"[",
"'value'",
"]",
")",
")",
"{",
"$",
"value",
"=",
"$",
"attr",
"[",
"'value'",
"]",
";",
... | generate a button
@param array array of attributes
@return string | [
"generate",
"a",
"button"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L571-L581 |
22,034 | mikebarlow/html-helper | src/Helpers/Form.php | Form.generateSelectField | public function generateSelectField($attr)
{
if (empty($attr['name'])) {
return '';
}
$options = array();
if (! empty($attr['options'])) {
$options = $attr['options'];
}
$options = $this->generateSelectOptions($options, $attr);
unset... | php | public function generateSelectField($attr)
{
if (empty($attr['name'])) {
return '';
}
$options = array();
if (! empty($attr['options'])) {
$options = $attr['options'];
}
$options = $this->generateSelectOptions($options, $attr);
unset... | [
"public",
"function",
"generateSelectField",
"(",
"$",
"attr",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"attr",
"[",
"'name'",
"]",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"options",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",... | generate a select field
@param array array of attributes
@return string | [
"generate",
"a",
"select",
"field"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L589-L605 |
22,035 | mikebarlow/html-helper | src/Helpers/Form.php | Form.generateSelectOptions | public function generateSelectOptions($options, $attr)
{
$return = '';
foreach ($options as $key => $value) {
if (is_array($value)) {
$subArray = $this->generateSelectOptions($value, $attr);
$return .= $this->Html->tag(
'optgroup',
... | php | public function generateSelectOptions($options, $attr)
{
$return = '';
foreach ($options as $key => $value) {
if (is_array($value)) {
$subArray = $this->generateSelectOptions($value, $attr);
$return .= $this->Html->tag(
'optgroup',
... | [
"public",
"function",
"generateSelectOptions",
"(",
"$",
"options",
",",
"$",
"attr",
")",
"{",
"$",
"return",
"=",
"''",
";",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
... | generate the options for a select box
@param array array of options
@param array array of attributes
@return string | [
"generate",
"the",
"options",
"for",
"a",
"select",
"box"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L625-L658 |
22,036 | mikebarlow/html-helper | src/Helpers/Form.php | Form.transformName | public function transformName($name)
{
if (strpos($name, '.') !== false) {
$bits = explode('.', $name, 2);
$bits['1'] = '[' . str_replace('.', '][', $bits['1']) . ']';
return implode('', $bits);
} else {
return $name;
}
} | php | public function transformName($name)
{
if (strpos($name, '.') !== false) {
$bits = explode('.', $name, 2);
$bits['1'] = '[' . str_replace('.', '][', $bits['1']) . ']';
return implode('', $bits);
} else {
return $name;
}
} | [
"public",
"function",
"transformName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"name",
",",
"'.'",
")",
"!==",
"false",
")",
"{",
"$",
"bits",
"=",
"explode",
"(",
"'.'",
",",
"$",
"name",
",",
"2",
")",
";",
"$",
"bits",
"["... | transform the dot notation name into proper name
@param string Dot notation input name
@return string transformed name for input | [
"transform",
"the",
"dot",
"notation",
"name",
"into",
"proper",
"name"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L666-L675 |
22,037 | mikebarlow/html-helper | src/Helpers/Form.php | Form.transformNameForID | public function transformNameForID($name)
{
$bits = explode('.', $name);
array_walk(
$bits,
function (&$value, $key) {
$value = ucfirst(strtolower($value));
}
);
return implode('', $bits);
} | php | public function transformNameForID($name)
{
$bits = explode('.', $name);
array_walk(
$bits,
function (&$value, $key) {
$value = ucfirst(strtolower($value));
}
);
return implode('', $bits);
} | [
"public",
"function",
"transformNameForID",
"(",
"$",
"name",
")",
"{",
"$",
"bits",
"=",
"explode",
"(",
"'.'",
",",
"$",
"name",
")",
";",
"array_walk",
"(",
"$",
"bits",
",",
"function",
"(",
"&",
"$",
"value",
",",
"$",
"key",
")",
"{",
"$",
... | transform the dot notation name into a name for input ID
if no ID was passed
@param string Dot notation input name
@return string transformed name for input ID | [
"transform",
"the",
"dot",
"notation",
"name",
"into",
"a",
"name",
"for",
"input",
"ID",
"if",
"no",
"ID",
"was",
"passed"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L684-L694 |
22,038 | mikebarlow/html-helper | src/Helpers/Form.php | Form.getInjects | public function getInjects(&$attr)
{
$inject = array(
'before' => '',
'between' => '',
'after' => ''
);
if (! empty($attr['before'])) {
$inject['before'] = $attr['before'];
unset($attr['before']);
}
if (! empty($at... | php | public function getInjects(&$attr)
{
$inject = array(
'before' => '',
'between' => '',
'after' => ''
);
if (! empty($attr['before'])) {
$inject['before'] = $attr['before'];
unset($attr['before']);
}
if (! empty($at... | [
"public",
"function",
"getInjects",
"(",
"&",
"$",
"attr",
")",
"{",
"$",
"inject",
"=",
"array",
"(",
"'before'",
"=>",
"''",
",",
"'between'",
"=>",
"''",
",",
"'after'",
"=>",
"''",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"attr",
"[",
"'b... | get injections from the attributes
allows data to be entered before, between, after
@param array attributes array (Passed by reference)
@return array | [
"get",
"injections",
"from",
"the",
"attributes",
"allows",
"data",
"to",
"be",
"entered",
"before",
"between",
"after"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L703-L727 |
22,039 | mikebarlow/html-helper | src/Helpers/Form.php | Form.getWrapper | public function getWrapper($wrapper, $attr)
{
$type = '';
if (! empty($attr['type'])) {
$type = ' ' . $attr['type'];
if ((isset($attr['type']) && $attr['type'] == 'select') && in_array('multiple', $attr)) {
$type .= ' multiselect';
}
}
... | php | public function getWrapper($wrapper, $attr)
{
$type = '';
if (! empty($attr['type'])) {
$type = ' ' . $attr['type'];
if ((isset($attr['type']) && $attr['type'] == 'select') && in_array('multiple', $attr)) {
$type .= ' multiselect';
}
}
... | [
"public",
"function",
"getWrapper",
"(",
"$",
"wrapper",
",",
"$",
"attr",
")",
"{",
"$",
"type",
"=",
"''",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"attr",
"[",
"'type'",
"]",
")",
")",
"{",
"$",
"type",
"=",
"' '",
".",
"$",
"attr",
"[",
"'... | given any user defined wrapper instructions
build the wrapper data
@param array Array of any passed wrapper info
@param array Array of the inputs attributes
@return array two element array of tag / attr | [
"given",
"any",
"user",
"defined",
"wrapper",
"instructions",
"build",
"the",
"wrapper",
"data"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L737-L766 |
22,040 | mikebarlow/html-helper | src/Helpers/Form.php | Form.getData | public function getData($name, $attr)
{
if (empty($name)) {
return $attr;
}
$value = $this->Data->getValue($name);
if ($value !== null) {
$isCheckbox = (isset($attr['type']) && $attr['type'] == 'checkbox');
$isRadio = (isset($attr['type']) && $at... | php | public function getData($name, $attr)
{
if (empty($name)) {
return $attr;
}
$value = $this->Data->getValue($name);
if ($value !== null) {
$isCheckbox = (isset($attr['type']) && $attr['type'] == 'checkbox');
$isRadio = (isset($attr['type']) && $at... | [
"public",
"function",
"getData",
"(",
"$",
"name",
",",
"$",
"attr",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"attr",
";",
"}",
"$",
"value",
"=",
"$",
"this",
"->",
"Data",
"->",
"getValue",
"(",
"$",
"name... | use the Data interface and find any post data
@param string input name (dot notation for multi-dimensional array)
@param array Array of attributes for the tag
@return array Return the attribute array with added post data | [
"use",
"the",
"Data",
"interface",
"and",
"find",
"any",
"post",
"data"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L775-L800 |
22,041 | mikebarlow/html-helper | src/Helpers/Form.php | Form.setData | public function setData($Data)
{
if (! is_object($Data) || ! $Data instanceof Data) {
throw new \InvalidArgumentException(
'The Data Interface must be a valid Data Object'
);
}
$this->Data = $Data;
return true;
} | php | public function setData($Data)
{
if (! is_object($Data) || ! $Data instanceof Data) {
throw new \InvalidArgumentException(
'The Data Interface must be a valid Data Object'
);
}
$this->Data = $Data;
return true;
} | [
"public",
"function",
"setData",
"(",
"$",
"Data",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"Data",
")",
"||",
"!",
"$",
"Data",
"instanceof",
"Data",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The Data Interface must be a val... | check and set the form data interface
@param Object Instance of an Data Interface
@return bool
@throws \InvalidArgumentException | [
"check",
"and",
"set",
"the",
"form",
"data",
"interface"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L809-L819 |
22,042 | mikebarlow/html-helper | src/Helpers/Form.php | Form.setHtml | public function setHtml($Html)
{
if (! is_object($Html) || ! $Html instanceof HtmlObject) {
throw new \InvalidArgumentException(
'The HTML Object must be a valid HTML Object'
);
}
$this->Html = $Html;
return true;
} | php | public function setHtml($Html)
{
if (! is_object($Html) || ! $Html instanceof HtmlObject) {
throw new \InvalidArgumentException(
'The HTML Object must be a valid HTML Object'
);
}
$this->Html = $Html;
return true;
} | [
"public",
"function",
"setHtml",
"(",
"$",
"Html",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"Html",
")",
"||",
"!",
"$",
"Html",
"instanceof",
"HtmlObject",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The HTML Object must be a ... | check and set the HTML Object
@param Object Instance of an Html
@return bool
@throws \InvalidArgumentException | [
"check",
"and",
"set",
"the",
"HTML",
"Object"
] | d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65 | https://github.com/mikebarlow/html-helper/blob/d9d9dc3e92ba3ecd75f3a2e5a5bc2d23f38b5f65/src/Helpers/Form.php#L838-L848 |
22,043 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Twig/Writer/Twig.php | Twig.addExtensionsFromTemplateConfiguration | protected function addExtensionsFromTemplateConfiguration(
Transformation $transformation,
ProjectDescriptor $project,
\Twig_Environment $twigEnvironment
) {
$isDebug = $transformation->getParameter('twig-debug')
? $transformation->getParameter('twig-debug')->getValue()
... | php | protected function addExtensionsFromTemplateConfiguration(
Transformation $transformation,
ProjectDescriptor $project,
\Twig_Environment $twigEnvironment
) {
$isDebug = $transformation->getParameter('twig-debug')
? $transformation->getParameter('twig-debug')->getValue()
... | [
"protected",
"function",
"addExtensionsFromTemplateConfiguration",
"(",
"Transformation",
"$",
"transformation",
",",
"ProjectDescriptor",
"$",
"project",
",",
"\\",
"Twig_Environment",
"$",
"twigEnvironment",
")",
"{",
"$",
"isDebug",
"=",
"$",
"transformation",
"->",
... | Tries to add any custom extensions that have been defined in the template or the transformation's configuration.
This method will read the `twig-extension` parameter of the transformation (which inherits the template's
parameter set) and try to add those extensions to the environment.
@param Transformation $transf... | [
"Tries",
"to",
"add",
"any",
"custom",
"extensions",
"that",
"have",
"been",
"defined",
"in",
"the",
"template",
"or",
"the",
"transformation",
"s",
"configuration",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Twig/Writer/Twig.php#L199-L230 |
22,044 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/Twig/Writer/Twig.php | Twig.getDestinationPath | protected function getDestinationPath($node, Transformation $transformation)
{
$writer = $this;
if (!$node) {
throw new \UnexpectedValueException(
'The transformation node in the twig writer is not expected to be false or null'
);
}
if (!$tra... | php | protected function getDestinationPath($node, Transformation $transformation)
{
$writer = $this;
if (!$node) {
throw new \UnexpectedValueException(
'The transformation node in the twig writer is not expected to be false or null'
);
}
if (!$tra... | [
"protected",
"function",
"getDestinationPath",
"(",
"$",
"node",
",",
"Transformation",
"$",
"transformation",
")",
"{",
"$",
"writer",
"=",
"$",
"this",
";",
"if",
"(",
"!",
"$",
"node",
")",
"{",
"throw",
"new",
"\\",
"UnexpectedValueException",
"(",
"'T... | Uses the currently selected node and transformation to assemble the destination path for the file.
The Twig writer accepts the use of a Query to be able to generate output for multiple objects using the same
template.
The given node is the result of such a query, or if no query given the selected element, and the tra... | [
"Uses",
"the",
"currently",
"selected",
"node",
"and",
"transformation",
"to",
"assemble",
"the",
"destination",
"path",
"for",
"the",
"file",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Twig/Writer/Twig.php#L259-L319 |
22,045 | WScore/Validation | src/Filter/Sanitizers.php | Sanitizers.filter_sanitize | public function filter_sanitize($v, $p)
{
$option = Helper::arrGet($this->sanitizes, $p, $p);
$v->setValue(filter_var($v->getValue(), $option));
if ($p === 'int') {
if ((int)$v->getValue() !== (int)(float)$v->getValue()) {
$v->setValue('');
}
}... | php | public function filter_sanitize($v, $p)
{
$option = Helper::arrGet($this->sanitizes, $p, $p);
$v->setValue(filter_var($v->getValue(), $option));
if ($p === 'int') {
if ((int)$v->getValue() !== (int)(float)$v->getValue()) {
$v->setValue('');
}
}... | [
"public",
"function",
"filter_sanitize",
"(",
"$",
"v",
",",
"$",
"p",
")",
"{",
"$",
"option",
"=",
"Helper",
"::",
"arrGet",
"(",
"$",
"this",
"->",
"sanitizes",
",",
"$",
"p",
",",
"$",
"p",
")",
";",
"$",
"v",
"->",
"setValue",
"(",
"filter_v... | sanitize the value using filter_var.
@param ValueTO $v
@param $p | [
"sanitize",
"the",
"value",
"using",
"filter_var",
"."
] | 25c0dca37d624bb0bb22f8e79ba54db2f69e0950 | https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Filter/Sanitizers.php#L49-L58 |
22,046 | WScore/Validation | src/Filter/Sanitizers.php | Sanitizers.filter_datetime | public function filter_datetime($v, $p)
{
if (is_bool($p) && $p) {
$p = 'Y-m-d H:i:s';
}
$dt = \date_create_from_format($p, $v->getValue());
if (!$dt) {
$v->setValue(null);
$v->setError(__METHOD__, $p);
return;
}
$v->set... | php | public function filter_datetime($v, $p)
{
if (is_bool($p) && $p) {
$p = 'Y-m-d H:i:s';
}
$dt = \date_create_from_format($p, $v->getValue());
if (!$dt) {
$v->setValue(null);
$v->setError(__METHOD__, $p);
return;
}
$v->set... | [
"public",
"function",
"filter_datetime",
"(",
"$",
"v",
",",
"$",
"p",
")",
"{",
"if",
"(",
"is_bool",
"(",
"$",
"p",
")",
"&&",
"$",
"p",
")",
"{",
"$",
"p",
"=",
"'Y-m-d H:i:s'",
";",
"}",
"$",
"dt",
"=",
"\\",
"date_create_from_format",
"(",
"... | check for valid date-time input string.
@param ValueTO $v
@param bool|string $p | [
"check",
"for",
"valid",
"date",
"-",
"time",
"input",
"string",
"."
] | 25c0dca37d624bb0bb22f8e79ba54db2f69e0950 | https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Filter/Sanitizers.php#L66-L78 |
22,047 | ttreeagency/Taxonomy | Classes/Command/TaxonomyCommandController.php | TaxonomyCommandController.showMappingCommand | public function showMappingCommand(string $node)
{
foreach ($this->contentDimensionCombinator->getAllAllowedCombinations() as $dimensions) {
$context = $this->createContentContext('live', $dimensions);
$siteNode = $context->getNodeByIdentifier($node);
$taxonomyNodes = (ne... | php | public function showMappingCommand(string $node)
{
foreach ($this->contentDimensionCombinator->getAllAllowedCombinations() as $dimensions) {
$context = $this->createContentContext('live', $dimensions);
$siteNode = $context->getNodeByIdentifier($node);
$taxonomyNodes = (ne... | [
"public",
"function",
"showMappingCommand",
"(",
"string",
"$",
"node",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"contentDimensionCombinator",
"->",
"getAllAllowedCombinations",
"(",
")",
"as",
"$",
"dimensions",
")",
"{",
"$",
"context",
"=",
"$",
"this",... | Show ElasticSearch filters and analyzers | [
"Show",
"ElasticSearch",
"filters",
"and",
"analyzers"
] | 9e94e2863a722bbdb1dcbdc34afbda1e1e10b4c9 | https://github.com/ttreeagency/Taxonomy/blob/9e94e2863a722bbdb1dcbdc34afbda1e1e10b4c9/Classes/Command/TaxonomyCommandController.php#L37-L65 |
22,048 | creolab/resources | src/Item.php | Item.toArray | public function toArray()
{
$this->data = $this->transformer->transformBack($this->data);
return $this->data;
} | php | public function toArray()
{
$this->data = $this->transformer->transformBack($this->data);
return $this->data;
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"$",
"this",
"->",
"transformer",
"->",
"transformBack",
"(",
"$",
"this",
"->",
"data",
")",
";",
"return",
"$",
"this",
"->",
"data",
";",
"}"
] | Return array representation of item
@return array | [
"Return",
"array",
"representation",
"of",
"item"
] | 6e1bdd266aa373f6dafd2408b230f7d2fa05a637 | https://github.com/creolab/resources/blob/6e1bdd266aa373f6dafd2408b230f7d2fa05a637/src/Item.php#L68-L73 |
22,049 | ekuiter/feature-php | FeaturePhp/Helper/XmlParser.php | XmlParser.validate | public function validate($schemaFile) {
if (!$this->xmlString)
throw new XmlParserException("attempting to validate before parsing");
if (!extension_loaded("DOM")) {
trigger_error("DOM extension not loaded, will not validate XML", E_USER_NOTICE);
return $... | php | public function validate($schemaFile) {
if (!$this->xmlString)
throw new XmlParserException("attempting to validate before parsing");
if (!extension_loaded("DOM")) {
trigger_error("DOM extension not loaded, will not validate XML", E_USER_NOTICE);
return $... | [
"public",
"function",
"validate",
"(",
"$",
"schemaFile",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"xmlString",
")",
"throw",
"new",
"XmlParserException",
"(",
"\"attempting to validate before parsing\"",
")",
";",
"if",
"(",
"!",
"extension_loaded",
"(",
... | Validates XML using a schema.
@param string $schemaFile
@return XmlParser | [
"Validates",
"XML",
"using",
"a",
"schema",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/XmlParser.php#L86-L107 |
22,050 | ekuiter/feature-php | FeaturePhp/Helper/XmlParser.php | XmlParser.get | public static function get($node, $tagName, $count = 1) {
$node = $node->{$tagName};
if ($node->count() !== $count)
throw new XmlParserException("xml does not have exactly $count $tagName's");
return $node[0];
} | php | public static function get($node, $tagName, $count = 1) {
$node = $node->{$tagName};
if ($node->count() !== $count)
throw new XmlParserException("xml does not have exactly $count $tagName's");
return $node[0];
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"node",
",",
"$",
"tagName",
",",
"$",
"count",
"=",
"1",
")",
"{",
"$",
"node",
"=",
"$",
"node",
"->",
"{",
"$",
"tagName",
"}",
";",
"if",
"(",
"$",
"node",
"->",
"count",
"(",
")",
"!==",
"... | Returns a child node for a tag name from an XML node.
@param \SimpleXMLElement $node
@param string $tagName
@param int $count how many child nodes for the tag name are allowed
@return \SimpleXMLElement | [
"Returns",
"a",
"child",
"node",
"for",
"a",
"tag",
"name",
"from",
"an",
"XML",
"node",
"."
] | daf4a59098802fedcfd1f1a1d07847fcf2fea7bf | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/XmlParser.php#L116-L121 |
22,051 | leoshtika/database | src/Mysql.php | Mysql.connect | public static function connect($mysqlConfig)
{
$dbConfig = array(
'dsn' => 'mysql:dbname=' . $mysqlConfig['dbname'] . ';host=' . $mysqlConfig['host'],
'user' => $mysqlConfig['user'],
'pass' => $mysqlConfig['pass'],
'options' => array(PDO::MYSQL_ATTR_INIT_COMMA... | php | public static function connect($mysqlConfig)
{
$dbConfig = array(
'dsn' => 'mysql:dbname=' . $mysqlConfig['dbname'] . ';host=' . $mysqlConfig['host'],
'user' => $mysqlConfig['user'],
'pass' => $mysqlConfig['pass'],
'options' => array(PDO::MYSQL_ATTR_INIT_COMMA... | [
"public",
"static",
"function",
"connect",
"(",
"$",
"mysqlConfig",
")",
"{",
"$",
"dbConfig",
"=",
"array",
"(",
"'dsn'",
"=>",
"'mysql:dbname='",
".",
"$",
"mysqlConfig",
"[",
"'dbname'",
"]",
".",
"';host='",
".",
"$",
"mysqlConfig",
"[",
"'host'",
"]",... | Returns a PDO instance
@param array $mysqlConfig
@return PDO | [
"Returns",
"a",
"PDO",
"instance"
] | a8a82cb6b16eb97caf8b583506c0e08ab944f761 | https://github.com/leoshtika/database/blob/a8a82cb6b16eb97caf8b583506c0e08ab944f761/src/Mysql.php#L27-L37 |
22,052 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php | ezcDbSchemaPersistentWriter.writeField | private function writeField( $file, $fieldName, $field, $isPrimary )
{
fwrite( $file, "\n" );
if ( $isPrimary )
{
fwrite( $file, "\$def->idProperty = new ezcPersistentObjectIdProperty();\n" );
fwrite( $file, "\$def->idProperty->columnName = '$fieldName... | php | private function writeField( $file, $fieldName, $field, $isPrimary )
{
fwrite( $file, "\n" );
if ( $isPrimary )
{
fwrite( $file, "\$def->idProperty = new ezcPersistentObjectIdProperty();\n" );
fwrite( $file, "\$def->idProperty->columnName = '$fieldName... | [
"private",
"function",
"writeField",
"(",
"$",
"file",
",",
"$",
"fieldName",
",",
"$",
"field",
",",
"$",
"isPrimary",
")",
"{",
"fwrite",
"(",
"$",
"file",
",",
"\"\\n\"",
")",
";",
"if",
"(",
"$",
"isPrimary",
")",
"{",
"fwrite",
"(",
"$",
"file... | Write a field of the schema to the PersistentObject definition.
This method writes a database field to the PersistentObject definition
file.
@param resource(file) $file The file to write to.
@param string $fieldName The name of the field.
@param ezcDbSchemaField $field The field object.
@param bool $isPrimary... | [
"Write",
"a",
"field",
"of",
"the",
"schema",
"to",
"the",
"PersistentObject",
"definition",
".",
"This",
"method",
"writes",
"a",
"database",
"field",
"to",
"the",
"PersistentObject",
"definition",
"file",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php#L102-L128 |
22,053 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php | ezcDbSchemaPersistentWriter.writeTable | private function writeTable( $dir, $tableName, ezcDbSchemaTable $table )
{
$file = $this->openFile( $dir, $tableName );
fwrite( $file, "\$def = new ezcPersistentObjectDefinition();\n" );
fwrite( $file, "\$def->table = '$tableName';\n" );
fwrite( $file, "\$def->class = '{$this->prefi... | php | private function writeTable( $dir, $tableName, ezcDbSchemaTable $table )
{
$file = $this->openFile( $dir, $tableName );
fwrite( $file, "\$def = new ezcPersistentObjectDefinition();\n" );
fwrite( $file, "\$def->table = '$tableName';\n" );
fwrite( $file, "\$def->class = '{$this->prefi... | [
"private",
"function",
"writeTable",
"(",
"$",
"dir",
",",
"$",
"tableName",
",",
"ezcDbSchemaTable",
"$",
"table",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"openFile",
"(",
"$",
"dir",
",",
"$",
"tableName",
")",
";",
"fwrite",
"(",
"$",
"file... | Writes the PersistentObject defintion for a table.
This method writes the PersistentObject definition for a single database
table. It creates a new file in the given directory, named in the format
<table_name>.php, writes the start of the definition to it and calls the
{@link ezcDbschemaPersistentWriter::writeField()}... | [
"Writes",
"the",
"PersistentObject",
"defintion",
"for",
"a",
"table",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php#L181-L197 |
22,054 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php | ezcDbSchemaPersistentWriter.closeFile | private function closeFile( $file )
{
fwrite( $file, "return \$def;\n" );
fwrite( $file, "\n" );
fwrite( $file, "?>\n" );
fclose( $file );
} | php | private function closeFile( $file )
{
fwrite( $file, "return \$def;\n" );
fwrite( $file, "\n" );
fwrite( $file, "?>\n" );
fclose( $file );
} | [
"private",
"function",
"closeFile",
"(",
"$",
"file",
")",
"{",
"fwrite",
"(",
"$",
"file",
",",
"\"return \\$def;\\n\"",
")",
";",
"fwrite",
"(",
"$",
"file",
",",
"\"\\n\"",
")",
";",
"fwrite",
"(",
"$",
"file",
",",
"\"?>\\n\"",
")",
";",
"fclose",
... | Close a file where a PersistentObject definition has been written to.
This method closes a file after writing a PersistentObject definition to
it and writes the PHP closing tag to it.
@param resource(file) $file The file resource to close.
@return void | [
"Close",
"a",
"file",
"where",
"a",
"PersistentObject",
"definition",
"has",
"been",
"written",
"to",
".",
"This",
"method",
"closes",
"a",
"file",
"after",
"writing",
"a",
"PersistentObject",
"definition",
"to",
"it",
"and",
"writes",
"the",
"PHP",
"closing",... | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php#L240-L246 |
22,055 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php | ezcDbSchemaPersistentWriter.determinePrimaries | private function determinePrimaries( $indexes )
{
$primaries = array();
foreach ( $indexes as $index )
{
if ( $index->primary )
{
foreach ( $index->indexFields as $field => $definiton )
{
$primaries[$field] = true;
... | php | private function determinePrimaries( $indexes )
{
$primaries = array();
foreach ( $indexes as $index )
{
if ( $index->primary )
{
foreach ( $index->indexFields as $field => $definiton )
{
$primaries[$field] = true;
... | [
"private",
"function",
"determinePrimaries",
"(",
"$",
"indexes",
")",
"{",
"$",
"primaries",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"indexes",
"as",
"$",
"index",
")",
"{",
"if",
"(",
"$",
"index",
"->",
"primary",
")",
"{",
"foreach",
"(... | Extract primary keys from an index definition.
This method extracts the names of all primary keys from the index
defintions of a table.
@param array(string=>ezcDbSchemaIndex) $indexes Indices.
@return array(string=>bool) The primary keys. | [
"Extract",
"primary",
"keys",
"from",
"an",
"index",
"definition",
".",
"This",
"method",
"extracts",
"the",
"names",
"of",
"all",
"primary",
"keys",
"from",
"the",
"index",
"defintions",
"of",
"a",
"table",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php#L256-L270 |
22,056 | tttptd/laravel-responder | src/Console/MakeTransformer.php | MakeTransformer.generateTransformer | protected function generateTransformer()
{
$name = (string) $this->argument('name');
$path = $this->laravel->basePath() . '/app/Transformers/' . $name . '.php';
if ($this->files->exists($path)) {
return $this->error($name . ' already exists!');
}
$this->makeDire... | php | protected function generateTransformer()
{
$name = (string) $this->argument('name');
$path = $this->laravel->basePath() . '/app/Transformers/' . $name . '.php';
if ($this->files->exists($path)) {
return $this->error($name . ' already exists!');
}
$this->makeDire... | [
"protected",
"function",
"generateTransformer",
"(",
")",
"{",
"$",
"name",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"argument",
"(",
"'name'",
")",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"laravel",
"->",
"basePath",
"(",
")",
".",
"'/app/Transfo... | Generate the transformer class.
@return void | [
"Generate",
"the",
"transformer",
"class",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Console/MakeTransformer.php#L68-L85 |
22,057 | tttptd/laravel-responder | src/Console/MakeTransformer.php | MakeTransformer.makeTransformer | protected function makeTransformer(string $name, string $stub):string
{
$stub = $this->replaceNamespace($stub);
$stub = $this->replaceClass($stub, $name);
$stub = $this->replaceModel($stub, $name);
return $stub;
} | php | protected function makeTransformer(string $name, string $stub):string
{
$stub = $this->replaceNamespace($stub);
$stub = $this->replaceClass($stub, $name);
$stub = $this->replaceModel($stub, $name);
return $stub;
} | [
"protected",
"function",
"makeTransformer",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"stub",
")",
":",
"string",
"{",
"$",
"stub",
"=",
"$",
"this",
"->",
"replaceNamespace",
"(",
"$",
"stub",
")",
";",
"$",
"stub",
"=",
"$",
"this",
"->",
"re... | Build the transformer class using the given name and stub.
@param string $name
@param string $stub
@return string | [
"Build",
"the",
"transformer",
"class",
"using",
"the",
"given",
"name",
"and",
"stub",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Console/MakeTransformer.php#L107-L114 |
22,058 | tttptd/laravel-responder | src/Console/MakeTransformer.php | MakeTransformer.getModelNamespace | protected function getModelNamespace(string $name):string
{
if ($this->option('model')) {
return $this->option('model');
}
return 'App\\' . str_replace('Transformer', '', $name);
} | php | protected function getModelNamespace(string $name):string
{
if ($this->option('model')) {
return $this->option('model');
}
return 'App\\' . str_replace('Transformer', '', $name);
} | [
"protected",
"function",
"getModelNamespace",
"(",
"string",
"$",
"name",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"option",
"(",
"'model'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"option",
"(",
"'model'",
")",
";",
"}",
"return",
... | Get the full class path for the model.
@param string $name
@return string | [
"Get",
"the",
"full",
"class",
"path",
"for",
"the",
"model",
"."
] | 0e4a32701f0de755c1f1af458045829e1bd6caf6 | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Console/MakeTransformer.php#L174-L181 |
22,059 | NuclearCMS/Hierarchy | src/Support/LocaleManager.php | LocaleManager.setAppLocale | public function setAppLocale($locale = null, $session = true)
{
$locale = $locale ?: $this->session->get('_locale', null);
if ($locale)
{
$this->app->setLocale($locale);
if ($session)
{
$this->session->put('_locale', $locale);
... | php | public function setAppLocale($locale = null, $session = true)
{
$locale = $locale ?: $this->session->get('_locale', null);
if ($locale)
{
$this->app->setLocale($locale);
if ($session)
{
$this->session->put('_locale', $locale);
... | [
"public",
"function",
"setAppLocale",
"(",
"$",
"locale",
"=",
"null",
",",
"$",
"session",
"=",
"true",
")",
"{",
"$",
"locale",
"=",
"$",
"locale",
"?",
":",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"'_locale'",
",",
"null",
")",
";",
"if"... | Sets the app locale
@param string $locale
@param bool $session
@return void | [
"Sets",
"the",
"app",
"locale"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/LocaleManager.php#L43-L58 |
22,060 | NuclearCMS/Hierarchy | src/Support/LocaleManager.php | LocaleManager.setTimeLocale | public function setTimeLocale($locale = null)
{
$locale = $locale ?: $this->session->get('_locale', $this->app->getLocale());
setlocale(LC_TIME, $this->config->get('translatable.full_locales.' . $locale, null));
Carbon::setLocale($locale);
} | php | public function setTimeLocale($locale = null)
{
$locale = $locale ?: $this->session->get('_locale', $this->app->getLocale());
setlocale(LC_TIME, $this->config->get('translatable.full_locales.' . $locale, null));
Carbon::setLocale($locale);
} | [
"public",
"function",
"setTimeLocale",
"(",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"locale",
"=",
"$",
"locale",
"?",
":",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"'_locale'",
",",
"$",
"this",
"->",
"app",
"->",
"getLocale",
"(",
")",
... | Sets the time locale
@param string $locale
@return void | [
"Sets",
"the",
"time",
"locale"
] | 535171c5e2db72265313fd2110aec8456e46f459 | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/LocaleManager.php#L66-L73 |
22,061 | surebert/surebert-framework | src/sb/Files/ForceDownload.php | ForceDownload.send | public static function send($file, $display_file_name = '', $seekat=0)
{
$display_file_name = $display_file_name ? $display_file_name : basename($file);
$display_file_name = str_replace(" ", "_", $display_file_name);
header("HTTP/1.1 200 OK");
header("Status: 200 OK");
header... | php | public static function send($file, $display_file_name = '', $seekat=0)
{
$display_file_name = $display_file_name ? $display_file_name : basename($file);
$display_file_name = str_replace(" ", "_", $display_file_name);
header("HTTP/1.1 200 OK");
header("Status: 200 OK");
header... | [
"public",
"static",
"function",
"send",
"(",
"$",
"file",
",",
"$",
"display_file_name",
"=",
"''",
",",
"$",
"seekat",
"=",
"0",
")",
"{",
"$",
"display_file_name",
"=",
"$",
"display_file_name",
"?",
"$",
"display_file_name",
":",
"basename",
"(",
"$",
... | Send headers and begins force-download
@param string $file The path to the file to force download
@param string $display_file_name The filename to give to the
@param int $seekat Where to start in file stream
force download if different than the basename of the file arg | [
"Send",
"headers",
"and",
"begins",
"force",
"-",
"download"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Files/ForceDownload.php#L23-L40 |
22,062 | surebert/surebert-framework | src/sb/Files/ForceDownload.php | ForceDownload.fileToZip | public static function fileToZip($path)
{
if (is_file($path) || is_dir($path)) {
$zip = new \ZipArchive;
$zip_file = ROOT . '/private/cache/zip/' . md5(microtime(true));
if (!is_dir(dirname($zip_file))) {
mkdir(dirname($zip_file), 0775, true);
... | php | public static function fileToZip($path)
{
if (is_file($path) || is_dir($path)) {
$zip = new \ZipArchive;
$zip_file = ROOT . '/private/cache/zip/' . md5(microtime(true));
if (!is_dir(dirname($zip_file))) {
mkdir(dirname($zip_file), 0775, true);
... | [
"public",
"static",
"function",
"fileToZip",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"path",
")",
"||",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"$",
"zip",
"=",
"new",
"\\",
"ZipArchive",
";",
"$",
"zip_file",
"=",
"ROOT",
... | Converts a file or directory into a zip file for consumption by the browser
@param string $path The path to the file or directory
@return string | [
"Converts",
"a",
"file",
"or",
"directory",
"into",
"a",
"zip",
"file",
"for",
"consumption",
"by",
"the",
"browser"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Files/ForceDownload.php#L47-L80 |
22,063 | david-mk/mail-map | src/MailMap/Connection.php | Connection.search | public function search($search = '', $criteria = SORTDATE, $opt = SE_UID, $dir = 1)
{
if ('' === ($search = trim($search))) {
$search = null;
}
return imap_sort($this->stream, $criteria, $dir, $opt, $search);
} | php | public function search($search = '', $criteria = SORTDATE, $opt = SE_UID, $dir = 1)
{
if ('' === ($search = trim($search))) {
$search = null;
}
return imap_sort($this->stream, $criteria, $dir, $opt, $search);
} | [
"public",
"function",
"search",
"(",
"$",
"search",
"=",
"''",
",",
"$",
"criteria",
"=",
"SORTDATE",
",",
"$",
"opt",
"=",
"SE_UID",
",",
"$",
"dir",
"=",
"1",
")",
"{",
"if",
"(",
"''",
"===",
"(",
"$",
"search",
"=",
"trim",
"(",
"$",
"searc... | Search mailbox for emails
@param string $search Search string as specified in http://php.net/manual/en/function.imap-search.php
@param int $criteria Sort flag from http://php.net/manual/en/function.imap-sort.php
@param int $opt Options flags from http://php.net/manual/en/function.imap-sort.php
@param int $dir Reve... | [
"Search",
"mailbox",
"for",
"emails"
] | 4eea346ece9fa35c0d309b5a909f657ad83e1e6a | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/Connection.php#L45-L52 |
22,064 | glynnforrest/blockade | src/Blockade/Exception/BlockadeException.php | BlockadeException.from | public static function from(DriverInterface $driver, $message = '', $code = 0, \Exception $previous = null)
{
//make sure that empty arguments don't get passed to exceptions as
//they have default messages and codes.
$self = $message ? ($code ? new static($message, $code, $previous) : new st... | php | public static function from(DriverInterface $driver, $message = '', $code = 0, \Exception $previous = null)
{
//make sure that empty arguments don't get passed to exceptions as
//they have default messages and codes.
$self = $message ? ($code ? new static($message, $code, $previous) : new st... | [
"public",
"static",
"function",
"from",
"(",
"DriverInterface",
"$",
"driver",
",",
"$",
"message",
"=",
"''",
",",
"$",
"code",
"=",
"0",
",",
"\\",
"Exception",
"$",
"previous",
"=",
"null",
")",
"{",
"//make sure that empty arguments don't get passed to excep... | Factory method to set the driver that created this exception.
@param DriverInterface $driver The driver | [
"Factory",
"method",
"to",
"set",
"the",
"driver",
"that",
"created",
"this",
"exception",
"."
] | 5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b | https://github.com/glynnforrest/blockade/blob/5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b/src/Blockade/Exception/BlockadeException.php#L21-L30 |
22,065 | songshenzong/log | src/DebugBar.php | DebugBar.initStackSession | protected function initStackSession()
{
$http = $this->getHttpDriver();
if (!$http->isSessionStarted()) {
throw new DebugBarException('Session must be started before using stack data in the songshenzong');
}
if (!$http->hasSessionValue($this->stackSessionNamespace)) {
... | php | protected function initStackSession()
{
$http = $this->getHttpDriver();
if (!$http->isSessionStarted()) {
throw new DebugBarException('Session must be started before using stack data in the songshenzong');
}
if (!$http->hasSessionValue($this->stackSessionNamespace)) {
... | [
"protected",
"function",
"initStackSession",
"(",
")",
"{",
"$",
"http",
"=",
"$",
"this",
"->",
"getHttpDriver",
"(",
")",
";",
"if",
"(",
"!",
"$",
"http",
"->",
"isSessionStarted",
"(",
")",
")",
"{",
"throw",
"new",
"DebugBarException",
"(",
"'Sessio... | Initializes the session for stacked data
@return HttpDriverInterface
@throws DebugBarException | [
"Initializes",
"the",
"session",
"for",
"stacked",
"data"
] | b1e01f7994da47737866eabf82367490eab17c46 | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DebugBar.php#L252-L264 |
22,066 | heidelpay/PhpDoc | src/phpDocumentor/Plugin/LegacyNamespaceConverter/ServiceProvider.php | ServiceProvider.addNamespaceFilter | private function addNamespaceFilter(ProjectDescriptorBuilder $builder, Filter $filterManager)
{
$filter = new LegacyNamespaceFilter($builder);
// parse parameters
foreach ($this->plugin->getParameters() as $param) {
if ($param->getKey() == 'NamespacePrefix') {
$f... | php | private function addNamespaceFilter(ProjectDescriptorBuilder $builder, Filter $filterManager)
{
$filter = new LegacyNamespaceFilter($builder);
// parse parameters
foreach ($this->plugin->getParameters() as $param) {
if ($param->getKey() == 'NamespacePrefix') {
$f... | [
"private",
"function",
"addNamespaceFilter",
"(",
"ProjectDescriptorBuilder",
"$",
"builder",
",",
"Filter",
"$",
"filterManager",
")",
"{",
"$",
"filter",
"=",
"new",
"LegacyNamespaceFilter",
"(",
"$",
"builder",
")",
";",
"// parse parameters",
"foreach",
"(",
"... | Attaches the filter responsible for the conversion to all structural elements.
@param ProjectDescriptorBuilder $builder
@param Filter $filterManager
@return void | [
"Attaches",
"the",
"filter",
"responsible",
"for",
"the",
"conversion",
"to",
"all",
"structural",
"elements",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/LegacyNamespaceConverter/ServiceProvider.php#L67-L85 |
22,067 | hametuha/wpametu | src/WPametu/Http/PostRedirectGet.php | PostRedirectGet.writeSession | private function writeSession($message, $from = '', $is_error = false){
if( session_id() ){
$key = $is_error ? $this->error_key : $this->message_key;
// Initialize
if( !isset($_SESSION[$key]) || !is_array($_SESSION[$key]) ){
$_SESSION[$key] = [];
}... | php | private function writeSession($message, $from = '', $is_error = false){
if( session_id() ){
$key = $is_error ? $this->error_key : $this->message_key;
// Initialize
if( !isset($_SESSION[$key]) || !is_array($_SESSION[$key]) ){
$_SESSION[$key] = [];
}... | [
"private",
"function",
"writeSession",
"(",
"$",
"message",
",",
"$",
"from",
"=",
"''",
",",
"$",
"is_error",
"=",
"false",
")",
"{",
"if",
"(",
"session_id",
"(",
")",
")",
"{",
"$",
"key",
"=",
"$",
"is_error",
"?",
"$",
"this",
"->",
"error_key... | Write message to session
@param $message
@param string $from
@param bool $is_error | [
"Write",
"message",
"to",
"session"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Http/PostRedirectGet.php#L105-L115 |
22,068 | hametuha/wpametu | src/WPametu/Http/PostRedirectGet.php | PostRedirectGet.flushMessage | public function flushMessage(){
if( session_id() ){
foreach( [ $this->error_key => 'error', $this->message_key => 'updated' ] as $key => $class_name ){
if( isset($_SESSION[$key]) && !empty($_SESSION[$key]) ){
$markup = sprintf('<div class="%s"><p>%s</p></div>', $c... | php | public function flushMessage(){
if( session_id() ){
foreach( [ $this->error_key => 'error', $this->message_key => 'updated' ] as $key => $class_name ){
if( isset($_SESSION[$key]) && !empty($_SESSION[$key]) ){
$markup = sprintf('<div class="%s"><p>%s</p></div>', $c... | [
"public",
"function",
"flushMessage",
"(",
")",
"{",
"if",
"(",
"session_id",
"(",
")",
")",
"{",
"foreach",
"(",
"[",
"$",
"this",
"->",
"error_key",
"=>",
"'error'",
",",
"$",
"this",
"->",
"message_key",
"=>",
"'updated'",
"]",
"as",
"$",
"key",
"... | Show message on screen | [
"Show",
"message",
"on",
"screen"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Http/PostRedirectGet.php#L120-L143 |
22,069 | WScore/Validation | src/Utils/HelperMultiple.php | HelperMultiple.prepare | public static function prepare($name, $source, $option)
{
// get options.
if (is_string($option)) {
$option = (array) Helper::arrGet(self::$multiples, $option, array());
}
$lists = self::find_multiple($name, $source, $option);
$found = self::merge_multiple($option... | php | public static function prepare($name, $source, $option)
{
// get options.
if (is_string($option)) {
$option = (array) Helper::arrGet(self::$multiples, $option, array());
}
$lists = self::find_multiple($name, $source, $option);
$found = self::merge_multiple($option... | [
"public",
"static",
"function",
"prepare",
"(",
"$",
"name",
",",
"$",
"source",
",",
"$",
"option",
")",
"{",
"// get options.",
"if",
"(",
"is_string",
"(",
"$",
"option",
")",
")",
"{",
"$",
"option",
"=",
"(",
"array",
")",
"Helper",
"::",
"arrGe... | prepares for validation by creating a value from multiple value.
@param string $name
@param array $source
@param string|array $option
@return mixed|null|string | [
"prepares",
"for",
"validation",
"by",
"creating",
"a",
"value",
"from",
"multiple",
"value",
"."
] | 25c0dca37d624bb0bb22f8e79ba54db2f69e0950 | https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Utils/HelperMultiple.php#L33-L44 |
22,070 | WScore/Validation | src/Utils/HelperMultiple.php | HelperMultiple.find_multiple | private static function find_multiple($name, $source, $option)
{
$sep = Helper::arrGet($option, 'separator', '_');
$suffix = explode(',', $option['suffix']);
$lists = [];
foreach ($suffix as $sfx) {
$name_sfx = $name . $sep . $sfx;
if (array_key_exists($na... | php | private static function find_multiple($name, $source, $option)
{
$sep = Helper::arrGet($option, 'separator', '_');
$suffix = explode(',', $option['suffix']);
$lists = [];
foreach ($suffix as $sfx) {
$name_sfx = $name . $sep . $sfx;
if (array_key_exists($na... | [
"private",
"static",
"function",
"find_multiple",
"(",
"$",
"name",
",",
"$",
"source",
",",
"$",
"option",
")",
"{",
"$",
"sep",
"=",
"Helper",
"::",
"arrGet",
"(",
"$",
"option",
",",
"'separator'",
",",
"'_'",
")",
";",
"$",
"suffix",
"=",
"explod... | find multiples values from suffix list.
@param string $name
@param array $source
@param array $option
@return array | [
"find",
"multiples",
"values",
"from",
"suffix",
"list",
"."
] | 25c0dca37d624bb0bb22f8e79ba54db2f69e0950 | https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Utils/HelperMultiple.php#L54-L67 |
22,071 | WScore/Validation | src/Utils/HelperMultiple.php | HelperMultiple.merge_multiple | private static function merge_multiple($option, $lists)
{
if (empty($lists)) {
return null;
}
// found format using sprintf.
if (isset($option['format'])) {
$param = array_merge(array($option['format']), $lists);
$found = call_user_func_array('spri... | php | private static function merge_multiple($option, $lists)
{
if (empty($lists)) {
return null;
}
// found format using sprintf.
if (isset($option['format'])) {
$param = array_merge(array($option['format']), $lists);
$found = call_user_func_array('spri... | [
"private",
"static",
"function",
"merge_multiple",
"(",
"$",
"option",
",",
"$",
"lists",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"lists",
")",
")",
"{",
"return",
"null",
";",
"}",
"// found format using sprintf.",
"if",
"(",
"isset",
"(",
"$",
"option"... | merge the found list into one value.
@param array $option
@param array $lists
@return mixed|null|string | [
"merge",
"the",
"found",
"list",
"into",
"one",
"value",
"."
] | 25c0dca37d624bb0bb22f8e79ba54db2f69e0950 | https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Utils/HelperMultiple.php#L76-L91 |
22,072 | nabab/bbn | src/bbn/appui/menus.php | menus.to_path | public function to_path(string $id){
if ( bbn\str::is_uid($id) ){
return $this->options->to_path($id, '', $this->_get_public_root());
}
return false;
} | php | public function to_path(string $id){
if ( bbn\str::is_uid($id) ){
return $this->options->to_path($id, '', $this->_get_public_root());
}
return false;
} | [
"public",
"function",
"to_path",
"(",
"string",
"$",
"id",
")",
"{",
"if",
"(",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"options",
"->",
"to_path",
"(",
"$",
"id",
",",
"''",
",",
"$",
"th... | Returns the path corresponding to an ID
@param string $id
@return int|boolean | [
"Returns",
"the",
"path",
"corresponding",
"to",
"an",
"ID"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L160-L165 |
22,073 | nabab/bbn | src/bbn/appui/menus.php | menus.add_shortcut | public function add_shortcut(string $id): ?string
{
if (
($bit = $this->pref->get_bit($id, false)) &&
($id_option = $this->from_path('shortcuts')) &&
($c = $this->pref->get_class_cfg())
){
if ( $id_menu = $this->pref->get_by_option($id_option) ){
$id_menu = $id_menu[$c['arch'][... | php | public function add_shortcut(string $id): ?string
{
if (
($bit = $this->pref->get_bit($id, false)) &&
($id_option = $this->from_path('shortcuts')) &&
($c = $this->pref->get_class_cfg())
){
if ( $id_menu = $this->pref->get_by_option($id_option) ){
$id_menu = $id_menu[$c['arch'][... | [
"public",
"function",
"add_shortcut",
"(",
"string",
"$",
"id",
")",
":",
"?",
"string",
"{",
"if",
"(",
"(",
"$",
"bit",
"=",
"$",
"this",
"->",
"pref",
"->",
"get_bit",
"(",
"$",
"id",
",",
"false",
")",
")",
"&&",
"(",
"$",
"id_option",
"=",
... | Adds an user'shortcut from a menu
@param string $id The menu item's ID to link
@return string|null | [
"Adds",
"an",
"user",
"shortcut",
"from",
"a",
"menu"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L191-L223 |
22,074 | nabab/bbn | src/bbn/appui/menus.php | menus.remove_shortcut | public function remove_shortcut($id): ?int
{
if ( \bbn\str::is_uid($id) ){
return $this->pref->delete_bit($id);
}
return null;
} | php | public function remove_shortcut($id): ?int
{
if ( \bbn\str::is_uid($id) ){
return $this->pref->delete_bit($id);
}
return null;
} | [
"public",
"function",
"remove_shortcut",
"(",
"$",
"id",
")",
":",
"?",
"int",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"pref",
"->",
"delete_bit",
"(",
"$",
"id",
")",
... | Removes an user'shortcut
@param string $id The shortcut's ID
@return null|int | [
"Removes",
"an",
"user",
"shortcut"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L231-L237 |
22,075 | nabab/bbn | src/bbn/appui/menus.php | menus.shortcuts | public function shortcuts(): ?array
{
if (
($id_option = $this->from_path('shortcuts')) &&
($menu = $this->pref->get_by_option($id_option))
){
$links = $this->pref->get_bits($menu['id']);
$res = [];
foreach ( $links as $link ){
if ( ($url = $this->to_path($link['id_option... | php | public function shortcuts(): ?array
{
if (
($id_option = $this->from_path('shortcuts')) &&
($menu = $this->pref->get_by_option($id_option))
){
$links = $this->pref->get_bits($menu['id']);
$res = [];
foreach ( $links as $link ){
if ( ($url = $this->to_path($link['id_option... | [
"public",
"function",
"shortcuts",
"(",
")",
":",
"?",
"array",
"{",
"if",
"(",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"from_path",
"(",
"'shortcuts'",
")",
")",
"&&",
"(",
"$",
"menu",
"=",
"$",
"this",
"->",
"pref",
"->",
"get_by_option",
... | Gets the user' shortcuts list
@return null|array | [
"Gets",
"the",
"user",
"shortcuts",
"list"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L244-L267 |
22,076 | nabab/bbn | src/bbn/appui/menus.php | menus.remove | public function remove(string $id){
if ( \bbn\str::is_uid($id) ){
if ( $id_menu = $this->get_id_menu($id) ){
if ( $this->pref->delete_bit($id) ){
$this->delete_cache($id_menu);
return true;
}
}
else if ( $this->pref->delete($id) ){
$this->options->delete... | php | public function remove(string $id){
if ( \bbn\str::is_uid($id) ){
if ( $id_menu = $this->get_id_menu($id) ){
if ( $this->pref->delete_bit($id) ){
$this->delete_cache($id_menu);
return true;
}
}
else if ( $this->pref->delete($id) ){
$this->options->delete... | [
"public",
"function",
"remove",
"(",
"string",
"$",
"id",
")",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
")",
"{",
"if",
"(",
"$",
"id_menu",
"=",
"$",
"this",
"->",
"get_id_menu",
"(",
"$",
"id",
")",
")",
... | Removes menu and deletes parent cache
@param $id
@return int|boolean | [
"Removes",
"menu",
"and",
"deletes",
"parent",
"cache"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L285-L299 |
22,077 | nabab/bbn | src/bbn/appui/menus.php | menus.add | public function add($id_menu, array $cfg = null): ?string
{
$ids = [];
if ( \is_array($id_menu) ){
$cfg = $id_menu;
$id_opt = $this->from_path('menus');
}
if ( !empty($cfg) ){
if ( \bbn\str::is_uid($id_menu) ){
$id = $this->pref->add_bit($id_menu, $cfg);
}
e... | php | public function add($id_menu, array $cfg = null): ?string
{
$ids = [];
if ( \is_array($id_menu) ){
$cfg = $id_menu;
$id_opt = $this->from_path('menus');
}
if ( !empty($cfg) ){
if ( \bbn\str::is_uid($id_menu) ){
$id = $this->pref->add_bit($id_menu, $cfg);
}
e... | [
"public",
"function",
"add",
"(",
"$",
"id_menu",
",",
"array",
"$",
"cfg",
"=",
"null",
")",
":",
"?",
"string",
"{",
"$",
"ids",
"=",
"[",
"]",
";",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"id_menu",
")",
")",
"{",
"$",
"cfg",
"=",
"$",
"id_... | Add menu and delete the chache.
@param string|array $id_parent
@param array $cfg
@return null|string
@internal param $id | [
"Add",
"menu",
"and",
"delete",
"the",
"chache",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L309-L332 |
22,078 | nabab/bbn | src/bbn/appui/menus.php | menus.set | public function set(string $id, array $cfg): bool
{
if (
\bbn\str::is_uid($id) &&
($id_menu = $this->get_id_menu($id)) &&
$this->pref->update_bit($id, $cfg)
){
$this->delete_cache($id_menu);
return true;
}
return false;
} | php | public function set(string $id, array $cfg): bool
{
if (
\bbn\str::is_uid($id) &&
($id_menu = $this->get_id_menu($id)) &&
$this->pref->update_bit($id, $cfg)
){
$this->delete_cache($id_menu);
return true;
}
return false;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"id",
",",
"array",
"$",
"cfg",
")",
":",
"bool",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
"&&",
"(",
"$",
"id_menu",
"=",
"$",
"this",
"->",
"get_id_menu",
... | Updates a menu item and deletes the menu cache
@param string $id
@param array $cfg
@return bool | [
"Updates",
"a",
"menu",
"item",
"and",
"deletes",
"the",
"menu",
"cache"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L341-L352 |
22,079 | nabab/bbn | src/bbn/appui/menus.php | menus.set_text | public function set_text(string $id, string $text): bool
{
if ( \bbn\str::is_uid($id) && $this->pref->set_text($id, $text) ){
$this->delete_cache($id);
return true;
}
return false;
} | php | public function set_text(string $id, string $text): bool
{
if ( \bbn\str::is_uid($id) && $this->pref->set_text($id, $text) ){
$this->delete_cache($id);
return true;
}
return false;
} | [
"public",
"function",
"set_text",
"(",
"string",
"$",
"id",
",",
"string",
"$",
"text",
")",
":",
"bool",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
"&&",
"$",
"this",
"->",
"pref",
"->",
"set_text",
"(",
"$",
... | Sets the menu's text and deletes its chache
@param string $id The menu's ID
@param array $text The new text tp set
@return bool | [
"Sets",
"the",
"menu",
"s",
"text",
"and",
"deletes",
"its",
"chache"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L361-L368 |
22,080 | nabab/bbn | src/bbn/appui/menus.php | menus.delete_cache | public function delete_cache($id_menu){
$this->options->delete_cache($this->from_path('menus'), true);
return $this->cache_delete($id_menu);
} | php | public function delete_cache($id_menu){
$this->options->delete_cache($this->from_path('menus'), true);
return $this->cache_delete($id_menu);
} | [
"public",
"function",
"delete_cache",
"(",
"$",
"id_menu",
")",
"{",
"$",
"this",
"->",
"options",
"->",
"delete_cache",
"(",
"$",
"this",
"->",
"from_path",
"(",
"'menus'",
")",
",",
"true",
")",
";",
"return",
"$",
"this",
"->",
"cache_delete",
"(",
... | Clears the menu cache | [
"Clears",
"the",
"menu",
"cache"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L373-L376 |
22,081 | nabab/bbn | src/bbn/appui/menus.php | menus.get_default | public function get_default(): ?string
{
if (
($id_opt = $this->from_path('default')) &&
($all = $this->pref->get_all($id_opt))
){
$id = false;
foreach ( $all as $a ){
if ( !empty($a['id_user']) ){
$id = $a['id_alias'];
break;
}
else if ( !em... | php | public function get_default(): ?string
{
if (
($id_opt = $this->from_path('default')) &&
($all = $this->pref->get_all($id_opt))
){
$id = false;
foreach ( $all as $a ){
if ( !empty($a['id_user']) ){
$id = $a['id_alias'];
break;
}
else if ( !em... | [
"public",
"function",
"get_default",
"(",
")",
":",
"?",
"string",
"{",
"if",
"(",
"(",
"$",
"id_opt",
"=",
"$",
"this",
"->",
"from_path",
"(",
"'default'",
")",
")",
"&&",
"(",
"$",
"all",
"=",
"$",
"this",
"->",
"pref",
"->",
"get_all",
"(",
"... | Gets the user's default menu
@return string | [
"Gets",
"the",
"user",
"s",
"default",
"menu"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L383-L407 |
22,082 | nabab/bbn | src/bbn/appui/menus.php | menus.clone | public function clone(string $id, string $name): ?string
{
if ( \bbn\str::is_uid($id) && ($id_menu = $this->add(['text' => $name])) ){
if ( ($bits = $this->pref->get_full_bits($id)) && !$this->_clone($id_menu, $bits) ){
return null;
}
return $id_menu;
}
return null;
} | php | public function clone(string $id, string $name): ?string
{
if ( \bbn\str::is_uid($id) && ($id_menu = $this->add(['text' => $name])) ){
if ( ($bits = $this->pref->get_full_bits($id)) && !$this->_clone($id_menu, $bits) ){
return null;
}
return $id_menu;
}
return null;
} | [
"public",
"function",
"clone",
"(",
"string",
"$",
"id",
",",
"string",
"$",
"name",
")",
":",
"?",
"string",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
"&&",
"(",
"$",
"id_menu",
"=",
"$",
"this",
"->",
"add... | Clones a menu
@param string $id The menu's ID to clone
@param string $name The new menu's name
@return null|string The new ID | [
"Clones",
"a",
"menu"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L439-L448 |
22,083 | nabab/bbn | src/bbn/appui/menus.php | menus.copy | public function copy(string $id_menu, string $id_menu_to, array $cfg): ?string
{
if (
\bbn\str::is_uid($id_menu) &&
\bbn\str::is_uid($id_menu_to) &&
($bits = $this->pref->get_full_bits($id_menu)) &&
($id = $this->add($id_menu_to, $cfg)) &&
$this->_clone($id_menu_to, $bits, $id)
)... | php | public function copy(string $id_menu, string $id_menu_to, array $cfg): ?string
{
if (
\bbn\str::is_uid($id_menu) &&
\bbn\str::is_uid($id_menu_to) &&
($bits = $this->pref->get_full_bits($id_menu)) &&
($id = $this->add($id_menu_to, $cfg)) &&
$this->_clone($id_menu_to, $bits, $id)
)... | [
"public",
"function",
"copy",
"(",
"string",
"$",
"id_menu",
",",
"string",
"$",
"id_menu_to",
",",
"array",
"$",
"cfg",
")",
":",
"?",
"string",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id_menu",
")",
"&&",
"\\",
"bbn",... | Copies a menu into another one.
@param string $id The menu's ID to copy
@param string $id_menu_to The target menu's ID
@param array $cfg
@return null|string The new ID | [
"Copies",
"a",
"menu",
"into",
"another",
"one",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L460-L472 |
22,084 | DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.insert | public function insert($entity)
{
$values = $this->getInsertValues($entity, $this->namingContention);
$keyString = implode(array_keys($values), ', ');
$questionMarkString = count($values) === 0 ? '' : ('?' . str_repeat(', ?', count($values) - 1));
$sql = "INSERT INTO $this->tableNam... | php | public function insert($entity)
{
$values = $this->getInsertValues($entity, $this->namingContention);
$keyString = implode(array_keys($values), ', ');
$questionMarkString = count($values) === 0 ? '' : ('?' . str_repeat(', ?', count($values) - 1));
$sql = "INSERT INTO $this->tableNam... | [
"public",
"function",
"insert",
"(",
"$",
"entity",
")",
"{",
"$",
"values",
"=",
"$",
"this",
"->",
"getInsertValues",
"(",
"$",
"entity",
",",
"$",
"this",
"->",
"namingContention",
")",
";",
"$",
"keyString",
"=",
"implode",
"(",
"array_keys",
"(",
... | Insert an entity into the database.
You can optionally provide a property name. If you do the inserted id will be assigned to that property.
@param $entity
@return integer the id of the row that was inserted | [
"Insert",
"an",
"entity",
"into",
"the",
"database",
".",
"You",
"can",
"optionally",
"provide",
"a",
"property",
"name",
".",
"If",
"you",
"do",
"the",
"inserted",
"id",
"will",
"be",
"assigned",
"to",
"that",
"property",
"."
] | 555b02a27755032fcd53e165b0674e81a68067c0 | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L71-L87 |
22,085 | DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.update | public function update($entity)
{
if ($this->idProperty === null) {
throw new ConfigurationException('No idProperty set');
}
$id = $this->idProperty->getValue($entity);
if ($id === null) {
throw new ConfigurationException('Value of ' . $this->idProperty->get... | php | public function update($entity)
{
if ($this->idProperty === null) {
throw new ConfigurationException('No idProperty set');
}
$id = $this->idProperty->getValue($entity);
if ($id === null) {
throw new ConfigurationException('Value of ' . $this->idProperty->get... | [
"public",
"function",
"update",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"idProperty",
"===",
"null",
")",
"{",
"throw",
"new",
"ConfigurationException",
"(",
"'No idProperty set'",
")",
";",
"}",
"$",
"id",
"=",
"$",
"this",
"->",
"... | Update an existing entity in the database.
@param mixed $entity the entity
@return int the id of the entity
@throws ConfigurationException if no idProperty was set | [
"Update",
"an",
"existing",
"entity",
"in",
"the",
"database",
"."
] | 555b02a27755032fcd53e165b0674e81a68067c0 | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L95-L117 |
22,086 | DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.save | public function save($entity)
{
if ($this->idProperty->getValue($entity) === null) {
return $this->insert($entity);
} else {
return $this->update($entity);
}
} | php | public function save($entity)
{
if ($this->idProperty->getValue($entity) === null) {
return $this->insert($entity);
} else {
return $this->update($entity);
}
} | [
"public",
"function",
"save",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"idProperty",
"->",
"getValue",
"(",
"$",
"entity",
")",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"insert",
"(",
"$",
"entity",
")",
";",
"}",
... | Insert an entity into the database if it has no id yet. Otherwise update it by id.
@param mixed $entity the entity
@return int the id of the saved document
@throws ConfigurationException if no idProperty was set | [
"Insert",
"an",
"entity",
"into",
"the",
"database",
"if",
"it",
"has",
"no",
"id",
"yet",
".",
"Otherwise",
"update",
"it",
"by",
"id",
"."
] | 555b02a27755032fcd53e165b0674e81a68067c0 | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L125-L133 |
22,087 | DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.get | public function get($id)
{
$idName = ucfirst($this->idProperty->getName());
return $this->__call("getBy$idName", array($id));
} | php | public function get($id)
{
$idName = ucfirst($this->idProperty->getName());
return $this->__call("getBy$idName", array($id));
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"$",
"idName",
"=",
"ucfirst",
"(",
"$",
"this",
"->",
"idProperty",
"->",
"getName",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
"__call",
"(",
"\"getBy$idName\"",
",",
"array",
"(",
"$",
... | Get an entity by it's idProperty value.
@param mixed $id the id value
@return mixed the entity
@throws ErrorException | [
"Get",
"an",
"entity",
"by",
"it",
"s",
"idProperty",
"value",
"."
] | 555b02a27755032fcd53e165b0674e81a68067c0 | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L141-L145 |
22,088 | DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.delete | public function delete($id)
{
$idName = ucfirst($this->idProperty->getName());
return $this->__call("deleteBy$idName", array($id));
} | php | public function delete($id)
{
$idName = ucfirst($this->idProperty->getName());
return $this->__call("deleteBy$idName", array($id));
} | [
"public",
"function",
"delete",
"(",
"$",
"id",
")",
"{",
"$",
"idName",
"=",
"ucfirst",
"(",
"$",
"this",
"->",
"idProperty",
"->",
"getName",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
"__call",
"(",
"\"deleteBy$idName\"",
",",
"array",
"(",
... | Delete an entity by it's idProperty value.
@param mixed $id the id value
@return mixed the entity
@throws ErrorException | [
"Delete",
"an",
"entity",
"by",
"it",
"s",
"idProperty",
"value",
"."
] | 555b02a27755032fcd53e165b0674e81a68067c0 | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L153-L157 |
22,089 | DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.addMethod | private function addMethod($method)
{
$tokens = $this->methodParser->parse($method);
$query = $this->queryBuilder->build($tokens, $this->tableName, $this->namingContention, $this->entityClass);
if ($query->getResultMode() <= QueryBuilderResult::RESULT_SELECT_MULTIPLE) {
$this->ad... | php | private function addMethod($method)
{
$tokens = $this->methodParser->parse($method);
$query = $this->queryBuilder->build($tokens, $this->tableName, $this->namingContention, $this->entityClass);
if ($query->getResultMode() <= QueryBuilderResult::RESULT_SELECT_MULTIPLE) {
$this->ad... | [
"private",
"function",
"addMethod",
"(",
"$",
"method",
")",
"{",
"$",
"tokens",
"=",
"$",
"this",
"->",
"methodParser",
"->",
"parse",
"(",
"$",
"method",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"queryBuilder",
"->",
"build",
"(",
"$",
"toke... | Parse a dsl method and add it to this repository.
@param $method string the method name
@throws DslSyntaxException | [
"Parse",
"a",
"dsl",
"method",
"and",
"add",
"it",
"to",
"this",
"repository",
"."
] | 555b02a27755032fcd53e165b0674e81a68067c0 | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L201-L211 |
22,090 | DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.addSelectionMethod | private function addSelectionMethod(QueryBuilderResult $query, $methodName)
{
$findMethod = function () use ($query, $methodName) {
$sth = $this->pdo->prepare($query->getSql());
/** @noinspection PhpMethodParametersCountMismatchInspection */
$sth->setFetchMode(\PDO::FETC... | php | private function addSelectionMethod(QueryBuilderResult $query, $methodName)
{
$findMethod = function () use ($query, $methodName) {
$sth = $this->pdo->prepare($query->getSql());
/** @noinspection PhpMethodParametersCountMismatchInspection */
$sth->setFetchMode(\PDO::FETC... | [
"private",
"function",
"addSelectionMethod",
"(",
"QueryBuilderResult",
"$",
"query",
",",
"$",
"methodName",
")",
"{",
"$",
"findMethod",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"query",
",",
"$",
"methodName",
")",
"{",
"$",
"sth",
"=",
"$",
"this"... | Add a method that can either result in an entity or an array of entities.
@param $query QueryBuilderResult a parsed query
@param $methodName string the name of the dsl method
@throws DslSyntaxException if an unsupported result mode was requested | [
"Add",
"a",
"method",
"that",
"can",
"either",
"result",
"in",
"an",
"entity",
"or",
"an",
"array",
"of",
"entities",
"."
] | 555b02a27755032fcd53e165b0674e81a68067c0 | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L219-L244 |
22,091 | DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.addIntResultMethod | private function addIntResultMethod(QueryBuilderResult $query, $methodName)
{
$intResultMethod = function () use ($query) {
$sth = $this->pdo->prepare($query->getSql());
$sth->execute(func_get_args());
return $sth->rowCount();
};
$this->methods[$methodNam... | php | private function addIntResultMethod(QueryBuilderResult $query, $methodName)
{
$intResultMethod = function () use ($query) {
$sth = $this->pdo->prepare($query->getSql());
$sth->execute(func_get_args());
return $sth->rowCount();
};
$this->methods[$methodNam... | [
"private",
"function",
"addIntResultMethod",
"(",
"QueryBuilderResult",
"$",
"query",
",",
"$",
"methodName",
")",
"{",
"$",
"intResultMethod",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"query",
")",
"{",
"$",
"sth",
"=",
"$",
"this",
"->",
"pdo",
"->"... | Add a new method that will result in an integer.
@param $query QueryBuilderResult a parsed dsl query
@param $methodName string the name of the method | [
"Add",
"a",
"new",
"method",
"that",
"will",
"result",
"in",
"an",
"integer",
"."
] | 555b02a27755032fcd53e165b0674e81a68067c0 | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L251-L260 |
22,092 | DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.checkDatabase | public function checkDatabase($showAllData = true)
{
switch ($this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME)) {
case 'mysql':
$sth = $this->pdo->prepare('SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_NAME = ?');
$sth->execute(array($this->tableNam... | php | public function checkDatabase($showAllData = true)
{
switch ($this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME)) {
case 'mysql':
$sth = $this->pdo->prepare('SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_NAME = ?');
$sth->execute(array($this->tableNam... | [
"public",
"function",
"checkDatabase",
"(",
"$",
"showAllData",
"=",
"true",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"pdo",
"->",
"getAttribute",
"(",
"PDO",
"::",
"ATTR_DRIVER_NAME",
")",
")",
"{",
"case",
"'mysql'",
":",
"$",
"sth",
"=",
"$",
"th... | This method will run some analysis on the correctness of your configuration. It will be exported to the screen.
@param boolean $showAllData set this to false if you want to hide the entities row | [
"This",
"method",
"will",
"run",
"some",
"analysis",
"on",
"the",
"correctness",
"of",
"your",
"configuration",
".",
"It",
"will",
"be",
"exported",
"to",
"the",
"screen",
"."
] | 555b02a27755032fcd53e165b0674e81a68067c0 | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L285-L359 |
22,093 | f3ath/lazypdo | src/LazyPDO.php | LazyPDO.getPDO | protected function getPDO()
{
if (null === $this->pdo) {
$this->pdo = new \PDO($this->dsn, $this->user, $this->password, $this->options);
}
return $this->pdo;
} | php | protected function getPDO()
{
if (null === $this->pdo) {
$this->pdo = new \PDO($this->dsn, $this->user, $this->password, $this->options);
}
return $this->pdo;
} | [
"protected",
"function",
"getPDO",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"pdo",
")",
"{",
"$",
"this",
"->",
"pdo",
"=",
"new",
"\\",
"PDO",
"(",
"$",
"this",
"->",
"dsn",
",",
"$",
"this",
"->",
"user",
",",
"$",
"this",
... | Get PDO object. Cache the result
@return \PDO | [
"Get",
"PDO",
"object",
".",
"Cache",
"the",
"result"
] | 0ebdb3bc87d327d68a322d5fca049f4c21865928 | https://github.com/f3ath/lazypdo/blob/0ebdb3bc87d327d68a322d5fca049f4c21865928/src/LazyPDO.php#L43-L49 |
22,094 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.register | public function register(Application $app)
{
$app['parser.example.finder'] = new Example\Finder();
$this->addCache($app);
$this->addAssemblers($app);
$this->addFilters($app);
$this->addValidators($app);
$this->addBuilder($app);
// I would prefer to extend it... | php | public function register(Application $app)
{
$app['parser.example.finder'] = new Example\Finder();
$this->addCache($app);
$this->addAssemblers($app);
$this->addFilters($app);
$this->addValidators($app);
$this->addBuilder($app);
// I would prefer to extend it... | [
"public",
"function",
"register",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'parser.example.finder'",
"]",
"=",
"new",
"Example",
"\\",
"Finder",
"(",
")",
";",
"$",
"this",
"->",
"addCache",
"(",
"$",
"app",
")",
";",
"$",
"this",
... | Adds the services needed to build the descriptors.
@param Application $app An Application instance
@return void | [
"Adds",
"the",
"services",
"needed",
"to",
"build",
"the",
"descriptors",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L89-L105 |
22,095 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.attachFiltersToManager | public function attachFiltersToManager(Filter $filterManager, Application $app)
{
$stripOnVisibility = new StripOnVisibility($app['descriptor.builder']);
$filtersOnAllDescriptors = array(
new StripInternal($app['descriptor.builder']),
new StripIgnore($app['descriptor.builder'... | php | public function attachFiltersToManager(Filter $filterManager, Application $app)
{
$stripOnVisibility = new StripOnVisibility($app['descriptor.builder']);
$filtersOnAllDescriptors = array(
new StripInternal($app['descriptor.builder']),
new StripIgnore($app['descriptor.builder'... | [
"public",
"function",
"attachFiltersToManager",
"(",
"Filter",
"$",
"filterManager",
",",
"Application",
"$",
"app",
")",
"{",
"$",
"stripOnVisibility",
"=",
"new",
"StripOnVisibility",
"(",
"$",
"app",
"[",
"'descriptor.builder'",
"]",
")",
";",
"$",
"filtersOn... | Attaches filters to the manager.
@param Filter $filterManager
@param Application $app
@return Filter | [
"Attaches",
"filters",
"to",
"the",
"manager",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L191-L212 |
22,096 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.addCache | protected function addCache(Application $app)
{
$app['descriptor.cache'] = $app->share(
function () {
$cache = new Filesystem();
$cache->setOptions(
array(
'namespace' => 'phpdoc-cache',
'cache_... | php | protected function addCache(Application $app)
{
$app['descriptor.cache'] = $app->share(
function () {
$cache = new Filesystem();
$cache->setOptions(
array(
'namespace' => 'phpdoc-cache',
'cache_... | [
"protected",
"function",
"addCache",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'descriptor.cache'",
"]",
"=",
"$",
"app",
"->",
"share",
"(",
"function",
"(",
")",
"{",
"$",
"cache",
"=",
"new",
"Filesystem",
"(",
")",
";",
"$",
"ca... | Adds the caching mechanism to the dependency injection container with key 'descriptor.cache'.
@param Application $app
@return void | [
"Adds",
"the",
"caching",
"mechanism",
"to",
"the",
"dependency",
"injection",
"container",
"with",
"key",
"descriptor",
".",
"cache",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L281-L306 |
22,097 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.addBuilder | protected function addBuilder(Application $app)
{
if (extension_loaded('igbinary')) {
$app['descriptor.builder.serializer'] = 'IgBinary';
} else {
$app['descriptor.builder.serializer'] = 'PhpSerialize';
}
$app['descriptor.builder'] = $app->share(
... | php | protected function addBuilder(Application $app)
{
if (extension_loaded('igbinary')) {
$app['descriptor.builder.serializer'] = 'IgBinary';
} else {
$app['descriptor.builder.serializer'] = 'PhpSerialize';
}
$app['descriptor.builder'] = $app->share(
... | [
"protected",
"function",
"addBuilder",
"(",
"Application",
"$",
"app",
")",
"{",
"if",
"(",
"extension_loaded",
"(",
"'igbinary'",
")",
")",
"{",
"$",
"app",
"[",
"'descriptor.builder.serializer'",
"]",
"=",
"'IgBinary'",
";",
"}",
"else",
"{",
"$",
"app",
... | Adds the Building mechanism using the key 'descriptor.builder'.
Please note that the type of serializer can be configured using the parameter 'descriptor.builder.serializer'; it
accepts any parameter that Zend\Serializer supports.
@param Application $app
@return void | [
"Adds",
"the",
"Building",
"mechanism",
"using",
"the",
"key",
"descriptor",
".",
"builder",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L318-L338 |
22,098 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.addAssemblers | protected function addAssemblers(Application $app)
{
$app['descriptor.builder.assembler.factory'] = $app->share(
function () {
return new AssemblerFactory();
}
);
$provider = $this;
$app['descriptor.builder.assembler.factory'] = $app->share(
... | php | protected function addAssemblers(Application $app)
{
$app['descriptor.builder.assembler.factory'] = $app->share(
function () {
return new AssemblerFactory();
}
);
$provider = $this;
$app['descriptor.builder.assembler.factory'] = $app->share(
... | [
"protected",
"function",
"addAssemblers",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'descriptor.builder.assembler.factory'",
"]",
"=",
"$",
"app",
"->",
"share",
"(",
"function",
"(",
")",
"{",
"return",
"new",
"AssemblerFactory",
"(",
")",
... | Adds the assembler factory and attaches the basic assemblers with key 'descriptor.builder.assembler.factory'.
@param Application $app
@return void | [
"Adds",
"the",
"assembler",
"factory",
"and",
"attaches",
"the",
"basic",
"assemblers",
"with",
"key",
"descriptor",
".",
"builder",
".",
"assembler",
".",
"factory",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L347-L364 |
22,099 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.addValidators | protected function addValidators(Application $app)
{
if (!isset($app['validator'])) {
throw new Exception\MissingDependencyException('The validator manager is missing');
}
$provider = $this;
$app['validator'] = $app->share(
$app->extend(
'vali... | php | protected function addValidators(Application $app)
{
if (!isset($app['validator'])) {
throw new Exception\MissingDependencyException('The validator manager is missing');
}
$provider = $this;
$app['validator'] = $app->share(
$app->extend(
'vali... | [
"protected",
"function",
"addValidators",
"(",
"Application",
"$",
"app",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"app",
"[",
"'validator'",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"MissingDependencyException",
"(",
"'The validator manager ... | Adds validators for the descriptors to the validator manager.
@param Application $app
@throws Exception\MissingDependencyException if the validator could not be found.
@return void | [
"Adds",
"validators",
"for",
"the",
"descriptors",
"to",
"the",
"validator",
"manager",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L394-L409 |
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.