repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCountryQuery.php | BaseCountryQuery.prune | public function prune($country = null)
{
if ($country) {
$this->addUsingAlias(CountryPeer::ID, $country->getId(), Criteria::NOT_EQUAL);
}
return $this;
} | php | public function prune($country = null)
{
if ($country) {
$this->addUsingAlias(CountryPeer::ID, $country->getId(), Criteria::NOT_EQUAL);
}
return $this;
} | [
"public",
"function",
"prune",
"(",
"$",
"country",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"country",
")",
"{",
"$",
"this",
"->",
"addUsingAlias",
"(",
"CountryPeer",
"::",
"ID",
",",
"$",
"country",
"->",
"getId",
"(",
")",
",",
"Criteria",
"::",
... | Exclude object from result
@param Country $country Object to remove from the list of results
@return CountryQuery The current query, for fluid interface | [
"Exclude",
"object",
"from",
"result"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCountryQuery.php#L454-L461 |
phrest/sdk | src/Generator/Controller/ControllerGenerator.php | ControllerGenerator.create | public function create()
{
$class = ClassGen::classGen(
$this->entityName . 'Controller',
$this->namespace,
['Phrest\API\Controllers\RESTController'],
'RESTController'
);
foreach ($this->entityDefinition->requests as $requestMethod => $actions)
{
foreach ($actions as $ac... | php | public function create()
{
$class = ClassGen::classGen(
$this->entityName . 'Controller',
$this->namespace,
['Phrest\API\Controllers\RESTController'],
'RESTController'
);
foreach ($this->entityDefinition->requests as $requestMethod => $actions)
{
foreach ($actions as $ac... | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"class",
"=",
"ClassGen",
"::",
"classGen",
"(",
"$",
"this",
"->",
"entityName",
".",
"'Controller'",
",",
"$",
"this",
"->",
"namespace",
",",
"[",
"'Phrest\\API\\Controllers\\RESTController'",
"]",
",",
... | Process and create code/files
@return ClassGenerator | [
"Process",
"and",
"create",
"code",
"/",
"files"
] | train | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Generator/Controller/ControllerGenerator.php#L49-L93 |
phrest/sdk | src/Generator/Controller/ControllerGenerator.php | ControllerGenerator.createDocblockForMethod | private function createDocblockForMethod(
$requestMethod,
$action,
$getParams,
$postParams
)
{
if (empty($action->doc))
{
$action->doc = 'TODO';
}
/*
* $action->doc
* METHOD: /{url:[a-z]+}
*/
$docblock = new DocBlockGenerator(
$action->doc,
strto... | php | private function createDocblockForMethod(
$requestMethod,
$action,
$getParams,
$postParams
)
{
if (empty($action->doc))
{
$action->doc = 'TODO';
}
/*
* $action->doc
* METHOD: /{url:[a-z]+}
*/
$docblock = new DocBlockGenerator(
$action->doc,
strto... | [
"private",
"function",
"createDocblockForMethod",
"(",
"$",
"requestMethod",
",",
"$",
"action",
",",
"$",
"getParams",
",",
"$",
"postParams",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"action",
"->",
"doc",
")",
")",
"{",
"$",
"action",
"->",
"doc",
"=... | @param string $requestMethod
@param Config $action
@param ParameterGenerator[] $getParams
@param ParameterGenerator[] $postParams
@return DocBlockGenerator | [
"@param",
"string",
"$requestMethod",
"@param",
"Config",
"$action",
"@param",
"ParameterGenerator",
"[]",
"$getParams",
"@param",
"ParameterGenerator",
"[]",
"$postParams"
] | train | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Generator/Controller/ControllerGenerator.php#L103-L171 |
phrest/sdk | src/Generator/Controller/ControllerGenerator.php | ControllerGenerator.createBodyForMethod | private function createBodyForMethod($action)
{
$body = '//todo' . PHP_EOL;
if (!empty($action->postParams))
{
foreach ($action->postParams as $param => $type)
{
$body .= sprintf(
'$%s = $this->request->getPost(\'%s\', \'%s\');%s',
$param,
$param,
... | php | private function createBodyForMethod($action)
{
$body = '//todo' . PHP_EOL;
if (!empty($action->postParams))
{
foreach ($action->postParams as $param => $type)
{
$body .= sprintf(
'$%s = $this->request->getPost(\'%s\', \'%s\');%s',
$param,
$param,
... | [
"private",
"function",
"createBodyForMethod",
"(",
"$",
"action",
")",
"{",
"$",
"body",
"=",
"'//todo'",
".",
"PHP_EOL",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"action",
"->",
"postParams",
")",
")",
"{",
"foreach",
"(",
"$",
"action",
"->",
"postPar... | @param Config $action
@return string | [
"@param",
"Config",
"$action"
] | train | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Generator/Controller/ControllerGenerator.php#L178-L254 |
phrest/sdk | src/Generator/Controller/ControllerGenerator.php | ControllerGenerator.generateGetParamsFromUrl | private function generateGetParamsFromUrl($url)
{
$matches = [];
preg_match_all('#\{(\w+):[^\}]+\}#i', $url, $matches);
$params = [];
foreach ($matches[1] as $param)
{
$params[] = new ParameterGenerator($param);
}
return $params;
} | php | private function generateGetParamsFromUrl($url)
{
$matches = [];
preg_match_all('#\{(\w+):[^\}]+\}#i', $url, $matches);
$params = [];
foreach ($matches[1] as $param)
{
$params[] = new ParameterGenerator($param);
}
return $params;
} | [
"private",
"function",
"generateGetParamsFromUrl",
"(",
"$",
"url",
")",
"{",
"$",
"matches",
"=",
"[",
"]",
";",
"preg_match_all",
"(",
"'#\\{(\\w+):[^\\}]+\\}#i'",
",",
"$",
"url",
",",
"$",
"matches",
")",
";",
"$",
"params",
"=",
"[",
"]",
";",
"fore... | Parse E.G. /{id:[0-9]+}/{name:[a-z]+} into ['id', 'name']
@param $url
@return ParameterGenerator[] | [
"Parse",
"E",
".",
"G",
".",
"/",
"{",
"id",
":",
"[",
"0",
"-",
"9",
"]",
"+",
"}",
"/",
"{",
"name",
":",
"[",
"a",
"-",
"z",
"]",
"+",
"}",
"into",
"[",
"id",
"name",
"]"
] | train | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Generator/Controller/ControllerGenerator.php#L263-L275 |
phrest/sdk | src/Generator/Controller/ControllerGenerator.php | ControllerGenerator.generatePostParams | private function generatePostParams($action)
{
$params = [];
if (!empty($action->postParams))
{
foreach ($action->postParams as $param => $type)
{
$params[] = new ParameterGenerator($param, $type);
}
}
return $params;
} | php | private function generatePostParams($action)
{
$params = [];
if (!empty($action->postParams))
{
foreach ($action->postParams as $param => $type)
{
$params[] = new ParameterGenerator($param, $type);
}
}
return $params;
} | [
"private",
"function",
"generatePostParams",
"(",
"$",
"action",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"action",
"->",
"postParams",
")",
")",
"{",
"foreach",
"(",
"$",
"action",
"->",
"postParams",
"as",
"$"... | @param Config $action
@return ParameterGenerator[] | [
"@param",
"Config",
"$action"
] | train | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Generator/Controller/ControllerGenerator.php#L282-L295 |
flipboxstudio/orm-manager | src/Flipbox/OrmManager/BothRelations/MorphOneToMany.php | MorphOneToMany.buildRelations | public function buildRelations()
{
$this->command->buildMethod($this->model, 'morphTo', null, $this->options);
foreach ($this->toModels as $key => $toModel) {
$options = $this->options;
$options['primary_key'] = $this->options['primary_key'][$key];
$this->command... | php | public function buildRelations()
{
$this->command->buildMethod($this->model, 'morphTo', null, $this->options);
foreach ($this->toModels as $key => $toModel) {
$options = $this->options;
$options['primary_key'] = $this->options['primary_key'][$key];
$this->command... | [
"public",
"function",
"buildRelations",
"(",
")",
"{",
"$",
"this",
"->",
"command",
"->",
"buildMethod",
"(",
"$",
"this",
"->",
"model",
",",
"'morphTo'",
",",
"null",
",",
"$",
"this",
"->",
"options",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
... | build relations between models
@return void | [
"build",
"relations",
"between",
"models"
] | train | https://github.com/flipboxstudio/orm-manager/blob/4288426517f53d05177b8729c4ba94c5beca9a98/src/Flipbox/OrmManager/BothRelations/MorphOneToMany.php#L12-L21 |
steeffeen/FancyManiaLinks | FML/Stylesheet/Stylesheet.php | Stylesheet.addStyle | public function addStyle(Style $style)
{
if (!in_array($style, $this->styles, true)) {
array_push($this->styles, $style);
}
return $this;
} | php | public function addStyle(Style $style)
{
if (!in_array($style, $this->styles, true)) {
array_push($this->styles, $style);
}
return $this;
} | [
"public",
"function",
"addStyle",
"(",
"Style",
"$",
"style",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"style",
",",
"$",
"this",
"->",
"styles",
",",
"true",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"styles",
",",
"$",
"style",
... | Add a new Style
@api
@param Style $style The Style to be added
@return static | [
"Add",
"a",
"new",
"Style"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Stylesheet.php#L59-L65 |
steeffeen/FancyManiaLinks | FML/Stylesheet/Stylesheet.php | Stylesheet.addStyle3d | public function addStyle3d(Style3d $style3d)
{
if (!in_array($style3d, $this->styles3d, true)) {
array_push($this->styles3d, $style3d);
}
return $this;
} | php | public function addStyle3d(Style3d $style3d)
{
if (!in_array($style3d, $this->styles3d, true)) {
array_push($this->styles3d, $style3d);
}
return $this;
} | [
"public",
"function",
"addStyle3d",
"(",
"Style3d",
"$",
"style3d",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"style3d",
",",
"$",
"this",
"->",
"styles3d",
",",
"true",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"styles3d",
",",
"$",... | Add a new Style3d
@api
@param Style3d $style3d The Style3d to be added
@return static | [
"Add",
"a",
"new",
"Style3d"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Stylesheet.php#L97-L103 |
steeffeen/FancyManiaLinks | FML/Stylesheet/Stylesheet.php | Stylesheet.getMood | public function getMood($createIfEmpty = true)
{
if (!$this->mood && $createIfEmpty) {
$this->createMood();
}
return $this->mood;
} | php | public function getMood($createIfEmpty = true)
{
if (!$this->mood && $createIfEmpty) {
$this->createMood();
}
return $this->mood;
} | [
"public",
"function",
"getMood",
"(",
"$",
"createIfEmpty",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"mood",
"&&",
"$",
"createIfEmpty",
")",
"{",
"$",
"this",
"->",
"createMood",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"m... | Get the Mood
@api
@param bool $createIfEmpty (optional) If the Mood should be created if it doesn't exist yet
@return Mood | [
"Get",
"the",
"Mood"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Stylesheet.php#L138-L144 |
steeffeen/FancyManiaLinks | FML/Stylesheet/Stylesheet.php | Stylesheet.createMood | public function createMood()
{
if ($this->mood) {
return $this->mood;
}
$mood = new Mood();
$this->setMood($mood);
return $this->mood;
} | php | public function createMood()
{
if ($this->mood) {
return $this->mood;
}
$mood = new Mood();
$this->setMood($mood);
return $this->mood;
} | [
"public",
"function",
"createMood",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mood",
")",
"{",
"return",
"$",
"this",
"->",
"mood",
";",
"}",
"$",
"mood",
"=",
"new",
"Mood",
"(",
")",
";",
"$",
"this",
"->",
"setMood",
"(",
"$",
"mood",
")... | Create a new Mood if necessary
@api
@return Mood | [
"Create",
"a",
"new",
"Mood",
"if",
"necessary"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Stylesheet.php#L165-L173 |
steeffeen/FancyManiaLinks | FML/Stylesheet/Stylesheet.php | Stylesheet.render | public function render(\DOMDocument $domDocument)
{
$stylesheetXml = $domDocument->createElement("stylesheet");
if ($this->styles3d) {
$stylesXml = $domDocument->createElement("frame3dstyles");
$stylesheetXml->appendChild($stylesXml);
foreach ($this->styles3d as $... | php | public function render(\DOMDocument $domDocument)
{
$stylesheetXml = $domDocument->createElement("stylesheet");
if ($this->styles3d) {
$stylesXml = $domDocument->createElement("frame3dstyles");
$stylesheetXml->appendChild($stylesXml);
foreach ($this->styles3d as $... | [
"public",
"function",
"render",
"(",
"\\",
"DOMDocument",
"$",
"domDocument",
")",
"{",
"$",
"stylesheetXml",
"=",
"$",
"domDocument",
"->",
"createElement",
"(",
"\"stylesheet\"",
")",
";",
"if",
"(",
"$",
"this",
"->",
"styles3d",
")",
"{",
"$",
"stylesX... | Render the Stylesheet
@param \DOMDocument $domDocument DOMDocument for which the Stylesheet should be rendered
@return \DOMElement | [
"Render",
"the",
"Stylesheet"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Stylesheet.php#L181-L197 |
Lansoweb/LosReCaptcha | src/Form/View/Helper/Captcha/Invisible.php | Invisible.renderHiddenInput | private function renderHiddenInput($responseName, $responseId)
{
$pattern = '<input type="hidden" %s%s';
$closingBracket = $this->getInlineClosingBracket();
$attributes = $this->createAttributesString([
'name' => $responseName,
'id' => $responseId,
]... | php | private function renderHiddenInput($responseName, $responseId)
{
$pattern = '<input type="hidden" %s%s';
$closingBracket = $this->getInlineClosingBracket();
$attributes = $this->createAttributesString([
'name' => $responseName,
'id' => $responseId,
]... | [
"private",
"function",
"renderHiddenInput",
"(",
"$",
"responseName",
",",
"$",
"responseId",
")",
"{",
"$",
"pattern",
"=",
"'<input type=\"hidden\" %s%s'",
";",
"$",
"closingBracket",
"=",
"$",
"this",
"->",
"getInlineClosingBracket",
"(",
")",
";",
"$",
"attr... | Render hidden input elements for the response
@param string $responseName
@param string $responseId
@return string | [
"Render",
"hidden",
"input",
"elements",
"for",
"the",
"response"
] | train | https://github.com/Lansoweb/LosReCaptcha/blob/8df866995501db087c3850f97fd2b6547632e6ed/src/Form/View/Helper/Captcha/Invisible.php#L74-L86 |
xinix-technology/norm | src/Norm/Dialect/OracleDialect.php | OracleDialect.grammarUpdate | public function grammarUpdate($collectionName, $data)
{
$sets = array();
foreach ($data as $key => $value) {
$k = $key;
$sets[] = $this->grammarEscape($k).' = :'.$k;
}
$sql = 'UPDATE '.$collectionName.' SET '.implode(', ', $sets) . ' WHERE id = :id';
... | php | public function grammarUpdate($collectionName, $data)
{
$sets = array();
foreach ($data as $key => $value) {
$k = $key;
$sets[] = $this->grammarEscape($k).' = :'.$k;
}
$sql = 'UPDATE '.$collectionName.' SET '.implode(', ', $sets) . ' WHERE id = :id';
... | [
"public",
"function",
"grammarUpdate",
"(",
"$",
"collectionName",
",",
"$",
"data",
")",
"{",
"$",
"sets",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"k",
"=",
"$",
"key",
";",
... | } | [
"}"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Dialect/OracleDialect.php#L50-L62 |
maniaplanet/matchmaking-lobby | MatchMakingLobby/Match/Plugin.php | Plugin.onTick | function onTick()
{
$this->tick++;
switch ($this->state)
{
case self::OVER:
case self::SLEEPING:
break;
case self::WAITING:
case self::DECIDING:
case self::PLAYING:
break;
case self::PLAYER_LEFT:
case self::WAITING_BACKUPS:
break;
}
if(new \DateTime() < ... | php | function onTick()
{
$this->tick++;
switch ($this->state)
{
case self::OVER:
case self::SLEEPING:
break;
case self::WAITING:
case self::DECIDING:
case self::PLAYING:
break;
case self::PLAYER_LEFT:
case self::WAITING_BACKUPS:
break;
}
if(new \DateTime() < ... | [
"function",
"onTick",
"(",
")",
"{",
"$",
"this",
"->",
"tick",
"++",
";",
"switch",
"(",
"$",
"this",
"->",
"state",
")",
"{",
"case",
"self",
"::",
"OVER",
":",
"case",
"self",
"::",
"SLEEPING",
":",
"break",
";",
"case",
"self",
"::",
"WAITING",... | Core of the plugin | [
"Core",
"of",
"the",
"plugin"
] | train | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/Match/Plugin.php#L246-L357 |
maniaplanet/matchmaking-lobby | MatchMakingLobby/Match/Plugin.php | Plugin.prepare | protected function prepare($match)
{
\ManiaLive\Utilities\Logger::debug($match);
$this->players = array_fill_keys($match->players, Services\PlayerInfo::PLAYER_STATE_NOT_CONNECTED);
$this->match = $match;
$this->matchId = $match->id;
Label::EraseAll();
foreach($match->players as $login)
{
$t... | php | protected function prepare($match)
{
\ManiaLive\Utilities\Logger::debug($match);
$this->players = array_fill_keys($match->players, Services\PlayerInfo::PLAYER_STATE_NOT_CONNECTED);
$this->match = $match;
$this->matchId = $match->id;
Label::EraseAll();
foreach($match->players as $login)
{
$t... | [
"protected",
"function",
"prepare",
"(",
"$",
"match",
")",
"{",
"\\",
"ManiaLive",
"\\",
"Utilities",
"\\",
"Logger",
"::",
"debug",
"(",
"$",
"match",
")",
";",
"$",
"this",
"->",
"players",
"=",
"array_fill_keys",
"(",
"$",
"match",
"->",
"players",
... | Prepare the server config to host a match
Then wait players' connection
@param Services\Match $match | [
"Prepare",
"the",
"server",
"config",
"to",
"host",
"a",
"match",
"Then",
"wait",
"players",
"connection"
] | train | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/Match/Plugin.php#L569-L598 |
maniaplanet/matchmaking-lobby | MatchMakingLobby/Match/Plugin.php | Plugin.end | protected function end()
{
\ManiaLive\Utilities\Logger::debug('end()');
$this->showTansfertLabel(null, -50);
foreach($this->storage->players as $player)
{
try
{
$this->connection->sendOpenLink((string) $player->login, '#qjoin='.$this->lobby->backLink, 1);
}
catch (\DedicatedApi\Xmlr... | php | protected function end()
{
\ManiaLive\Utilities\Logger::debug('end()');
$this->showTansfertLabel(null, -50);
foreach($this->storage->players as $player)
{
try
{
$this->connection->sendOpenLink((string) $player->login, '#qjoin='.$this->lobby->backLink, 1);
}
catch (\DedicatedApi\Xmlr... | [
"protected",
"function",
"end",
"(",
")",
"{",
"\\",
"ManiaLive",
"\\",
"Utilities",
"\\",
"Logger",
"::",
"debug",
"(",
"'end()'",
")",
";",
"$",
"this",
"->",
"showTansfertLabel",
"(",
"null",
",",
"-",
"50",
")",
";",
"foreach",
"(",
"$",
"this",
... | Free the match for the lobby | [
"Free",
"the",
"match",
"for",
"the",
"lobby"
] | train | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/Match/Plugin.php#L775-L803 |
titon/db | src/Titon/Db/Behavior/SlugBehavior.php | SlugBehavior.makeUnique | public function makeUnique($id, $slug) {
$repo = $this->getRepository();
$scope = $this->getConfig('scope');
/** @type \Titon\Db\Query $query */
foreach ([
$repo->select()->where($this->getConfig('slug'), $slug),
$repo->select()->where($this->getConfig('slug'), '... | php | public function makeUnique($id, $slug) {
$repo = $this->getRepository();
$scope = $this->getConfig('scope');
/** @type \Titon\Db\Query $query */
foreach ([
$repo->select()->where($this->getConfig('slug'), $slug),
$repo->select()->where($this->getConfig('slug'), '... | [
"public",
"function",
"makeUnique",
"(",
"$",
"id",
",",
"$",
"slug",
")",
"{",
"$",
"repo",
"=",
"$",
"this",
"->",
"getRepository",
"(",
")",
";",
"$",
"scope",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'scope'",
")",
";",
"/** @type \\Titon\\Db\\Qu... | Validate the slug is unique by querying for other slugs.
If the slug is not unique, append a count to it.
@param int|int[] $id
@param string $slug
@return string | [
"Validate",
"the",
"slug",
"is",
"unique",
"by",
"querying",
"for",
"other",
"slugs",
".",
"If",
"the",
"slug",
"is",
"not",
"unique",
"append",
"a",
"count",
"to",
"it",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/SlugBehavior.php#L50-L78 |
titon/db | src/Titon/Db/Behavior/SlugBehavior.php | SlugBehavior.preSave | public function preSave(Event $event, Query $query, $id, array &$data) {
$config = $this->allConfig();
if (empty($data) || empty($data[$config['field']]) || !empty($data[$config['slug']])) {
return true;
} else if ($query->getType() === Query::UPDATE && !$config['onUpdate']) {
... | php | public function preSave(Event $event, Query $query, $id, array &$data) {
$config = $this->allConfig();
if (empty($data) || empty($data[$config['field']]) || !empty($data[$config['slug']])) {
return true;
} else if ($query->getType() === Query::UPDATE && !$config['onUpdate']) {
... | [
"public",
"function",
"preSave",
"(",
"Event",
"$",
"event",
",",
"Query",
"$",
"query",
",",
"$",
"id",
",",
"array",
"&",
"$",
"data",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"allConfig",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
... | Before a save occurs, generate a unique slug using another field as the base.
If no data exists, or the base doesn't exist, or the slug is already set, exit early.
@param \Titon\Event\Event $event
@param \Titon\Db\Query $query
@param int|int[] $id
@param array $data
@return bool | [
"Before",
"a",
"save",
"occurs",
"generate",
"a",
"unique",
"slug",
"using",
"another",
"field",
"as",
"the",
"base",
".",
"If",
"no",
"data",
"exists",
"or",
"the",
"base",
"doesn",
"t",
"exist",
"or",
"the",
"slug",
"is",
"already",
"set",
"exit",
"e... | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/SlugBehavior.php#L90-L114 |
titon/db | src/Titon/Db/Behavior/SlugBehavior.php | SlugBehavior.slugify | public static function slugify($string) {
$string = strip_tags($string);
$string = str_replace(['&', '&'], 'and', $string);
$string = str_replace('@', 'at', $string);
// @codeCoverageIgnoreStart
if (class_exists('Titon\G11n\Utility\Inflector')) {
return \Titon\G1... | php | public static function slugify($string) {
$string = strip_tags($string);
$string = str_replace(['&', '&'], 'and', $string);
$string = str_replace('@', 'at', $string);
// @codeCoverageIgnoreStart
if (class_exists('Titon\G11n\Utility\Inflector')) {
return \Titon\G1... | [
"public",
"static",
"function",
"slugify",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"strip_tags",
"(",
"$",
"string",
")",
";",
"$",
"string",
"=",
"str_replace",
"(",
"[",
"'&'",
",",
"'&'",
"]",
",",
"'and'",
",",
"$",
"string",
")",
... | Return a slugged version of a string.
@param string $string
@return string | [
"Return",
"a",
"slugged",
"version",
"of",
"a",
"string",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/SlugBehavior.php#L131-L143 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.create | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof UserQuery) {
return $criteria;
}
$query = new UserQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
... | php | public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof UserQuery) {
return $criteria;
}
$query = new UserQuery(null, null, $modelAlias);
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"modelAlias",
"=",
"null",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"UserQuery",
")",
"{",
"return",
"$",
"criteria",
";",
"}",
"$",
"query",
"=",
"new",
... | Returns a new UserQuery object.
@param string $modelAlias The alias of a model in the query
@param UserQuery|Criteria $criteria Optional Criteria to build the query from
@return UserQuery | [
"Returns",
"a",
"new",
"UserQuery",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L120-L132 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByUsername | public function filterByUsername($username = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($username)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $username)) {
$username = str_replace('*', '%', $username);
... | php | public function filterByUsername($username = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($username)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $username)) {
$username = str_replace('*', '%', $username);
... | [
"public",
"function",
"filterByUsername",
"(",
"$",
"username",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"username",
")",
")",
"{",
"$",
"compa... | Filter the query on the username column
Example usage:
<code>
$query->filterByUsername('fooValue'); // WHERE username = 'fooValue'
$query->filterByUsername('%fooValue%'); // WHERE username LIKE '%fooValue%'
</code>
@param string $username The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@p... | [
"Filter",
"the",
"query",
"on",
"the",
"username",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L342-L354 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByPassword | public function filterByPassword($password = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($password)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $password)) {
$password = str_replace('*', '%', $password);
... | php | public function filterByPassword($password = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($password)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $password)) {
$password = str_replace('*', '%', $password);
... | [
"public",
"function",
"filterByPassword",
"(",
"$",
"password",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"password",
")",
")",
"{",
"$",
"compa... | Filter the query on the password column
Example usage:
<code>
$query->filterByPassword('fooValue'); // WHERE password = 'fooValue'
$query->filterByPassword('%fooValue%'); // WHERE password LIKE '%fooValue%'
</code>
@param string $password The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@p... | [
"Filter",
"the",
"query",
"on",
"the",
"password",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L371-L383 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterBySalt | public function filterBySalt($salt = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($salt)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $salt)) {
$salt = str_replace('*', '%', $salt);
$comparison... | php | public function filterBySalt($salt = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($salt)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $salt)) {
$salt = str_replace('*', '%', $salt);
$comparison... | [
"public",
"function",
"filterBySalt",
"(",
"$",
"salt",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"salt",
")",
")",
"{",
"$",
"comparison",
"=... | Filter the query on the salt column
Example usage:
<code>
$query->filterBySalt('fooValue'); // WHERE salt = 'fooValue'
$query->filterBySalt('%fooValue%'); // WHERE salt LIKE '%fooValue%'
</code>
@param string $salt The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $compari... | [
"Filter",
"the",
"query",
"on",
"the",
"salt",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L400-L412 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByFirstname | public function filterByFirstname($firstname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($firstname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $firstname)) {
$firstname = str_replace('*', '%', $firstname... | php | public function filterByFirstname($firstname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($firstname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $firstname)) {
$firstname = str_replace('*', '%', $firstname... | [
"public",
"function",
"filterByFirstname",
"(",
"$",
"firstname",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"firstname",
")",
")",
"{",
"$",
"co... | Filter the query on the firstname column
Example usage:
<code>
$query->filterByFirstname('fooValue'); // WHERE firstname = 'fooValue'
$query->filterByFirstname('%fooValue%'); // WHERE firstname LIKE '%fooValue%'
</code>
@param string $firstname The value to use as filter.
Accepts wildcards (* and % trigger a LI... | [
"Filter",
"the",
"query",
"on",
"the",
"firstname",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L429-L441 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByLastname | public function filterByLastname($lastname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($lastname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $lastname)) {
$lastname = str_replace('*', '%', $lastname);
... | php | public function filterByLastname($lastname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($lastname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $lastname)) {
$lastname = str_replace('*', '%', $lastname);
... | [
"public",
"function",
"filterByLastname",
"(",
"$",
"lastname",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"lastname",
")",
")",
"{",
"$",
"compa... | Filter the query on the lastname column
Example usage:
<code>
$query->filterByLastname('fooValue'); // WHERE lastname = 'fooValue'
$query->filterByLastname('%fooValue%'); // WHERE lastname LIKE '%fooValue%'
</code>
@param string $lastname The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@p... | [
"Filter",
"the",
"query",
"on",
"the",
"lastname",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L458-L470 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByPhone | public function filterByPhone($phone = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($phone)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $phone)) {
$phone = str_replace('*', '%', $phone);
$comp... | php | public function filterByPhone($phone = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($phone)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $phone)) {
$phone = str_replace('*', '%', $phone);
$comp... | [
"public",
"function",
"filterByPhone",
"(",
"$",
"phone",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"phone",
")",
")",
"{",
"$",
"comparison",
... | Filter the query on the phone column
Example usage:
<code>
$query->filterByPhone('fooValue'); // WHERE phone = 'fooValue'
$query->filterByPhone('%fooValue%'); // WHERE phone LIKE '%fooValue%'
</code>
@param string $phone The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $c... | [
"Filter",
"the",
"query",
"on",
"the",
"phone",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L516-L528 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByMemo | public function filterByMemo($memo = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($memo)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $memo)) {
$memo = str_replace('*', '%', $memo);
$comparison... | php | public function filterByMemo($memo = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($memo)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $memo)) {
$memo = str_replace('*', '%', $memo);
$comparison... | [
"public",
"function",
"filterByMemo",
"(",
"$",
"memo",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"memo",
")",
")",
"{",
"$",
"comparison",
"=... | Filter the query on the memo column
Example usage:
<code>
$query->filterByMemo('fooValue'); // WHERE memo = 'fooValue'
$query->filterByMemo('%fooValue%'); // WHERE memo LIKE '%fooValue%'
</code>
@param string $memo The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $compari... | [
"Filter",
"the",
"query",
"on",
"the",
"memo",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L545-L557 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByActivated | public function filterByActivated($activated = null, $comparison = null)
{
if (is_string($activated)) {
$activated = in_array(strtolower($activated), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(UserPeer::ACTIVATED, $activated, $c... | php | public function filterByActivated($activated = null, $comparison = null)
{
if (is_string($activated)) {
$activated = in_array(strtolower($activated), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(UserPeer::ACTIVATED, $activated, $c... | [
"public",
"function",
"filterByActivated",
"(",
"$",
"activated",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"activated",
")",
")",
"{",
"$",
"activated",
"=",
"in_array",
"(",
"strtolower",
"(",
"$",
... | Filter the query on the activated column
Example usage:
<code>
$query->filterByActivated(true); // WHERE activated = true
$query->filterByActivated('yes'); // WHERE activated = true
</code>
@param boolean|string $activated The value to use as filter.
Non-boolean arguments are converted using the following rules:
... | [
"Filter",
"the",
"query",
"on",
"the",
"activated",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L577-L584 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByLastLogin | public function filterByLastLogin($lastLogin = null, $comparison = null)
{
if (is_array($lastLogin)) {
$useMinMax = false;
if (isset($lastLogin['min'])) {
$this->addUsingAlias(UserPeer::LAST_LOGIN, $lastLogin['min'], Criteria::GREATER_EQUAL);
$useMinMa... | php | public function filterByLastLogin($lastLogin = null, $comparison = null)
{
if (is_array($lastLogin)) {
$useMinMax = false;
if (isset($lastLogin['min'])) {
$this->addUsingAlias(UserPeer::LAST_LOGIN, $lastLogin['min'], Criteria::GREATER_EQUAL);
$useMinMa... | [
"public",
"function",
"filterByLastLogin",
"(",
"$",
"lastLogin",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"lastLogin",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"... | Filter the query on the last_login column
Example usage:
<code>
$query->filterByLastLogin('2011-03-14'); // WHERE last_login = '2011-03-14'
$query->filterByLastLogin('now'); // WHERE last_login = '2011-03-14'
$query->filterByLastLogin(array('max' => 'yesterday')); // WHERE last_login < '2011-03-13'
</code>
@param ... | [
"Filter",
"the",
"query",
"on",
"the",
"last_login",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L606-L627 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByUserCustomerRelation | public function filterByUserCustomerRelation($userCustomerRelation, $comparison = null)
{
if ($userCustomerRelation instanceof UserCustomerRelation) {
return $this
->addUsingAlias(UserPeer::ID, $userCustomerRelation->getUserId(), $comparison);
} elseif ($userCustomerRelat... | php | public function filterByUserCustomerRelation($userCustomerRelation, $comparison = null)
{
if ($userCustomerRelation instanceof UserCustomerRelation) {
return $this
->addUsingAlias(UserPeer::ID, $userCustomerRelation->getUserId(), $comparison);
} elseif ($userCustomerRelat... | [
"public",
"function",
"filterByUserCustomerRelation",
"(",
"$",
"userCustomerRelation",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"userCustomerRelation",
"instanceof",
"UserCustomerRelation",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingAlias... | Filter the query by a related UserCustomerRelation object
@param UserCustomerRelation|PropelObjectCollection $userCustomerRelation the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return UserQuery The current q... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"UserCustomerRelation",
"object"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L692-L705 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.filterByUserRole | public function filterByUserRole($userRole, $comparison = null)
{
if ($userRole instanceof UserRole) {
return $this
->addUsingAlias(UserPeer::ID, $userRole->getUserId(), $comparison);
} elseif ($userRole instanceof PropelObjectCollection) {
return $this
... | php | public function filterByUserRole($userRole, $comparison = null)
{
if ($userRole instanceof UserRole) {
return $this
->addUsingAlias(UserPeer::ID, $userRole->getUserId(), $comparison);
} elseif ($userRole instanceof PropelObjectCollection) {
return $this
... | [
"public",
"function",
"filterByUserRole",
"(",
"$",
"userRole",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"userRole",
"instanceof",
"UserRole",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingAlias",
"(",
"UserPeer",
"::",
"ID",
",",
... | Filter the query by a related UserRole object
@param UserRole|PropelObjectCollection $userRole the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return UserQuery The current query, for fluid interface
@throws Pr... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"UserRole",
"object"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L766-L779 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php | BaseUserQuery.prune | public function prune($user = null)
{
if ($user) {
$this->addUsingAlias(UserPeer::ID, $user->getId(), Criteria::NOT_EQUAL);
}
return $this;
} | php | public function prune($user = null)
{
if ($user) {
$this->addUsingAlias(UserPeer::ID, $user->getId(), Criteria::NOT_EQUAL);
}
return $this;
} | [
"public",
"function",
"prune",
"(",
"$",
"user",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"user",
")",
"{",
"$",
"this",
"->",
"addUsingAlias",
"(",
"UserPeer",
"::",
"ID",
",",
"$",
"user",
"->",
"getId",
"(",
")",
",",
"Criteria",
"::",
"NOT_EQUAL"... | Exclude object from result
@param User $user Object to remove from the list of results
@return UserQuery The current query, for fluid interface | [
"Exclude",
"object",
"from",
"result"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php#L838-L845 |
ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._create_cache_dir | private function _create_cache_dir()
{
if (! file_exists($this->config['cache_dir'])) {
try {
mkdir($this->config['cache_dir'], 0755, TRUE);
} catch (Exception $e) {
throw $e;
}
}
// Set the cache dir
$this-... | php | private function _create_cache_dir()
{
if (! file_exists($this->config['cache_dir'])) {
try {
mkdir($this->config['cache_dir'], 0755, TRUE);
} catch (Exception $e) {
throw $e;
}
}
// Set the cache dir
$this-... | [
"private",
"function",
"_create_cache_dir",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"config",
"[",
"'cache_dir'",
"]",
")",
")",
"{",
"try",
"{",
"mkdir",
"(",
"$",
"this",
"->",
"config",
"[",
"'cache_dir'",
"]",
",",
"... | Try to create the config cache dir if required
Set $cache_dir | [
"Try",
"to",
"create",
"the",
"config",
"cache",
"dir",
"if",
"required",
"Set",
"$cache_dir"
] | train | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L124-L136 |
ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._create_mimic_cache_dir | private function _create_mimic_cache_dir()
{
if ($this->config['mimic_source_dir']) {
// Get the dir from the source file
$mimic_dir = $this->config['cache_dir'] . pathinfo($this->source_file, PATHINFO_DIRNAME);
// Try to create if it does not exist
... | php | private function _create_mimic_cache_dir()
{
if ($this->config['mimic_source_dir']) {
// Get the dir from the source file
$mimic_dir = $this->config['cache_dir'] . pathinfo($this->source_file, PATHINFO_DIRNAME);
// Try to create if it does not exist
... | [
"private",
"function",
"_create_mimic_cache_dir",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"config",
"[",
"'mimic_source_dir'",
"]",
")",
"{",
"// Get the dir from the source file",
"$",
"mimic_dir",
"=",
"$",
"this",
"->",
"config",
"[",
"'cache_dir'",
"]",... | Try to create the mimic cache dir from the source path if required
Set $cache_dir | [
"Try",
"to",
"create",
"the",
"mimic",
"cache",
"dir",
"from",
"the",
"source",
"path",
"if",
"required",
"Set",
"$cache_dir"
] | train | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L142-L160 |
ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._set_params | private function _set_params()
{
// Get values from request
$params = \Request::route('params');
$filepath = $this->config['abs_path'] . '/' . \Request::route('imagepath');
// echo $params; exit;
// If enforcing params, ensure it's a match
if ($this-... | php | private function _set_params()
{
// Get values from request
$params = \Request::route('params');
$filepath = $this->config['abs_path'] . '/' . \Request::route('imagepath');
// echo $params; exit;
// If enforcing params, ensure it's a match
if ($this-... | [
"private",
"function",
"_set_params",
"(",
")",
"{",
"// Get values from request",
"$",
"params",
"=",
"\\",
"Request",
"::",
"route",
"(",
"'params'",
")",
";",
"$",
"filepath",
"=",
"$",
"this",
"->",
"config",
"[",
"'abs_path'",
"]",
".",
"'/'",
".",
... | Sets the operations params from the url | [
"Sets",
"the",
"operations",
"params",
"from",
"the",
"url"
] | train | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L165-L233 |
ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._cached_required | private function _cached_required()
{
$image_info = getimagesize($this->source_file);
if (($this->url_params['w'] == $image_info[0]) and ($this->url_params['h'] == $image_info[1])) {
$this->serve_default = TRUE;
return FALSE;
}
return TRUE;
... | php | private function _cached_required()
{
$image_info = getimagesize($this->source_file);
if (($this->url_params['w'] == $image_info[0]) and ($this->url_params['h'] == $image_info[1])) {
$this->serve_default = TRUE;
return FALSE;
}
return TRUE;
... | [
"private",
"function",
"_cached_required",
"(",
")",
"{",
"$",
"image_info",
"=",
"getimagesize",
"(",
"$",
"this",
"->",
"source_file",
")",
";",
"if",
"(",
"(",
"$",
"this",
"->",
"url_params",
"[",
"'w'",
"]",
"==",
"$",
"image_info",
"[",
"0",
"]",... | Checks that the param dimensions are are lower then current image dimensions
@return boolean | [
"Checks",
"that",
"the",
"param",
"dimensions",
"are",
"are",
"lower",
"then",
"current",
"image",
"dimensions"
] | train | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L250-L260 |
ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._encoded_filename | private function _encoded_filename()
{
$ext = strtolower(pathinfo($this->source_file, PATHINFO_EXTENSION));
$encode = md5($this->source_file . http_build_query($this->url_params));
// Build the parts of the filename
$encoded_name = $encode . '-' . $this->source_modified . '.... | php | private function _encoded_filename()
{
$ext = strtolower(pathinfo($this->source_file, PATHINFO_EXTENSION));
$encode = md5($this->source_file . http_build_query($this->url_params));
// Build the parts of the filename
$encoded_name = $encode . '-' . $this->source_modified . '.... | [
"private",
"function",
"_encoded_filename",
"(",
")",
"{",
"$",
"ext",
"=",
"strtolower",
"(",
"pathinfo",
"(",
"$",
"this",
"->",
"source_file",
",",
"PATHINFO_EXTENSION",
")",
")",
";",
"$",
"encode",
"=",
"md5",
"(",
"$",
"this",
"->",
"source_file",
... | Returns a hash of the filepath and params plus last modified of source to be used as a unique filename
@return string | [
"Returns",
"a",
"hash",
"of",
"the",
"filepath",
"and",
"params",
"plus",
"last",
"modified",
"of",
"source",
"to",
"be",
"used",
"as",
"a",
"unique",
"filename"
] | train | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L267-L276 |
ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._create_cached | private function _create_cached()
{
if (isset($this->url_params['c']) && $this->url_params['c']) {
// Resize to highest width or height with overflow on the larger side
$this->resize($this->url_params['w'], $this->url_params['h'], self::INVERSE);
// $this->image->resize($... | php | private function _create_cached()
{
if (isset($this->url_params['c']) && $this->url_params['c']) {
// Resize to highest width or height with overflow on the larger side
$this->resize($this->url_params['w'], $this->url_params['h'], self::INVERSE);
// $this->image->resize($... | [
"private",
"function",
"_create_cached",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"url_params",
"[",
"'c'",
"]",
")",
"&&",
"$",
"this",
"->",
"url_params",
"[",
"'c'",
"]",
")",
"{",
"// Resize to highest width or height with overflow on the... | Creates a cached cropped/resized version of the file | [
"Creates",
"a",
"cached",
"cropped",
"/",
"resized",
"version",
"of",
"the",
"file"
] | train | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L281-L328 |
ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._create_headers | private function _create_headers($file_data)
{
// Create the required header vars
$last_modified = gmdate('D, d M Y H:i:s', filemtime($file_data)) . ' GMT';
$filesystem = new \Illuminate\Filesystem\Filesystem;
$content_type = $filesystem->mimeType($file_data);
// $content_typ... | php | private function _create_headers($file_data)
{
// Create the required header vars
$last_modified = gmdate('D, d M Y H:i:s', filemtime($file_data)) . ' GMT';
$filesystem = new \Illuminate\Filesystem\Filesystem;
$content_type = $filesystem->mimeType($file_data);
// $content_typ... | [
"private",
"function",
"_create_headers",
"(",
"$",
"file_data",
")",
"{",
"// Create the required header vars",
"$",
"last_modified",
"=",
"gmdate",
"(",
"'D, d M Y H:i:s'",
",",
"filemtime",
"(",
"$",
"file_data",
")",
")",
".",
"' GMT'",
";",
"$",
"filesystem",... | Create the image HTTP headers
@param
string path to the file to server (either default or cached version) | [
"Create",
"the",
"image",
"HTTP",
"headers"
] | train | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L336-L375 |
ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._modified_headers | private function _modified_headers($last_modified)
{
$modified_since = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : FALSE;
if (! $modified_since or $modified_since != $last_modified)
return;
// Nothing ... | php | private function _modified_headers($last_modified)
{
$modified_since = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : FALSE;
if (! $modified_since or $modified_since != $last_modified)
return;
// Nothing ... | [
"private",
"function",
"_modified_headers",
"(",
"$",
"last_modified",
")",
"{",
"$",
"modified_since",
"=",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'HTTP_IF_MODIFIED_SINCE'",
"]",
")",
")",
"?",
"stripslashes",
"(",
"$",
"_SERVER",
"[",
"'HTTP_IF_MODIFIED_SINC... | Rerurns 304 Not Modified HTTP headers if required and exits
@param
string header formatted date | [
"Rerurns",
"304",
"Not",
"Modified",
"HTTP",
"headers",
"if",
"required",
"and",
"exits"
] | train | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L383-L394 |
ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._serve_file | private function _serve_file()
{
// Set either the source or cache file as our datasource
if ($this->serve_default) {
$file_data = $this->source_file;
} else {
$file_data = $this->cached_file;
}
// Output the file
$this->_output_file($... | php | private function _serve_file()
{
// Set either the source or cache file as our datasource
if ($this->serve_default) {
$file_data = $this->source_file;
} else {
$file_data = $this->cached_file;
}
// Output the file
$this->_output_file($... | [
"private",
"function",
"_serve_file",
"(",
")",
"{",
"// Set either the source or cache file as our datasource",
"if",
"(",
"$",
"this",
"->",
"serve_default",
")",
"{",
"$",
"file_data",
"=",
"$",
"this",
"->",
"source_file",
";",
"}",
"else",
"{",
"$",
"file_d... | Decide which filesource we are using and serve | [
"Decide",
"which",
"filesource",
"we",
"are",
"using",
"and",
"serve"
] | train | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L399-L410 |
ivliev/imagefly | src/Ivliev/Imagefly/Imagefly.php | Imagefly._output_file | private function _output_file($file_data)
{
// Create the headers
$this->_create_headers($file_data);
// Get the file data
$data = file_get_contents($file_data);
// Send the image to the browser in bite-sized chunks
$chunk_size = 1024 * 8;
$f... | php | private function _output_file($file_data)
{
// Create the headers
$this->_create_headers($file_data);
// Get the file data
$data = file_get_contents($file_data);
// Send the image to the browser in bite-sized chunks
$chunk_size = 1024 * 8;
$f... | [
"private",
"function",
"_output_file",
"(",
"$",
"file_data",
")",
"{",
"// Create the headers",
"$",
"this",
"->",
"_create_headers",
"(",
"$",
"file_data",
")",
";",
"// Get the file data",
"$",
"data",
"=",
"file_get_contents",
"(",
"$",
"file_data",
")",
";"... | Outputs the cached image file and exits
@param
string path to the file to server (either default or cached version) | [
"Outputs",
"the",
"cached",
"image",
"file",
"and",
"exits"
] | train | https://github.com/ivliev/imagefly/blob/0363eb37cc0748292a2142f0ec9027827e9d4eba/src/Ivliev/Imagefly/Imagefly.php#L418-L440 |
devmobgroup/postcodes | src/Providers/HttpProvider.php | HttpProvider.getClient | public function getClient(): ClientInterface
{
if (! isset($this->client)) {
$this->client = new GuzzleClient();
}
return $this->client;
} | php | public function getClient(): ClientInterface
{
if (! isset($this->client)) {
$this->client = new GuzzleClient();
}
return $this->client;
} | [
"public",
"function",
"getClient",
"(",
")",
":",
"ClientInterface",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"client",
")",
")",
"{",
"$",
"this",
"->",
"client",
"=",
"new",
"GuzzleClient",
"(",
")",
";",
"}",
"return",
"$",
"this",
... | Get the Http client.
@return \GuzzleHttp\ClientInterface | [
"Get",
"the",
"Http",
"client",
"."
] | train | https://github.com/devmobgroup/postcodes/blob/1a8438fd960a8f50ec28d61af94560892b529f12/src/Providers/HttpProvider.php#L39-L46 |
devmobgroup/postcodes | src/Providers/HttpProvider.php | HttpProvider.lookup | public function lookup(string $postcode, string $number): array
{
$input = [
'postcode' => $postcode,
'number' => $number
];
// Create http request to send
$request = $this->request($input);
$response = null;
try {
// Make request... | php | public function lookup(string $postcode, string $number): array
{
$input = [
'postcode' => $postcode,
'number' => $number
];
// Create http request to send
$request = $this->request($input);
$response = null;
try {
// Make request... | [
"public",
"function",
"lookup",
"(",
"string",
"$",
"postcode",
",",
"string",
"$",
"number",
")",
":",
"array",
"{",
"$",
"input",
"=",
"[",
"'postcode'",
"=>",
"$",
"postcode",
",",
"'number'",
"=>",
"$",
"number",
"]",
";",
"// Create http request to se... | Lookup an address by postcode and house number.
@param string $postcode
@param string $number
@return \DevMob\Postcodes\Address\Address[]
@throws \DevMob\Postcodes\Exceptions\NoSuchCombinationException
@throws \DevMob\Postcodes\Exceptions\PostcodesException | [
"Lookup",
"an",
"address",
"by",
"postcode",
"and",
"house",
"number",
"."
] | train | https://github.com/devmobgroup/postcodes/blob/1a8438fd960a8f50ec28d61af94560892b529f12/src/Providers/HttpProvider.php#L58-L90 |
nguyenanhung/td-send-sms | src/SendSMS/SendSmsCallback.php | SendSmsCallback.setSdkConfig | public function setSdkConfig($sdkConfig = array())
{
$this->sdkConfig = $sdkConfig;
$this->debug->debug(__FUNCTION__, 'SDK Config => ' . json_encode($this->sdkConfig));
return $this;
} | php | public function setSdkConfig($sdkConfig = array())
{
$this->sdkConfig = $sdkConfig;
$this->debug->debug(__FUNCTION__, 'SDK Config => ' . json_encode($this->sdkConfig));
return $this;
} | [
"public",
"function",
"setSdkConfig",
"(",
"$",
"sdkConfig",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"sdkConfig",
"=",
"$",
"sdkConfig",
";",
"$",
"this",
"->",
"debug",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'SDK Config => '",
".",
"json... | Function setSdkConfig
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/21/18 10:24
@param array $sdkConfig
@return $this | [
"Function",
"setSdkConfig"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSmsCallback.php#L93-L99 |
nguyenanhung/td-send-sms | src/SendSMS/SendSmsCallback.php | SendSmsCallback.initializeCallback | public function initializeCallback($callbackCode = '', $statusCode = '')
{
$callback = $this->getConfigData();
if (!empty($callbackCode)) {
$decodeData = base64_decode(trim($callbackCode));
$initData = explode(self::NOTE_PREFIX, $decodeData);
if (is_array($initD... | php | public function initializeCallback($callbackCode = '', $statusCode = '')
{
$callback = $this->getConfigData();
if (!empty($callbackCode)) {
$decodeData = base64_decode(trim($callbackCode));
$initData = explode(self::NOTE_PREFIX, $decodeData);
if (is_array($initD... | [
"public",
"function",
"initializeCallback",
"(",
"$",
"callbackCode",
"=",
"''",
",",
"$",
"statusCode",
"=",
"''",
")",
"{",
"$",
"callback",
"=",
"$",
"this",
"->",
"getConfigData",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"callbackCode",
")... | Function initializeCallback
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/21/18 23:16
@param string $callbackCode
@param string $statusCode
@return int | [
"Function",
"initializeCallback"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSmsCallback.php#L142-L180 |
webforge-labs/psc-cms | lib/Psc/Data/FileCache.php | FileCache.load | public function load($key, &$loaded) {
$file = $this->getFile($this->getKey($key));
if ($this->validate($file)) {
$loaded = TRUE;
return $this->direct ? $file : $file->getContents();
}
$loaded = FALSE;
} | php | public function load($key, &$loaded) {
$file = $this->getFile($this->getKey($key));
if ($this->validate($file)) {
$loaded = TRUE;
return $this->direct ? $file : $file->getContents();
}
$loaded = FALSE;
} | [
"public",
"function",
"load",
"(",
"$",
"key",
",",
"&",
"$",
"loaded",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getFile",
"(",
"$",
"this",
"->",
"getKey",
"(",
"$",
"key",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"validate",
"(",
... | Gibt den Inhalt der Datei (direct = FALSE) oder die Datei zurück (direct = TRUE)
@return string (binärdaten aus der Datei) | [
"Gibt",
"den",
"Inhalt",
"der",
"Datei",
"(",
"direct",
"=",
"FALSE",
")",
"oder",
"die",
"Datei",
"zurück",
"(",
"direct",
"=",
"TRUE",
")"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Data/FileCache.php#L74-L82 |
webforge-labs/psc-cms | lib/Psc/Data/FileCache.php | FileCache.remove | public function remove($key) {
$file = $this->getFile($this->getKey($key));
$file->delete();
return $this;
} | php | public function remove($key) {
$file = $this->getFile($this->getKey($key));
$file->delete();
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"getFile",
"(",
"$",
"this",
"->",
"getKey",
"(",
"$",
"key",
")",
")",
";",
"$",
"file",
"->",
"delete",
"(",
")",
";",
"return",
"$",
"this",
";",... | Entfernt die Dateia us dem Cache
@chainable | [
"Entfernt",
"die",
"Dateia",
"us",
"dem",
"Cache"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Data/FileCache.php#L96-L100 |
jfusion/org.jfusion.framework | src/Installer/Framework.php | Framework.update | public static function update()
{
$results = array();
$db = Factory::getDBO();
/***
* UPGRADES FOR 1.1.0 Patch 2
***/
//see if the columns exists
$query = 'SHOW COLUMNS FROM #__jfusion';
$db->setQuery($query);
$columns = $db->loadColumn();
/**
* for 2.0
*/
$query = 'ALTER TABLE #__jfus... | php | public static function update()
{
$results = array();
$db = Factory::getDBO();
/***
* UPGRADES FOR 1.1.0 Patch 2
***/
//see if the columns exists
$query = 'SHOW COLUMNS FROM #__jfusion';
$db->setQuery($query);
$columns = $db->loadColumn();
/**
* for 2.0
*/
$query = 'ALTER TABLE #__jfus... | [
"public",
"static",
"function",
"update",
"(",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"$",
"db",
"=",
"Factory",
"::",
"getDBO",
"(",
")",
";",
"/***\n\t\t * UPGRADES FOR 1.1.0 Patch 2\n\t\t ***/",
"//see if the columns exists",
"$",
"query",
"="... | method to update the component
@return boolean | [
"method",
"to",
"update",
"the",
"component"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Framework.php#L102-L219 |
jfusion/org.jfusion.framework | src/Installer/Framework.php | Framework.uninstall | public static function uninstall()
{
$results = array();
//see if any mods from jfusion plugins need to be removed
$plugins = Factory::getPlugins('all', false, 0);
foreach($plugins as $plugin) {
$model = new Plugin();
$result = $model->uninstall($plugin->name);
$r = new stdClass();
$result['statu... | php | public static function uninstall()
{
$results = array();
//see if any mods from jfusion plugins need to be removed
$plugins = Factory::getPlugins('all', false, 0);
foreach($plugins as $plugin) {
$model = new Plugin();
$result = $model->uninstall($plugin->name);
$r = new stdClass();
$result['statu... | [
"public",
"static",
"function",
"uninstall",
"(",
")",
"{",
"$",
"results",
"=",
"array",
"(",
")",
";",
"//see if any mods from jfusion plugins need to be removed",
"$",
"plugins",
"=",
"Factory",
"::",
"getPlugins",
"(",
"'all'",
",",
"false",
",",
"0",
")",
... | method to uninstall the component
@return stdClass[] with status/message field for plugin uninstall info | [
"method",
"to",
"uninstall",
"the",
"component"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Installer/Framework.php#L226-L267 |
yuncms/framework | src/admin/widgets/Box.php | Box.renderHeader | protected function renderHeader()
{
$tools = $this->renderTools();
if ($this->header !== null) {
$header = Html::tag('h5', "\n" . $this->header . "\n", $this->headerOptions) . "\n" . ($tools !== null ? $tools : '');
return Html::tag('div', $header, ['class' => 'ibox-title']);... | php | protected function renderHeader()
{
$tools = $this->renderTools();
if ($this->header !== null) {
$header = Html::tag('h5', "\n" . $this->header . "\n", $this->headerOptions) . "\n" . ($tools !== null ? $tools : '');
return Html::tag('div', $header, ['class' => 'ibox-title']);... | [
"protected",
"function",
"renderHeader",
"(",
")",
"{",
"$",
"tools",
"=",
"$",
"this",
"->",
"renderTools",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"header",
"!==",
"null",
")",
"{",
"$",
"header",
"=",
"Html",
"::",
"tag",
"(",
"'h5'",
",",
... | 渲染盒子外框头部
@return string the rendering result | [
"渲染盒子外框头部"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/widgets/Box.php#L101-L110 |
yuncms/framework | src/admin/widgets/Box.php | Box.renderTools | protected function renderTools()
{
$tools = '';
if($this->collapseButton !== false){
$tools .= '<a class="collapse-link"><i class="fa fa-chevron-up"></i></a>';
}
if ($this->closeButton !== false) {
$tools .= '<a class="close-link"><i class="fa fa-times"></i></... | php | protected function renderTools()
{
$tools = '';
if($this->collapseButton !== false){
$tools .= '<a class="collapse-link"><i class="fa fa-chevron-up"></i></a>';
}
if ($this->closeButton !== false) {
$tools .= '<a class="close-link"><i class="fa fa-times"></i></... | [
"protected",
"function",
"renderTools",
"(",
")",
"{",
"$",
"tools",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"collapseButton",
"!==",
"false",
")",
"{",
"$",
"tools",
".=",
"'<a class=\"collapse-link\"><i class=\"fa fa-chevron-up\"></i></a>'",
";",
"}",
"i... | Renders the tools
@return string the rendering result | [
"Renders",
"the",
"tools"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/widgets/Box.php#L148-L162 |
yuncms/framework | src/admin/widgets/Box.php | Box.initOptions | protected function initOptions()
{
$this->options = array_merge([
'class' => 'ibox float-e-margins',
'tabindex' => -1,
], $this->options);
Html::addCssClass($this->bodyOptions, 'ibox-content');
} | php | protected function initOptions()
{
$this->options = array_merge([
'class' => 'ibox float-e-margins',
'tabindex' => -1,
], $this->options);
Html::addCssClass($this->bodyOptions, 'ibox-content');
} | [
"protected",
"function",
"initOptions",
"(",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"array_merge",
"(",
"[",
"'class'",
"=>",
"'ibox float-e-margins'",
",",
"'tabindex'",
"=>",
"-",
"1",
",",
"]",
",",
"$",
"this",
"->",
"options",
")",
";",
"Html"... | Initializes the widget options.
This method sets the default values for various options. | [
"Initializes",
"the",
"widget",
"options",
".",
"This",
"method",
"sets",
"the",
"default",
"values",
"for",
"various",
"options",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/widgets/Box.php#L178-L187 |
jfusion/org.jfusion.framework | src/User/User.php | User.login | public function login(Userinfo $userinfo, $options = array())
{
$success = 0;
$this->debugger->set(null, array());
$this->debugger->set('init', array());
try {
Factory::getStatus()->set('active.jfusion', true);
//php 5.3 does not allow plugins to contain pass by references
//use a global for the logi... | php | public function login(Userinfo $userinfo, $options = array())
{
$success = 0;
$this->debugger->set(null, array());
$this->debugger->set('init', array());
try {
Factory::getStatus()->set('active.jfusion', true);
//php 5.3 does not allow plugins to contain pass by references
//use a global for the logi... | [
"public",
"function",
"login",
"(",
"Userinfo",
"$",
"userinfo",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"success",
"=",
"0",
";",
"$",
"this",
"->",
"debugger",
"->",
"set",
"(",
"null",
",",
"array",
"(",
")",
")",
";",
"$",... | Login authentication function.
Username and encoded password are passed the onUserLogin event which
is responsible for the user validation. A successful validation updates
the current session record with the user's details.
Username and encoded password are sent as credentials (along with other
possibilities) to each... | [
"Login",
"authentication",
"function",
"."
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/User.php#L92-L241 |
jfusion/org.jfusion.framework | src/User/User.php | User.logout | public function logout(Userinfo $userinfo, $options = array())
{
//initialise some vars
Factory::getStatus()->set('active.jfusion', true);
if (!isset($options['skipplugin'])) {
$options['skipplugin'] = array();
}
if (!isset($options['mask'])) {
$options['mask'] = true;
}
//allow for the detection... | php | public function logout(Userinfo $userinfo, $options = array())
{
//initialise some vars
Factory::getStatus()->set('active.jfusion', true);
if (!isset($options['skipplugin'])) {
$options['skipplugin'] = array();
}
if (!isset($options['mask'])) {
$options['mask'] = true;
}
//allow for the detection... | [
"public",
"function",
"logout",
"(",
"Userinfo",
"$",
"userinfo",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"//initialise some vars",
"Factory",
"::",
"getStatus",
"(",
")",
"->",
"set",
"(",
"'active.jfusion'",
",",
"true",
")",
";",
"if",
... | Logout authentication function.
Passed the current user information to the onUserLogout event and reverts the current
session record back to 'anonymous' parameters.
If any of the authentication plugins did not successfully complete
the logout routine then the whole method fails. Any errors raised
should be done in the... | [
"Logout",
"authentication",
"function",
"."
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/User.php#L260-L332 |
jfusion/org.jfusion.framework | src/User/User.php | User.delete | public function delete(Userinfo $userinfo)
{
$result = false;
$this->debugger->set(null, array());
//create an array to store the debug info
$debug_info = array();
$error_info = array();
$plugins = Factory::getPlugins();
$userinfo = User::search($userinfo);
if ($userinfo instanceof Userinfo) {
f... | php | public function delete(Userinfo $userinfo)
{
$result = false;
$this->debugger->set(null, array());
//create an array to store the debug info
$debug_info = array();
$error_info = array();
$plugins = Factory::getPlugins();
$userinfo = User::search($userinfo);
if ($userinfo instanceof Userinfo) {
f... | [
"public",
"function",
"delete",
"(",
"Userinfo",
"$",
"userinfo",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"this",
"->",
"debugger",
"->",
"set",
"(",
"null",
",",
"array",
"(",
")",
")",
";",
"//create an array to store the debug info",
"$",
"debu... | Delete user
@param Userinfo $userinfo
@return boolean | [
"Delete",
"user"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/User.php#L341-L394 |
jfusion/org.jfusion.framework | src/User/User.php | User.save | public function save(Userinfo $userinfo, Userinfo $olduserinfo = null, $new = false)
{
$this->debugger->set(null, array());
//create an array to store the debug info
$debug_info = array();
$error_info = array();
$plugins = Factory::getPlugins();
if ($userinfo instanceof Userinfo) {
// Recover the ol... | php | public function save(Userinfo $userinfo, Userinfo $olduserinfo = null, $new = false)
{
$this->debugger->set(null, array());
//create an array to store the debug info
$debug_info = array();
$error_info = array();
$plugins = Factory::getPlugins();
if ($userinfo instanceof Userinfo) {
// Recover the ol... | [
"public",
"function",
"save",
"(",
"Userinfo",
"$",
"userinfo",
",",
"Userinfo",
"$",
"olduserinfo",
"=",
"null",
",",
"$",
"new",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"debugger",
"->",
"set",
"(",
"null",
",",
"array",
"(",
")",
")",
";",
"/... | Delete user
@param Userinfo $userinfo
@param Userinfo $olduserinfo
@param bool $new
@return boolean False on Error | [
"Delete",
"user"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/User.php#L405-L484 |
jfusion/org.jfusion.framework | src/User/User.php | User.search | public static function search(Userinfo $userinfo, $lookup = false)
{
$exsistingUser = null;
if ($lookup && $userinfo->getJname() !== null) {
$userPlugin = Factory::getUser($userinfo->getJname());
$exsistingUser = $userPlugin->lookupUser($userinfo);
}
if (!$exsistingUser instanceof Userinfo) {
$plugi... | php | public static function search(Userinfo $userinfo, $lookup = false)
{
$exsistingUser = null;
if ($lookup && $userinfo->getJname() !== null) {
$userPlugin = Factory::getUser($userinfo->getJname());
$exsistingUser = $userPlugin->lookupUser($userinfo);
}
if (!$exsistingUser instanceof Userinfo) {
$plugi... | [
"public",
"static",
"function",
"search",
"(",
"Userinfo",
"$",
"userinfo",
",",
"$",
"lookup",
"=",
"false",
")",
"{",
"$",
"exsistingUser",
"=",
"null",
";",
"if",
"(",
"$",
"lookup",
"&&",
"$",
"userinfo",
"->",
"getJname",
"(",
")",
"!==",
"null",
... | Finds the first user that match starting with master
@param Userinfo $userinfo
@param bool $lookup
@return null|Userinfo returns first used founed | [
"Finds",
"the",
"first",
"user",
"that",
"match",
"starting",
"with",
"master"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/User.php#L494-L518 |
jfusion/org.jfusion.framework | src/User/User.php | User.remove | public static function remove(Userinfo $userinfo)
{
$db = Factory::getDBO();
$query = $db->getQuery(true)
->delete('#__jfusion_users')
->where('userid = ' . $db->quote($userinfo->userid));
$db->setQuery($query);
$db->execute();
} | php | public static function remove(Userinfo $userinfo)
{
$db = Factory::getDBO();
$query = $db->getQuery(true)
->delete('#__jfusion_users')
->where('userid = ' . $db->quote($userinfo->userid));
$db->setQuery($query);
$db->execute();
} | [
"public",
"static",
"function",
"remove",
"(",
"Userinfo",
"$",
"userinfo",
")",
"{",
"$",
"db",
"=",
"Factory",
"::",
"getDBO",
"(",
")",
";",
"$",
"query",
"=",
"$",
"db",
"->",
"getQuery",
"(",
"true",
")",
"->",
"delete",
"(",
"'#__jfusion_users'",... | Delete old user data in the lookup table
@param Userinfo $userinfo userinfo of the user to be deleted | [
"Delete",
"old",
"user",
"data",
"in",
"the",
"lookup",
"table"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/User/User.php#L525-L535 |
RobinMalfait/l4-laracasts-feed | src/Malfaitrobin/Laracasts/Laracasts.php | Laracasts.meta | public function meta()
{
$xml = (array) $this->xml;
unset($xml['entry']);
$xml['link'] = (object) $xml['link']->{"@attributes"};
return (object) $xml;
} | php | public function meta()
{
$xml = (array) $this->xml;
unset($xml['entry']);
$xml['link'] = (object) $xml['link']->{"@attributes"};
return (object) $xml;
} | [
"public",
"function",
"meta",
"(",
")",
"{",
"$",
"xml",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"xml",
";",
"unset",
"(",
"$",
"xml",
"[",
"'entry'",
"]",
")",
";",
"$",
"xml",
"[",
"'link'",
"]",
"=",
"(",
"object",
")",
"$",
"xml",
"[",... | Get the meta information of the xml feed
@return object | [
"Get",
"the",
"meta",
"information",
"of",
"the",
"xml",
"feed"
] | train | https://github.com/RobinMalfait/l4-laracasts-feed/blob/26033545dc42dd15fa5c2ed64c28868cdd43f933/src/Malfaitrobin/Laracasts/Laracasts.php#L59-L67 |
RobinMalfait/l4-laracasts-feed | src/Malfaitrobin/Laracasts/Laracasts.php | Laracasts.getXML | protected function getXML()
{
$key = 'xml_' . md5($this->url); // Everybody loves md5!
if ($this->cache->has($key)) {
$this->xml = $this->cache->get($key);
} else {
$this->xml = $this->fetchXML();
$this->xml = $this->changeLinkElements($this->xml);
... | php | protected function getXML()
{
$key = 'xml_' . md5($this->url); // Everybody loves md5!
if ($this->cache->has($key)) {
$this->xml = $this->cache->get($key);
} else {
$this->xml = $this->fetchXML();
$this->xml = $this->changeLinkElements($this->xml);
... | [
"protected",
"function",
"getXML",
"(",
")",
"{",
"$",
"key",
"=",
"'xml_'",
".",
"md5",
"(",
"$",
"this",
"->",
"url",
")",
";",
"// Everybody loves md5!",
"if",
"(",
"$",
"this",
"->",
"cache",
"->",
"has",
"(",
"$",
"key",
")",
")",
"{",
"$",
... | Get the xml from the server, and cache the result
@return void | [
"Get",
"the",
"xml",
"from",
"the",
"server",
"and",
"cache",
"the",
"result"
] | train | https://github.com/RobinMalfait/l4-laracasts-feed/blob/26033545dc42dd15fa5c2ed64c28868cdd43f933/src/Malfaitrobin/Laracasts/Laracasts.php#L84-L97 |
askupasoftware/amarkal | Autoloader.php | Autoloader.autoload | public static function autoload( $class )
{
// Verify that the base namespace is Amarkal
if (0 !== strpos($class, __NAMESPACE__)) {
return;
}
// UI classes
if( strpos( $class, "Amarkal\UI\Components" ) === 0 )
{
$class .= "\controller";
... | php | public static function autoload( $class )
{
// Verify that the base namespace is Amarkal
if (0 !== strpos($class, __NAMESPACE__)) {
return;
}
// UI classes
if( strpos( $class, "Amarkal\UI\Components" ) === 0 )
{
$class .= "\controller";
... | [
"public",
"static",
"function",
"autoload",
"(",
"$",
"class",
")",
"{",
"// Verify that the base namespace is Amarkal",
"if",
"(",
"0",
"!==",
"strpos",
"(",
"$",
"class",
",",
"__NAMESPACE__",
")",
")",
"{",
"return",
";",
"}",
"// UI classes",
"if",
"(",
... | Loads the given class or interface
@param string $class The name of the class
@return null|boolean True/false if class was loaded | [
"Loads",
"the",
"given",
"class",
"or",
"interface"
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Autoloader.php#L36-L65 |
askupasoftware/amarkal | Autoloader.php | Autoloader.register_assets | static function register_assets()
{
\wp_enqueue_script( 'jquery' );
\wp_enqueue_script( 'jquery-ui' );
\wp_enqueue_script( 'jquery-ui-datepicker' );
\wp_enqueue_script( 'jquery-ui-spinner' );
\wp_enqueue_script( 'jquery-ui-slider' );
\wp_enqueue_script( 'jquery-u... | php | static function register_assets()
{
\wp_enqueue_script( 'jquery' );
\wp_enqueue_script( 'jquery-ui' );
\wp_enqueue_script( 'jquery-ui-datepicker' );
\wp_enqueue_script( 'jquery-ui-spinner' );
\wp_enqueue_script( 'jquery-ui-slider' );
\wp_enqueue_script( 'jquery-u... | [
"static",
"function",
"register_assets",
"(",
")",
"{",
"\\",
"wp_enqueue_script",
"(",
"'jquery'",
")",
";",
"\\",
"wp_enqueue_script",
"(",
"'jquery-ui'",
")",
";",
"\\",
"wp_enqueue_script",
"(",
"'jquery-ui-datepicker'",
")",
";",
"\\",
"wp_enqueue_script",
"(... | Register Amarkal Scripts and Stylesheets | [
"Register",
"Amarkal",
"Scripts",
"and",
"Stylesheets"
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Autoloader.php#L70-L87 |
jfusion/org.jfusion.framework | src/Plugin/Admin.php | Admin.getDefaultUsergroup | function getDefaultUsergroup()
{
$usergroups = Groups::get($this->getJname(), true);
$groups = array();
if ($usergroups !== null) {
$list = $this->getUsergroupList();
foreach ($list as $group) {
if(in_array($group->id, $usergroups)){
$groups[] = $group... | php | function getDefaultUsergroup()
{
$usergroups = Groups::get($this->getJname(), true);
$groups = array();
if ($usergroups !== null) {
$list = $this->getUsergroupList();
foreach ($list as $group) {
if(in_array($group->id, $usergroups)){
$groups[] = $group... | [
"function",
"getDefaultUsergroup",
"(",
")",
"{",
"$",
"usergroups",
"=",
"Groups",
"::",
"get",
"(",
"$",
"this",
"->",
"getJname",
"(",
")",
",",
"true",
")",
";",
"$",
"groups",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"usergroups",
"!==",
"... | Function used to display the default usergroup in the JFusion plugin overview
@return array Default usergroup name | [
"Function",
"used",
"to",
"display",
"the",
"default",
"usergroup",
"in",
"the",
"JFusion",
"plugin",
"overview"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Plugin/Admin.php#L89-L103 |
jfusion/org.jfusion.framework | src/Plugin/Admin.php | Admin.checkConfig | function checkConfig()
{
//for joomla_int check to see if the source_url does not equal the default
try {
$db = Factory::getDatabase($this->getJname());
} catch (Exception $e) {
throw new RuntimeException(Text::_('NO_DATABASE') . ' : ' . $e->getMessage());
}
try {
$jdb... | php | function checkConfig()
{
//for joomla_int check to see if the source_url does not equal the default
try {
$db = Factory::getDatabase($this->getJname());
} catch (Exception $e) {
throw new RuntimeException(Text::_('NO_DATABASE') . ' : ' . $e->getMessage());
}
try {
$jdb... | [
"function",
"checkConfig",
"(",
")",
"{",
"//for joomla_int check to see if the source_url does not equal the default",
"try",
"{",
"$",
"db",
"=",
"Factory",
"::",
"getDatabase",
"(",
"$",
"this",
"->",
"getJname",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exceptio... | Function that checks if the plugin has a valid config
@throws RuntimeException
@return boolean return true for success false for error, if you want a message to be included you need to use throw. | [
"Function",
"that",
"checks",
"if",
"the",
"plugin",
"has",
"a",
"valid",
"config"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Plugin/Admin.php#L143-L208 |
jfusion/org.jfusion.framework | src/Plugin/Admin.php | Admin.debugConfig | function debugConfig()
{
$jname = $this->getJname();
//get registration status
$new_registration = $this->allowRegistration();
if ($new_registration) {
$plugins = Framework::getSlaves();
foreach ($plugins as $plugin) {
if ($plugin->name == $jname) {
Framework::raise(L... | php | function debugConfig()
{
$jname = $this->getJname();
//get registration status
$new_registration = $this->allowRegistration();
if ($new_registration) {
$plugins = Framework::getSlaves();
foreach ($plugins as $plugin) {
if ($plugin->name == $jname) {
Framework::raise(L... | [
"function",
"debugConfig",
"(",
")",
"{",
"$",
"jname",
"=",
"$",
"this",
"->",
"getJname",
"(",
")",
";",
"//get registration status",
"$",
"new_registration",
"=",
"$",
"this",
"->",
"allowRegistration",
"(",
")",
";",
"if",
"(",
"$",
"new_registration",
... | Function that checks if the plugin has a valid config
jerror is used for output
@return void | [
"Function",
"that",
"checks",
"if",
"the",
"plugin",
"has",
"a",
"valid",
"config",
"jerror",
"is",
"used",
"for",
"output"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Plugin/Admin.php#L234-L287 |
jfusion/org.jfusion.framework | src/Plugin/Admin.php | Admin.readFile | function readFile($file)
{
$fh = @fopen($file, 'r');
$lines = false;
if ($fh !== false) {
$lines = array();
while (!feof($fh)) {
$lines[] = fgets($fh);
}
fclose($fh);
}
return $lines;
} | php | function readFile($file)
{
$fh = @fopen($file, 'r');
$lines = false;
if ($fh !== false) {
$lines = array();
while (!feof($fh)) {
$lines[] = fgets($fh);
}
fclose($fh);
}
return $lines;
} | [
"function",
"readFile",
"(",
"$",
"file",
")",
"{",
"$",
"fh",
"=",
"@",
"fopen",
"(",
"$",
"file",
",",
"'r'",
")",
";",
"$",
"lines",
"=",
"false",
";",
"if",
"(",
"$",
"fh",
"!==",
"false",
")",
"{",
"$",
"lines",
"=",
"array",
"(",
")",
... | read a given file (use to read config files)
@param $file
@return bool|array returns false or file content | [
"read",
"a",
"given",
"file",
"(",
"use",
"to",
"read",
"config",
"files",
")"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Plugin/Admin.php#L365-L378 |
jfusion/org.jfusion.framework | src/Plugin/Admin.php | Admin.saveParameters | final public function saveParameters($post, $wizard = false)
{
$jname = $this->getJname();
$result = false;
try {
if (!empty($jname)) {
$db = Factory::getDBO();
if (isset($post['source_url'])) {
//check for trailing slash in URL, in order for us not to worry about it later
$post['source_pat... | php | final public function saveParameters($post, $wizard = false)
{
$jname = $this->getJname();
$result = false;
try {
if (!empty($jname)) {
$db = Factory::getDBO();
if (isset($post['source_url'])) {
//check for trailing slash in URL, in order for us not to worry about it later
$post['source_pat... | [
"final",
"public",
"function",
"saveParameters",
"(",
"$",
"post",
",",
"$",
"wizard",
"=",
"false",
")",
"{",
"$",
"jname",
"=",
"$",
"this",
"->",
"getJname",
"(",
")",
";",
"$",
"result",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"!",
"empty",
... | Saves the posted JFusion component variables
@param array $post Array of JFusion plugin parameters posted to the JFusion component
@param boolean $wizard Notes if function was called by wizardresult();
@return boolean returns true if successful and false if an error occurred | [
"Saves",
"the",
"posted",
"JFusion",
"component",
"variables"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Plugin/Admin.php#L402-L472 |
austinkregel/Warden | src/Warden/Warden.php | Warden.clearInput | public static function clearInput($input)
{
if (is_array($input)) {
foreach ($input as $key => $value) {
if (!isset($value) || $value === '') {
unset($input[$key]);
}
}
return $input;
}
return $input;
... | php | public static function clearInput($input)
{
if (is_array($input)) {
foreach ($input as $key => $value) {
if (!isset($value) || $value === '') {
unset($input[$key]);
}
}
return $input;
}
return $input;
... | [
"public",
"static",
"function",
"clearInput",
"(",
"$",
"input",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"input",
")",
")",
"{",
"foreach",
"(",
"$",
"input",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
... | This will look through the input and remove any unset values.
@param $input
@return mixed | [
"This",
"will",
"look",
"through",
"the",
"input",
"and",
"remove",
"any",
"unset",
"values",
"."
] | train | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Warden.php#L16-L29 |
austinkregel/Warden | src/Warden/Warden.php | Warden.apiRoutes | public static function apiRoutes()
{
Route::group([
'namespace' => 'Kregel\\Warden\\Http\\Controllers',
'prefix' => config('kregel.warden.route').'/api/v1.0',
'as' => 'warden::api.',
'middleware' => config('kregel.warden.auth.middleware_api'),
... | php | public static function apiRoutes()
{
Route::group([
'namespace' => 'Kregel\\Warden\\Http\\Controllers',
'prefix' => config('kregel.warden.route').'/api/v1.0',
'as' => 'warden::api.',
'middleware' => config('kregel.warden.auth.middleware_api'),
... | [
"public",
"static",
"function",
"apiRoutes",
"(",
")",
"{",
"Route",
"::",
"group",
"(",
"[",
"'namespace'",
"=>",
"'Kregel\\\\Warden\\\\Http\\\\Controllers'",
",",
"'prefix'",
"=>",
"config",
"(",
"'kregel.warden.route'",
")",
".",
"'/api/v1.0'",
",",
"'as'",
"=>... | Define the api routes more dynamically. | [
"Define",
"the",
"api",
"routes",
"more",
"dynamically",
"."
] | train | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Warden.php#L45-L71 |
austinkregel/Warden | src/Warden/Warden.php | Warden.webRoutes | public static function webRoutes()
{
Route::group([
'namespace' => 'Kregel\\Warden\\Http\\Controllers',
'prefix' => config('kregel.warden.route'),
'as' => 'warden::',
'middleware' => config('kregel.warden.auth.middleware'),
], function ($r... | php | public static function webRoutes()
{
Route::group([
'namespace' => 'Kregel\\Warden\\Http\\Controllers',
'prefix' => config('kregel.warden.route'),
'as' => 'warden::',
'middleware' => config('kregel.warden.auth.middleware'),
], function ($r... | [
"public",
"static",
"function",
"webRoutes",
"(",
")",
"{",
"Route",
"::",
"group",
"(",
"[",
"'namespace'",
"=>",
"'Kregel\\\\Warden\\\\Http\\\\Controllers'",
",",
"'prefix'",
"=>",
"config",
"(",
"'kregel.warden.route'",
")",
",",
"'as'",
"=>",
"'warden::'",
","... | Define the web routes more dynamically. | [
"Define",
"the",
"web",
"routes",
"more",
"dynamically",
"."
] | train | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/Warden.php#L76-L92 |
ARCANEDEV/Agent | src/AgentServiceProvider.php | AgentServiceProvider.register | public function register()
{
parent::register();
$this->singleton(Contracts\Agent::class, function ($app) {
/** @var \Illuminate\Http\Request $request */
$request = $app['request'];
return new Agent($request->server->all());
});
} | php | public function register()
{
parent::register();
$this->singleton(Contracts\Agent::class, function ($app) {
/** @var \Illuminate\Http\Request $request */
$request = $app['request'];
return new Agent($request->server->all());
});
} | [
"public",
"function",
"register",
"(",
")",
"{",
"parent",
"::",
"register",
"(",
")",
";",
"$",
"this",
"->",
"singleton",
"(",
"Contracts",
"\\",
"Agent",
"::",
"class",
",",
"function",
"(",
"$",
"app",
")",
"{",
"/** @var \\Illuminate\\Http\\Request $r... | Register the service provider. | [
"Register",
"the",
"service",
"provider",
"."
] | train | https://github.com/ARCANEDEV/Agent/blob/74a3aff7830463d3cc31afdaf6ec89f2e5bf3468/src/AgentServiceProvider.php#L33-L43 |
Double-Opt-in/php-client-api | src/Client/Commands/Responses/Models/Action.php | Action.createFromStdClass | public static function createFromStdClass(stdClass $class)
{
$hash = isset($class->hash) ? $class->hash : null;
$scope = isset($class->scope) ? $class->scope : null;
$action = isset($class->action) ? $class->action : null;
$data = isset($class->data) ? $class->data : null;
$state = isset($class->state) ? $cl... | php | public static function createFromStdClass(stdClass $class)
{
$hash = isset($class->hash) ? $class->hash : null;
$scope = isset($class->scope) ? $class->scope : null;
$action = isset($class->action) ? $class->action : null;
$data = isset($class->data) ? $class->data : null;
$state = isset($class->state) ? $cl... | [
"public",
"static",
"function",
"createFromStdClass",
"(",
"stdClass",
"$",
"class",
")",
"{",
"$",
"hash",
"=",
"isset",
"(",
"$",
"class",
"->",
"hash",
")",
"?",
"$",
"class",
"->",
"hash",
":",
"null",
";",
"$",
"scope",
"=",
"isset",
"(",
"$",
... | creates from a stdClass
@param stdClass $class
@return \DoubleOptIn\ClientApi\Client\Commands\Responses\Models\Action | [
"creates",
"from",
"a",
"stdClass"
] | train | https://github.com/Double-Opt-in/php-client-api/blob/2f17da58ec20a408bbd55b2cdd053bc689f995f4/src/Client/Commands/Responses/Models/Action.php#L99-L111 |
2amigos/yiifoundation | helpers/Foundation.php | Foundation.register | public static function register($useZepto = false, $ie8Support = false)
{
static::registerCoreCss();
static::registerCoreScripts($useZepto);
if ($ie8Support)
static::registerBlockGridIeSupport();
} | php | public static function register($useZepto = false, $ie8Support = false)
{
static::registerCoreCss();
static::registerCoreScripts($useZepto);
if ($ie8Support)
static::registerBlockGridIeSupport();
} | [
"public",
"static",
"function",
"register",
"(",
"$",
"useZepto",
"=",
"false",
",",
"$",
"ie8Support",
"=",
"false",
")",
"{",
"static",
"::",
"registerCoreCss",
"(",
")",
";",
"static",
"::",
"registerCoreScripts",
"(",
"$",
"useZepto",
")",
";",
"if",
... | Registers all core css and js scripts for foundation | [
"Registers",
"all",
"core",
"css",
"and",
"js",
"scripts",
"for",
"foundation"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L27-L34 |
2amigos/yiifoundation | helpers/Foundation.php | Foundation.registerCoreScripts | public static function registerCoreScripts(
$useZepto = false,
$minimized = true,
$position = \CClientScript::POS_END
) {
/** @var CClientScript $cs */
$cs = \Yii::app()->getClientScript();
if ($useZepto) {
$cs->registerScriptFile(static::getAssetsUrl() .... | php | public static function registerCoreScripts(
$useZepto = false,
$minimized = true,
$position = \CClientScript::POS_END
) {
/** @var CClientScript $cs */
$cs = \Yii::app()->getClientScript();
if ($useZepto) {
$cs->registerScriptFile(static::getAssetsUrl() .... | [
"public",
"static",
"function",
"registerCoreScripts",
"(",
"$",
"useZepto",
"=",
"false",
",",
"$",
"minimized",
"=",
"true",
",",
"$",
"position",
"=",
"\\",
"CClientScript",
"::",
"POS_END",
")",
"{",
"/** @var CClientScript $cs */",
"$",
"cs",
"=",
"\\",
... | Registers jQuery and Foundation JavaScript.
@param bool $useZepto whether to use zepto or not
@param bool $minimized whether to register full minimized library or not
@param int $position the position to register the core script | [
"Registers",
"jQuery",
"and",
"Foundation",
"JavaScript",
"."
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L42-L62 |
2amigos/yiifoundation | helpers/Foundation.php | Foundation.isCoreRegistered | public static function isCoreRegistered($minimized = true, $position = \CClientScript::POS_END)
{
$script = $minimized
? '/js/foundation.min.js'
: '/js/foundation/foundation.js';
return \Yii::app()->getClientScript()
->isScriptFileRegistered(static::getAssetsUrl(... | php | public static function isCoreRegistered($minimized = true, $position = \CClientScript::POS_END)
{
$script = $minimized
? '/js/foundation.min.js'
: '/js/foundation/foundation.js';
return \Yii::app()->getClientScript()
->isScriptFileRegistered(static::getAssetsUrl(... | [
"public",
"static",
"function",
"isCoreRegistered",
"(",
"$",
"minimized",
"=",
"true",
",",
"$",
"position",
"=",
"\\",
"CClientScript",
"::",
"POS_END",
")",
"{",
"$",
"script",
"=",
"$",
"minimized",
"?",
"'/js/foundation.min.js'",
":",
"'/js/foundation/found... | Checks whether the core script has been registered or not
@param bool $minimized whether to check full minimized library or not
@param int $position the position to register the core script
@return bool | [
"Checks",
"whether",
"the",
"core",
"script",
"has",
"been",
"registered",
"or",
"not"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L70-L78 |
2amigos/yiifoundation | helpers/Foundation.php | Foundation.registerFonts | public static function registerFonts($fonts = array())
{
if (empty($fonts))
return;
foreach ($fonts as $font) {
Icon::registerIconFontSet($font);
}
} | php | public static function registerFonts($fonts = array())
{
if (empty($fonts))
return;
foreach ($fonts as $font) {
Icon::registerIconFontSet($font);
}
} | [
"public",
"static",
"function",
"registerFonts",
"(",
"$",
"fonts",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"fonts",
")",
")",
"return",
";",
"foreach",
"(",
"$",
"fonts",
"as",
"$",
"font",
")",
"{",
"Icon",
"::",
"register... | Registers foundation fonts
@param mixed $fonts the array or string name to register. | [
"Registers",
"foundation",
"fonts"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L84-L92 |
2amigos/yiifoundation | helpers/Foundation.php | Foundation.registerCoreCss | public static function registerCoreCss()
{
$fileName = \YII_DEBUG ? 'foundation.css' : 'foundation.min.css';
\Yii::app()->clientScript->registerCssFile(static::getAssetsUrl() . '/css/normalize.css');
\Yii::app()->clientScript->registerCssFile(static::getAssetsUrl() . '/css/' . $fileName);
... | php | public static function registerCoreCss()
{
$fileName = \YII_DEBUG ? 'foundation.css' : 'foundation.min.css';
\Yii::app()->clientScript->registerCssFile(static::getAssetsUrl() . '/css/normalize.css');
\Yii::app()->clientScript->registerCssFile(static::getAssetsUrl() . '/css/' . $fileName);
... | [
"public",
"static",
"function",
"registerCoreCss",
"(",
")",
"{",
"$",
"fileName",
"=",
"\\",
"YII_DEBUG",
"?",
"'foundation.css'",
":",
"'foundation.min.css'",
";",
"\\",
"Yii",
"::",
"app",
"(",
")",
"->",
"clientScript",
"->",
"registerCssFile",
"(",
"stati... | Registers the Foundation CSS. | [
"Registers",
"the",
"Foundation",
"CSS",
"."
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L97-L103 |
2amigos/yiifoundation | helpers/Foundation.php | Foundation.getAssetsUrl | public static function getAssetsUrl($forceCopyAssets = false, $cdn = false)
{
if (!isset(static::$assetsUrl)) {
if ($cdn) {
static::$assetsUrl = '//cdn.jsdelivr.net/foundation/4.3.1/';
} else {
$assetsPath = static::getAssetsPath();
... | php | public static function getAssetsUrl($forceCopyAssets = false, $cdn = false)
{
if (!isset(static::$assetsUrl)) {
if ($cdn) {
static::$assetsUrl = '//cdn.jsdelivr.net/foundation/4.3.1/';
} else {
$assetsPath = static::getAssetsPath();
... | [
"public",
"static",
"function",
"getAssetsUrl",
"(",
"$",
"forceCopyAssets",
"=",
"false",
",",
"$",
"cdn",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"assetsUrl",
")",
")",
"{",
"if",
"(",
"$",
"cdn",
")",
"{",
"sta... | Returns the url to the published assets folder.
@param bool $forceCopyAssets whether to force assets registration or not
@param bool $cdn whether to use CDN version or not
@return string the url. | [
"Returns",
"the",
"url",
"to",
"the",
"published",
"assets",
"folder",
"."
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L111-L122 |
2amigos/yiifoundation | helpers/Foundation.php | Foundation.registerPlugin | public static function registerPlugin($name, $selector, $options = array(), $position = \CClientScript::POS_READY)
{
$options = !empty($options) ? \CJavaScript::encode($options) : '';
$script = ";jQuery('{$selector}').{$name}({$options});";
\Yii::app()->clientScript->registerScript(static::... | php | public static function registerPlugin($name, $selector, $options = array(), $position = \CClientScript::POS_READY)
{
$options = !empty($options) ? \CJavaScript::encode($options) : '';
$script = ";jQuery('{$selector}').{$name}({$options});";
\Yii::app()->clientScript->registerScript(static::... | [
"public",
"static",
"function",
"registerPlugin",
"(",
"$",
"name",
",",
"$",
"selector",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"position",
"=",
"\\",
"CClientScript",
"::",
"POS_READY",
")",
"{",
"$",
"options",
"=",
"!",
"empty",
"("... | Registers a specific plugin using the given selector and options.
@param string $name the plugin name.
@param string $selector the CSS selector.
@param array $options the JavaScript options for the plugin.
@param int $position the position of the JavaScript code. | [
"Registers",
"a",
"specific",
"plugin",
"using",
"the",
"given",
"selector",
"and",
"options",
"."
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L140-L145 |
2amigos/yiifoundation | helpers/Foundation.php | Foundation.registerScriptFile | public static function registerScriptFile($asset, $position = \CClientScript::POS_END)
{
\Yii::app()->clientScript->registerScriptFile(static::getAssetsUrl() . "/{$asset}", $position);
} | php | public static function registerScriptFile($asset, $position = \CClientScript::POS_END)
{
\Yii::app()->clientScript->registerScriptFile(static::getAssetsUrl() . "/{$asset}", $position);
} | [
"public",
"static",
"function",
"registerScriptFile",
"(",
"$",
"asset",
",",
"$",
"position",
"=",
"\\",
"CClientScript",
"::",
"POS_END",
")",
"{",
"\\",
"Yii",
"::",
"app",
"(",
")",
"->",
"clientScript",
"->",
"registerScriptFile",
"(",
"static",
"::",
... | Registers a specific js assets file
@param string $asset the assets file (ie 'foundation/foundation.abide.js'
@param int $position the position where the script should be registered on the page | [
"Registers",
"a",
"specific",
"js",
"assets",
"file"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L152-L155 |
2amigos/yiifoundation | helpers/Foundation.php | Foundation.registerEvents | public static function registerEvents($selector, $events, $position = \CClientScript::POS_READY)
{
if (empty($events)) {
return;
}
$script = '';
foreach ($events as $name => $handler) {
$handler = ($handler instanceof \CJavaScriptExpression)
?... | php | public static function registerEvents($selector, $events, $position = \CClientScript::POS_READY)
{
if (empty($events)) {
return;
}
$script = '';
foreach ($events as $name => $handler) {
$handler = ($handler instanceof \CJavaScriptExpression)
?... | [
"public",
"static",
"function",
"registerEvents",
"(",
"$",
"selector",
",",
"$",
"events",
",",
"$",
"position",
"=",
"\\",
"CClientScript",
"::",
"POS_READY",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"events",
")",
")",
"{",
"return",
";",
"}",
"$",
... | Registers events using the given selector.
@param string $selector the CSS selector.
@param string[] $events the JavaScript event configuration (name=>handler).
@param int $position the position of the JavaScript code. | [
"Registers",
"events",
"using",
"the",
"given",
"selector",
"."
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L163-L178 |
2amigos/yiifoundation | helpers/Foundation.php | Foundation.registerBlockGridIeSupport | public static function registerBlockGridIeSupport($position = \CClientScript::POS_END)
{
\Yii::app()->getClientScript()
->registerScript(
__CLASS__,
"(function($){ $(function(){
$('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'both'});
... | php | public static function registerBlockGridIeSupport($position = \CClientScript::POS_END)
{
\Yii::app()->getClientScript()
->registerScript(
__CLASS__,
"(function($){ $(function(){
$('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'both'});
... | [
"public",
"static",
"function",
"registerBlockGridIeSupport",
"(",
"$",
"position",
"=",
"\\",
"CClientScript",
"::",
"POS_END",
")",
"{",
"\\",
"Yii",
"::",
"app",
"(",
")",
"->",
"getClientScript",
"(",
")",
"->",
"registerScript",
"(",
"__CLASS__",
",",
"... | Registers block-grid support for ie8 if set by its `ie8Support` attribute.
@param int $position the position to render the script | [
"Registers",
"block",
"-",
"grid",
"support",
"for",
"ie8",
"if",
"set",
"by",
"its",
"ie8Support",
"attribute",
"."
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Foundation.php#L193-L207 |
titon/db | src/Titon/Db/Query/SubQuery.php | SubQuery.withFilter | public function withFilter($filter) {
if (!in_array($filter, [self::ALL, self::ANY, self::SOME, self::EXISTS, self::NOT_EXISTS, self::IN, self::NOT_IN], true)) {
throw new InvalidArgumentException('Invalid filter type for sub-query');
}
$this->_filter = $filter;
return $thi... | php | public function withFilter($filter) {
if (!in_array($filter, [self::ALL, self::ANY, self::SOME, self::EXISTS, self::NOT_EXISTS, self::IN, self::NOT_IN], true)) {
throw new InvalidArgumentException('Invalid filter type for sub-query');
}
$this->_filter = $filter;
return $thi... | [
"public",
"function",
"withFilter",
"(",
"$",
"filter",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"filter",
",",
"[",
"self",
"::",
"ALL",
",",
"self",
"::",
"ANY",
",",
"self",
"::",
"SOME",
",",
"self",
"::",
"EXISTS",
",",
"self",
"::",
... | Set the filter type.
@param string $filter
@return $this
@throws \Titon\Db\Exception\InvalidArgumentException | [
"Set",
"the",
"filter",
"type",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/SubQuery.php#L53-L61 |
lmammino/e-foundation | src/Variation/Model/VariableTrait.php | VariableTrait.setVariants | public function setVariants(Collection $variants)
{
foreach ($variants as $variant) {
$this->addVariant($variant);
}
return $this;
} | php | public function setVariants(Collection $variants)
{
foreach ($variants as $variant) {
$this->addVariant($variant);
}
return $this;
} | [
"public",
"function",
"setVariants",
"(",
"Collection",
"$",
"variants",
")",
"{",
"foreach",
"(",
"$",
"variants",
"as",
"$",
"variant",
")",
"{",
"$",
"this",
"->",
"addVariant",
"(",
"$",
"variant",
")",
";",
"}",
"return",
"$",
"this",
";",
"}"
] | Set variants
@param Collection $variants
@return $this | [
"Set",
"variants"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/VariableTrait.php#L51-L58 |
lmammino/e-foundation | src/Variation/Model/VariableTrait.php | VariableTrait.setMasterVariant | public function setMasterVariant(VariantInterface $masterVariant)
{
$masterVariant->setMaster(true);
/** @var VariantInterface $variant */
foreach ($this->variants as $variant) {
if ($variant->isMaster() && $variant !== $masterVariant) {
$variant->setMaster(false... | php | public function setMasterVariant(VariantInterface $masterVariant)
{
$masterVariant->setMaster(true);
/** @var VariantInterface $variant */
foreach ($this->variants as $variant) {
if ($variant->isMaster() && $variant !== $masterVariant) {
$variant->setMaster(false... | [
"public",
"function",
"setMasterVariant",
"(",
"VariantInterface",
"$",
"masterVariant",
")",
"{",
"$",
"masterVariant",
"->",
"setMaster",
"(",
"true",
")",
";",
"/** @var VariantInterface $variant */",
"foreach",
"(",
"$",
"this",
"->",
"variants",
"as",
"$",
"v... | Set the master variant
@param VariantInterface $masterVariant
@return $this | [
"Set",
"the",
"master",
"variant"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/VariableTrait.php#L84-L101 |
lmammino/e-foundation | src/Variation/Model/VariableTrait.php | VariableTrait.addVariant | public function addVariant(VariantInterface $variant)
{
if (!$this->hasVariant($variant)) {
$variant->setObject($this);
$this->variants->add($variant);
}
return $this;
} | php | public function addVariant(VariantInterface $variant)
{
if (!$this->hasVariant($variant)) {
$variant->setObject($this);
$this->variants->add($variant);
}
return $this;
} | [
"public",
"function",
"addVariant",
"(",
"VariantInterface",
"$",
"variant",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasVariant",
"(",
"$",
"variant",
")",
")",
"{",
"$",
"variant",
"->",
"setObject",
"(",
"$",
"this",
")",
";",
"$",
"this",
"-... | Adds a variant
@param VariantInterface $variant
@return $this | [
"Adds",
"a",
"variant"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/VariableTrait.php#L120-L128 |
lmammino/e-foundation | src/Variation/Model/VariableTrait.php | VariableTrait.removeVariant | public function removeVariant(VariantInterface $variant)
{
if ($this->hasVariant($variant)) {
$variant->setObject(null);
$this->variants->removeElement($variant);
}
return $this;
} | php | public function removeVariant(VariantInterface $variant)
{
if ($this->hasVariant($variant)) {
$variant->setObject(null);
$this->variants->removeElement($variant);
}
return $this;
} | [
"public",
"function",
"removeVariant",
"(",
"VariantInterface",
"$",
"variant",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasVariant",
"(",
"$",
"variant",
")",
")",
"{",
"$",
"variant",
"->",
"setObject",
"(",
"null",
")",
";",
"$",
"this",
"->",
"vari... | Removes a variant
@param VariantInterface $variant
@return $this | [
"Removes",
"a",
"variant"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/VariableTrait.php#L137-L145 |
lmammino/e-foundation | src/Variation/Model/VariableTrait.php | VariableTrait.setVariabilityOptions | public function setVariabilityOptions(Collection $variabilityOptions)
{
foreach ($variabilityOptions as $variabilityOption) {
$this->addVariabilityOption($variabilityOption);
}
return $this;
} | php | public function setVariabilityOptions(Collection $variabilityOptions)
{
foreach ($variabilityOptions as $variabilityOption) {
$this->addVariabilityOption($variabilityOption);
}
return $this;
} | [
"public",
"function",
"setVariabilityOptions",
"(",
"Collection",
"$",
"variabilityOptions",
")",
"{",
"foreach",
"(",
"$",
"variabilityOptions",
"as",
"$",
"variabilityOption",
")",
"{",
"$",
"this",
"->",
"addVariabilityOption",
"(",
"$",
"variabilityOption",
")",... | Sets all variability options
@param Collection $variabilityOptions
@return $this | [
"Sets",
"all",
"variability",
"options"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/VariableTrait.php#L186-L193 |
lmammino/e-foundation | src/Variation/Model/VariableTrait.php | VariableTrait.addVariabilityOption | public function addVariabilityOption(OptionInterface $variabilityOption)
{
if (!$this->hasVariabilityOption($variabilityOption)) {
$this->variabilityOptions->add($variabilityOption);
}
return $this;
} | php | public function addVariabilityOption(OptionInterface $variabilityOption)
{
if (!$this->hasVariabilityOption($variabilityOption)) {
$this->variabilityOptions->add($variabilityOption);
}
return $this;
} | [
"public",
"function",
"addVariabilityOption",
"(",
"OptionInterface",
"$",
"variabilityOption",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasVariabilityOption",
"(",
"$",
"variabilityOption",
")",
")",
"{",
"$",
"this",
"->",
"variabilityOptions",
"->",
"add... | Adds a given variability option
@param OptionInterface $variabilityOption
@return $this | [
"Adds",
"a",
"given",
"variability",
"option"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/VariableTrait.php#L202-L209 |
lmammino/e-foundation | src/Variation/Model/VariableTrait.php | VariableTrait.removeVariabilityOption | public function removeVariabilityOption(OptionInterface $variabilityOption)
{
if ($this->hasVariabilityOption($variabilityOption)) {
$this->variabilityOptions->removeElement($variabilityOption);
}
return $this;
} | php | public function removeVariabilityOption(OptionInterface $variabilityOption)
{
if ($this->hasVariabilityOption($variabilityOption)) {
$this->variabilityOptions->removeElement($variabilityOption);
}
return $this;
} | [
"public",
"function",
"removeVariabilityOption",
"(",
"OptionInterface",
"$",
"variabilityOption",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasVariabilityOption",
"(",
"$",
"variabilityOption",
")",
")",
"{",
"$",
"this",
"->",
"variabilityOptions",
"->",
"removeE... | Removes a given variability option
@param OptionInterface $variabilityOption
@return $this | [
"Removes",
"a",
"given",
"variability",
"option"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Variation/Model/VariableTrait.php#L218-L225 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Adapter/EzPlatformAdapter.php | EzPlatformAdapter.setLogger | public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
$this->objectService->setLogger($logger);
$this->treeService->setLogger($logger);
} | php | public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
$this->objectService->setLogger($logger);
$this->treeService->setLogger($logger);
} | [
"public",
"function",
"setLogger",
"(",
"LoggerInterface",
"$",
"logger",
")",
"{",
"$",
"this",
"->",
"logger",
"=",
"$",
"logger",
";",
"$",
"this",
"->",
"objectService",
"->",
"setLogger",
"(",
"$",
"logger",
")",
";",
"$",
"this",
"->",
"treeService... | {@inheritdoc} | [
"{"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Adapter/EzPlatformAdapter.php#L95-L100 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Adapter/EzPlatformAdapter.php | EzPlatformAdapter.send | public function send(Request $request)
{
$this->repository->beginTransaction();
if ($this->logger) {
$this->treeService->setLogger($this->logger);
$this->objectService->setLogger($this->logger);
}
$response = new Response();
$objects = array();
... | php | public function send(Request $request)
{
$this->repository->beginTransaction();
if ($this->logger) {
$this->treeService->setLogger($this->logger);
$this->objectService->setLogger($this->logger);
}
$response = new Response();
$objects = array();
... | [
"public",
"function",
"send",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"repository",
"->",
"beginTransaction",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"logger",
")",
"{",
"$",
"this",
"->",
"treeService",
"->",
"setLogger",
"("... | {@inheritdoc} | [
"{"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Adapter/EzPlatformAdapter.php#L105-L135 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Adapter/EzPlatformAdapter.php | EzPlatformAdapter.executeAction | protected function executeAction(ObjectInterface $object, AbstractRepositoryService $service)
{
if (is_a($object, EzPlatformObject::class)) {
/** @var EzPlatformObject $object */
switch ($object->getAction()) {
case Action::CREATEORUPDATE:
return $... | php | protected function executeAction(ObjectInterface $object, AbstractRepositoryService $service)
{
if (is_a($object, EzPlatformObject::class)) {
/** @var EzPlatformObject $object */
switch ($object->getAction()) {
case Action::CREATEORUPDATE:
return $... | [
"protected",
"function",
"executeAction",
"(",
"ObjectInterface",
"$",
"object",
",",
"AbstractRepositoryService",
"$",
"service",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"object",
",",
"EzPlatformObject",
"::",
"class",
")",
")",
"{",
"/** @var EzPlatformObject $o... | @param ObjectInterface $object
@param AbstractRepositoryService $service
@return ObjectInterface|null | [
"@param",
"ObjectInterface",
"$object",
"@param",
"AbstractRepositoryService",
"$service"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Adapter/EzPlatformAdapter.php#L143-L160 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Adapter/EzPlatformAdapter.php | EzPlatformAdapter.getService | protected function getService($object)
{
if ($object instanceof TreeObject) {
$service = $this->treeService;
} else {
$service = $this->objectService;
}
if ($this->options['current_user']) {
$service->setCurrentUser($this->options['current_user'])... | php | protected function getService($object)
{
if ($object instanceof TreeObject) {
$service = $this->treeService;
} else {
$service = $this->objectService;
}
if ($this->options['current_user']) {
$service->setCurrentUser($this->options['current_user'])... | [
"protected",
"function",
"getService",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"object",
"instanceof",
"TreeObject",
")",
"{",
"$",
"service",
"=",
"$",
"this",
"->",
"treeService",
";",
"}",
"else",
"{",
"$",
"service",
"=",
"$",
"this",
"->",
... | Decides which service to use, based on the type of $object given.
@param ObjectInterface $object
@return ContentTreeService|ObjectService | [
"Decides",
"which",
"service",
"to",
"use",
"based",
"on",
"the",
"type",
"of",
"$object",
"given",
"."
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Adapter/EzPlatformAdapter.php#L169-L182 |
yuncms/framework | src/console/controllers/UserController.php | UserController.actionCreate | public function actionCreate($email, $nickname, $password = null)
{
$user = new User(['scenario' => User::SCENARIO_CREATE, 'email' => $email, 'nickname' => $nickname, 'password' => $password]);
if ($user->createUser()) {
$this->stdout(Yii::t('yuncms', 'User has been created') . "!\n", Co... | php | public function actionCreate($email, $nickname, $password = null)
{
$user = new User(['scenario' => User::SCENARIO_CREATE, 'email' => $email, 'nickname' => $nickname, 'password' => $password]);
if ($user->createUser()) {
$this->stdout(Yii::t('yuncms', 'User has been created') . "!\n", Co... | [
"public",
"function",
"actionCreate",
"(",
"$",
"email",
",",
"$",
"nickname",
",",
"$",
"password",
"=",
"null",
")",
"{",
"$",
"user",
"=",
"new",
"User",
"(",
"[",
"'scenario'",
"=>",
"User",
"::",
"SCENARIO_CREATE",
",",
"'email'",
"=>",
"$",
"emai... | This command creates new user account. If password is not set, this command will generate new 8-char password.
After saving user to database, this command uses mailer component to send credentials (username and password) to
user via email.
@param string $email Email address
@param string $nickname Nickname
@param null... | [
"This",
"command",
"creates",
"new",
"user",
"account",
".",
"If",
"password",
"is",
"not",
"set",
"this",
"command",
"will",
"generate",
"new",
"8",
"-",
"char",
"password",
".",
"After",
"saving",
"user",
"to",
"database",
"this",
"command",
"uses",
"mai... | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/console/controllers/UserController.php#L30-L43 |
yuncms/framework | src/console/controllers/UserController.php | UserController.actionDelete | public function actionDelete($search)
{
if ($this->confirm(Yii::t('yuncms', 'Are you sure? Deleted user can not be restored'))) {
$user = User::findByEmailOrMobile($search);
if ($user === null) {
$this->stdout(Yii::t('yuncms', 'User is not found') . "\n", Console::FG_... | php | public function actionDelete($search)
{
if ($this->confirm(Yii::t('yuncms', 'Are you sure? Deleted user can not be restored'))) {
$user = User::findByEmailOrMobile($search);
if ($user === null) {
$this->stdout(Yii::t('yuncms', 'User is not found') . "\n", Console::FG_... | [
"public",
"function",
"actionDelete",
"(",
"$",
"search",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"confirm",
"(",
"Yii",
"::",
"t",
"(",
"'yuncms'",
",",
"'Are you sure? Deleted user can not be restored'",
")",
")",
")",
"{",
"$",
"user",
"=",
"User",
"::"... | Deletes a user.
@param string $search Email or username
@throws \Exception
@throws \Throwable
@throws \yii\db\StaleObjectException | [
"Deletes",
"a",
"user",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/console/controllers/UserController.php#L92-L106 |
lmammino/e-foundation | src/Order/Model/OrderAdjustment.php | OrderAdjustment.setAdjustable | public function setAdjustable(AdjustableInterface $adjustable = null)
{
$this->adjustable = $this->order = $adjustable;
return $this;
} | php | public function setAdjustable(AdjustableInterface $adjustable = null)
{
$this->adjustable = $this->order = $adjustable;
return $this;
} | [
"public",
"function",
"setAdjustable",
"(",
"AdjustableInterface",
"$",
"adjustable",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"adjustable",
"=",
"$",
"this",
"->",
"order",
"=",
"$",
"adjustable",
";",
"return",
"$",
"this",
";",
"}"
] | {@inheritDoc} | [
"{"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Order/Model/OrderAdjustment.php#L39-L44 |
TeamOffshoot/http | lib/Offshoot/HttpClient/CurlHttpClient.php | CurlHttpClient.makeRequest | protected function makeRequest($ch)
{
if ($this->hasHeaders()) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->getHttpHeaders());
}
$response = curl_exec($ch);
$error = curl_error($ch);
$code = curl_errno($ch);
if ($error) {
curl_close($ch);
... | php | protected function makeRequest($ch)
{
if ($this->hasHeaders()) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->getHttpHeaders());
}
$response = curl_exec($ch);
$error = curl_error($ch);
$code = curl_errno($ch);
if ($error) {
curl_close($ch);
... | [
"protected",
"function",
"makeRequest",
"(",
"$",
"ch",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasHeaders",
"(",
")",
")",
"{",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_HTTPHEADER",
",",
"$",
"this",
"->",
"getHttpHeaders",
"(",
")",
")",
";",
... | make the cURL request
@param resource $ch
@return mixed | [
"make",
"the",
"cURL",
"request"
] | train | https://github.com/TeamOffshoot/http/blob/e423486262913f131d6aef005eb087849b60f77f/lib/Offshoot/HttpClient/CurlHttpClient.php#L131-L151 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.