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 |
|---|---|---|---|---|---|---|---|---|---|---|
frdl/webfan | .ApplicationComposer/lib/frdl/xGlobal/fexe.php | fexe.stream_open | public function stream_open($url, $mode, $options = STREAM_REPORT_ERRORS, &$opened_path = null){
$u = parse_url($url);
$this->file = str_replace('/', DIRECTORY_SEPARATOR, $u['path']);
$this->file_offset = $u['port'];
$this->host = $u['host'];
$this->mode = $mode;
$this->IO = fopen... | php | public function stream_open($url, $mode, $options = STREAM_REPORT_ERRORS, &$opened_path = null){
$u = parse_url($url);
$this->file = str_replace('/', DIRECTORY_SEPARATOR, $u['path']);
$this->file_offset = $u['port'];
$this->host = $u['host'];
$this->mode = $mode;
$this->IO = fopen... | [
"public",
"function",
"stream_open",
"(",
"$",
"url",
",",
"$",
"mode",
",",
"$",
"options",
"=",
"STREAM_REPORT_ERRORS",
",",
"&",
"$",
"opened_path",
"=",
"null",
")",
"{",
"$",
"u",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"$",
"this",
"->",
... | webfan://namespace.vendor.applicationname.fexe:__COMPILER_HALT_OFFSET__/__FILE__
@param undefined $url
@param undefined $mode
@param undefined $options
@param undefined $opened_path
@return | [
"webfan",
":",
"//",
"namespace",
".",
"vendor",
".",
"applicationname",
".",
"fexe",
":",
"__COMPILER_HALT_OFFSET__",
"/",
"__FILE__",
"@param",
"undefined",
"$url",
"@param",
"undefined",
"$mode",
"@param",
"undefined",
"$options",
"@param",
"undefined",
"$opened_... | train | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/frdl/xGlobal/fexe.php#L394-L411 |
frdl/webfan | .ApplicationComposer/lib/frdl/xGlobal/fexe.php | fexe.read | public function read(&$data, $delimiters = '#', \closure $func, &$out = null){
$ti = new \frdl\common\TokenIterator($data, $delimiters);
foreach ($ti as $count => $token) {
$func($token);
}
return $this;
} | php | public function read(&$data, $delimiters = '#', \closure $func, &$out = null){
$ti = new \frdl\common\TokenIterator($data, $delimiters);
foreach ($ti as $count => $token) {
$func($token);
}
return $this;
} | [
"public",
"function",
"read",
"(",
"&",
"$",
"data",
",",
"$",
"delimiters",
"=",
"'#'",
",",
"\\",
"closure",
"$",
"func",
",",
"&",
"$",
"out",
"=",
"null",
")",
"{",
"$",
"ti",
"=",
"new",
"\\",
"frdl",
"\\",
"common",
"\\",
"TokenIterator",
"... | e.g.:
$data = $this->getFileData();
$this->read($data, '#', (function($token) use (&$out) {
$out.= trim($token).'<br />';
}));
echo $out;
@param undefined $data
@param undefined $delimiters
@param undefined $func
@return | [
"e",
".",
"g",
".",
":",
"$data",
"=",
"$this",
"-",
">",
"getFileData",
"()",
";",
"$this",
"-",
">",
"read",
"(",
"$data",
"#",
"(",
"function",
"(",
"$token",
")",
"use",
"(",
"&$out",
")",
"{",
"$out",
".",
"=",
"trim",
"(",
"$token",
")",
... | train | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/frdl/xGlobal/fexe.php#L615-L621 |
frdl/webfan | .ApplicationComposer/lib/frdl/xGlobal/fexe.php | fexe.getFileData | public function getFileData($file = null, $offset = null){
if(null === $file)$file = &$this->file;
if(null === $offset)$offset = $this->file_offset;
$this->IO = fopen($file, 'r');
fseek($this->IO, $offset);
try{
$this->raw = stream_get_contents($this->IO);
}catch(\Exception $e){
$th... | php | public function getFileData($file = null, $offset = null){
if(null === $file)$file = &$this->file;
if(null === $offset)$offset = $this->file_offset;
$this->IO = fopen($file, 'r');
fseek($this->IO, $offset);
try{
$this->raw = stream_get_contents($this->IO);
}catch(\Exception $e){
$th... | [
"public",
"function",
"getFileData",
"(",
"$",
"file",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"file",
")",
"$",
"file",
"=",
"&",
"$",
"this",
"->",
"file",
";",
"if",
"(",
"null",
"===",
"$",
"of... | read file from offset
@param undefined $file __FILE__
@param undefined $offset __COMPILER_HALT_OFFSET__
@return string | [
"read",
"file",
"from",
"offset"
] | train | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/frdl/xGlobal/fexe.php#L651-L664 |
frdl/webfan | .ApplicationComposer/lib/frdl/xGlobal/fexe.php | fexe.unserialize | final public function unserialize(&$var){
try{
$i=0;return $this->_unserialize($var,false,$i);
}catch(Exception $e) {
trigger_error($e->getMessage(). ' in '.__CLASS__.'::'.__METHOD__.' line '.__LINE__,E_USER_WARNING);
return;
}
} | php | final public function unserialize(&$var){
try{
$i=0;return $this->_unserialize($var,false,$i);
}catch(Exception $e) {
trigger_error($e->getMessage(). ' in '.__CLASS__.'::'.__METHOD__.' line '.__LINE__,E_USER_WARNING);
return;
}
} | [
"final",
"public",
"function",
"unserialize",
"(",
"&",
"$",
"var",
")",
"{",
"try",
"{",
"$",
"i",
"=",
"0",
";",
"return",
"$",
"this",
"->",
"_unserialize",
"(",
"$",
"var",
",",
"false",
",",
"$",
"i",
")",
";",
"}",
"catch",
"(",
"Exception"... | @component
bin
original class bserialize:
Copyright (c) 2009, PHPServer
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list ... | [
"@component",
"bin",
"original",
"class",
"bserialize",
":",
"Copyright",
"(",
"c",
")",
"2009",
"PHPServer",
"All",
"rights",
"reserved",
"."
] | train | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/frdl/xGlobal/fexe.php#L713-L721 |
zhouyl/mellivora | Mellivora/Database/Console/Migrations/RefreshCommand.php | RefreshCommand.runRollback | protected function runRollback($database, $path, $step, $force)
{
$this->call('migrate:rollback', [
'--database' => $database,
'--path' => $path,
'--step' => $step,
'--force' => $force,
]);
} | php | protected function runRollback($database, $path, $step, $force)
{
$this->call('migrate:rollback', [
'--database' => $database,
'--path' => $path,
'--step' => $step,
'--force' => $force,
]);
} | [
"protected",
"function",
"runRollback",
"(",
"$",
"database",
",",
"$",
"path",
",",
"$",
"step",
",",
"$",
"force",
")",
"{",
"$",
"this",
"->",
"call",
"(",
"'migrate:rollback'",
",",
"[",
"'--database'",
"=>",
"$",
"database",
",",
"'--path'",
"=>",
... | Run the rollback command.
@param string $database
@param string $path
@param bool $step
@param bool $force
@return void | [
"Run",
"the",
"rollback",
"command",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Console/Migrations/RefreshCommand.php#L82-L90 |
oroinc/OroLayoutComponent | Extension/Theme/Model/ThemeFactory.php | ThemeFactory.create | public function create($themeName, array $themeDefinition)
{
$theme = new Theme(
$themeName,
isset($themeDefinition['parent']) ? $themeDefinition['parent'] : null
);
$this->applyThemeProperties($theme, $themeDefinition);
if (isset($themeDefinition['config'])... | php | public function create($themeName, array $themeDefinition)
{
$theme = new Theme(
$themeName,
isset($themeDefinition['parent']) ? $themeDefinition['parent'] : null
);
$this->applyThemeProperties($theme, $themeDefinition);
if (isset($themeDefinition['config'])... | [
"public",
"function",
"create",
"(",
"$",
"themeName",
",",
"array",
"$",
"themeDefinition",
")",
"{",
"$",
"theme",
"=",
"new",
"Theme",
"(",
"$",
"themeName",
",",
"isset",
"(",
"$",
"themeDefinition",
"[",
"'parent'",
"]",
")",
"?",
"$",
"themeDefinit... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/Theme/Model/ThemeFactory.php#L10-L26 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | topic.sync | function sync()
{
global $db;
if(!$this->topic_id)
{
//topic does not exist yet
return;
}
sync('topic', 'topic_id', $this->topic_id, false, true);
if($this->forum_id > 0)
{
sync('forum', 'forum_id', $this->forum_id);
}
$this->refresh_statvars();
} | php | function sync()
{
global $db;
if(!$this->topic_id)
{
//topic does not exist yet
return;
}
sync('topic', 'topic_id', $this->topic_id, false, true);
if($this->forum_id > 0)
{
sync('forum', 'forum_id', $this->forum_id);
}
$this->refresh_statvars();
} | [
"function",
"sync",
"(",
")",
"{",
"global",
"$",
"db",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"topic_id",
")",
"{",
"//topic does not exist yet",
"return",
";",
"}",
"sync",
"(",
"'topic'",
",",
"'topic_id'",
",",
"$",
"this",
"->",
"topic_id",
",",
... | TODO | [
"TODO"
] | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L544-L561 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | topic.reset_poll | function reset_poll()
{
global $db;
$db->sql_transaction('begin');
$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
SET poll_option_total = 0
WHERE topic_id = ' . $this->topic_id;
$db->sql_query($sql);
$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
WHERE topic_id = ' . $this->topic_id;
$db->sql_query($sq... | php | function reset_poll()
{
global $db;
$db->sql_transaction('begin');
$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
SET poll_option_total = 0
WHERE topic_id = ' . $this->topic_id;
$db->sql_query($sql);
$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
WHERE topic_id = ' . $this->topic_id;
$db->sql_query($sq... | [
"function",
"reset_poll",
"(",
")",
"{",
"global",
"$",
"db",
";",
"$",
"db",
"->",
"sql_transaction",
"(",
"'begin'",
")",
";",
"$",
"sql",
"=",
"'UPDATE '",
".",
"POLL_OPTIONS_TABLE",
".",
"'\n\t\t\tSET poll_option_total = 0\n\t\t\tWHERE topic_id = '",
".",
"$",... | clears all votes (restarts poll) | [
"clears",
"all",
"votes",
"(",
"restarts",
"poll",
")"
] | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L628-L651 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | post.get | static function get($post_id)
{
global $db;
//$sql = "SELECT p.*, t.topic_first_post_id, t.topic_last_post_id
// FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
// WHERE p.post_id=" . intval($this->post_id) . " AND t.topic_id = p.topic_id";
$sql = "SELECT * FROM " . POSTS_TABLE . " WHERE post_id=" . int... | php | static function get($post_id)
{
global $db;
//$sql = "SELECT p.*, t.topic_first_post_id, t.topic_last_post_id
// FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
// WHERE p.post_id=" . intval($this->post_id) . " AND t.topic_id = p.topic_id";
$sql = "SELECT * FROM " . POSTS_TABLE . " WHERE post_id=" . int... | [
"static",
"function",
"get",
"(",
"$",
"post_id",
")",
"{",
"global",
"$",
"db",
";",
"//$sql = \"SELECT p.*, t.topic_first_post_id, t.topic_last_post_id",
"//\t\tFROM \" . POSTS_TABLE . \" p, \" . TOPICS_TABLE . \" t",
"//\t\tWHERE p.post_id=\" . intval($this->post_id) . \" AND t.topic_... | static method, loads the post with a given post_id from database.
returns false if the post does not exist | [
"static",
"method",
"loads",
"the",
"post",
"with",
"a",
"given",
"post_id",
"from",
"database",
".",
"returns",
"false",
"if",
"the",
"post",
"does",
"not",
"exist"
] | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L776-L795 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | post.get_topic | function get_topic($all_posts = false)
{
if(!$this->_topic)
{
if($this->post_id)
{
//existing post, load existing topic
$this->_topic = topic::get($this->topic_id, $all_posts);
//insert $this into topic->posts array
if($all_posts)
{
//this post was also loaded from database, replace... | php | function get_topic($all_posts = false)
{
if(!$this->_topic)
{
if($this->post_id)
{
//existing post, load existing topic
$this->_topic = topic::get($this->topic_id, $all_posts);
//insert $this into topic->posts array
if($all_posts)
{
//this post was also loaded from database, replace... | [
"function",
"get_topic",
"(",
"$",
"all_posts",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_topic",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"post_id",
")",
"{",
"//existing post, load existing topic",
"$",
"this",
"->",
"_topic",
"=",
... | loads and returns the topic for this post
@param all_posts whether to load all other posts of the topic into topic->posts | [
"loads",
"and",
"returns",
"the",
"topic",
"for",
"this",
"post"
] | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L865-L901 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | post.merge_into | function merge_into($topic_id)
{
move_posts($this->post_id, $topic_id);
$this->topic_id = $topic_id;
$this->_topic = null;
} | php | function merge_into($topic_id)
{
move_posts($this->post_id, $topic_id);
$this->topic_id = $topic_id;
$this->_topic = null;
} | [
"function",
"merge_into",
"(",
"$",
"topic_id",
")",
"{",
"move_posts",
"(",
"$",
"this",
"->",
"post_id",
",",
"$",
"topic_id",
")",
";",
"$",
"this",
"->",
"topic_id",
"=",
"$",
"topic_id",
";",
"$",
"this",
"->",
"_topic",
"=",
"null",
";",
"}"
] | moves this post to a different topic. If you want to merge multiple post
into one topic, calling move_posts() directly is recommended. | [
"moves",
"this",
"post",
"to",
"a",
"different",
"topic",
".",
"If",
"you",
"want",
"to",
"merge",
"multiple",
"post",
"into",
"one",
"topic",
"calling",
"move_posts",
"()",
"directly",
"is",
"recommended",
"."
] | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L931-L936 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | post._submit | function _submit(&$sync)
{
global $config, $db, $auth, $user;
if($sync === false)
{
//submit() was called directly so we need to sync after it
$sync = new syncer();
$exec_sync = true;
}
else
{
//submit() was called by topic->submit(), sync there when everything is done
$exec_sync = false;
... | php | function _submit(&$sync)
{
global $config, $db, $auth, $user;
if($sync === false)
{
//submit() was called directly so we need to sync after it
$sync = new syncer();
$exec_sync = true;
}
else
{
//submit() was called by topic->submit(), sync there when everything is done
$exec_sync = false;
... | [
"function",
"_submit",
"(",
"&",
"$",
"sync",
")",
"{",
"global",
"$",
"config",
",",
"$",
"db",
",",
"$",
"auth",
",",
"$",
"user",
";",
"if",
"(",
"$",
"sync",
"===",
"false",
")",
"{",
"//submit() was called directly so we need to sync after it",
"$",
... | TODO | [
"TODO"
] | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L948-L1344 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | post.delete | function delete()
{
if(!$this->post_id)
{
trigger_error('NO_POST', E_USER_ERROR);
}
$ret = delete_posts('post_id', $this->post_id);
//remove references to the deleted post so calls to submit() will create a
//new post instead of trying to update the post which does not exist anymore
$this->post_id =... | php | function delete()
{
if(!$this->post_id)
{
trigger_error('NO_POST', E_USER_ERROR);
}
$ret = delete_posts('post_id', $this->post_id);
//remove references to the deleted post so calls to submit() will create a
//new post instead of trying to update the post which does not exist anymore
$this->post_id =... | [
"function",
"delete",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"post_id",
")",
"{",
"trigger_error",
"(",
"'NO_POST'",
",",
"E_USER_ERROR",
")",
";",
"}",
"$",
"ret",
"=",
"delete_posts",
"(",
"'post_id'",
",",
"$",
"this",
"->",
"post_id",
... | delete this post (and if it was the last one in the topic, also delete the topic) | [
"delete",
"this",
"post",
"(",
"and",
"if",
"it",
"was",
"the",
"last",
"one",
"in",
"the",
"topic",
"also",
"delete",
"the",
"topic",
")"
] | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L1347-L1361 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | post.mark_edited | function mark_edited($user_id = 0, $reason = '')
{
if($user_id = 0)
{
global $user;
$user_id = $user->data['user_id'];
}
$this->post_edit_count++;
$this->post_edit_time = time();
$this->post_edit_user = $user_id;
$this->post_edit_reason = $reason;
} | php | function mark_edited($user_id = 0, $reason = '')
{
if($user_id = 0)
{
global $user;
$user_id = $user->data['user_id'];
}
$this->post_edit_count++;
$this->post_edit_time = time();
$this->post_edit_user = $user_id;
$this->post_edit_reason = $reason;
} | [
"function",
"mark_edited",
"(",
"$",
"user_id",
"=",
"0",
",",
"$",
"reason",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"user_id",
"=",
"0",
")",
"{",
"global",
"$",
"user",
";",
"$",
"user_id",
"=",
"$",
"user",
"->",
"data",
"[",
"'user_id'",
"]",
... | mark this post as edited (modify post_edit_* fields).
currently logged in user will be used if user_id = 0 | [
"mark",
"this",
"post",
"as",
"edited",
"(",
"modify",
"post_edit_",
"*",
"fields",
")",
".",
"currently",
"logged",
"in",
"user",
"will",
"be",
"used",
"if",
"user_id",
"=",
"0"
] | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L1365-L1376 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | privmsg.reply_to | static function reply_to($msg_id, $quote = true)
{
global $db;
$sql = "SELECT p.msg_id, p.root_level, p.author_id, p.message_subject, p.message_text, p.bbcode_uid, p.to_address, p.bcc_address, u.username
FROM " . PRIVMSGS_TABLE . " p
LEFT JOIN " . USERS_TABLE . " u ON (p.author_id = u.user_id)
WHERE m... | php | static function reply_to($msg_id, $quote = true)
{
global $db;
$sql = "SELECT p.msg_id, p.root_level, p.author_id, p.message_subject, p.message_text, p.bbcode_uid, p.to_address, p.bcc_address, u.username
FROM " . PRIVMSGS_TABLE . " p
LEFT JOIN " . USERS_TABLE . " u ON (p.author_id = u.user_id)
WHERE m... | [
"static",
"function",
"reply_to",
"(",
"$",
"msg_id",
",",
"$",
"quote",
"=",
"true",
")",
"{",
"global",
"$",
"db",
";",
"$",
"sql",
"=",
"\"SELECT p.msg_id, p.root_level, p.author_id, p.message_subject, p.message_text, p.bbcode_uid, p.to_address, p.bcc_address, u.username\n... | initializes and returns a new privmsg object as reply to the message with msg_id $msg_id | [
"initializes",
"and",
"returns",
"a",
"new",
"privmsg",
"object",
"as",
"reply",
"to",
"the",
"message",
"with",
"msg_id",
"$msg_id"
] | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L1437-L1478 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | privmsg.to | function to()
{
$type = 'to';
$ug_type = 'u';
$id = 0;
$args = func_get_args();
$args = array_map('strtolower', $args);
foreach($args as $arg)
{
switch($arg)
{
case 'to': $type = 'to'; break;
case 'bcc': $type = 'bcc'; break;
case 'user': case 'u': $ug_type = 'u'; break;
case 'gro... | php | function to()
{
$type = 'to';
$ug_type = 'u';
$id = 0;
$args = func_get_args();
$args = array_map('strtolower', $args);
foreach($args as $arg)
{
switch($arg)
{
case 'to': $type = 'to'; break;
case 'bcc': $type = 'bcc'; break;
case 'user': case 'u': $ug_type = 'u'; break;
case 'gro... | [
"function",
"to",
"(",
")",
"{",
"$",
"type",
"=",
"'to'",
";",
"$",
"ug_type",
"=",
"'u'",
";",
"$",
"id",
"=",
"0",
";",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"args",
"=",
"array_map",
"(",
"'strtolower'",
",",
"$",
"args",
"... | adds a recipient. arguments can be (in any order):
- 'to': set type to 'to' (default)
- 'bcc': set type to 'bcc'
- integer: a user_id or group_id
- 'u' or 'user': the number is a user_id (default)
- 'g' or 'group': the number is a group_id
e.g. $pm->to('user', 'to', 123); | [
"adds",
"a",
"recipient",
".",
"arguments",
"can",
"be",
"(",
"in",
"any",
"order",
")",
":",
"-",
"to",
":",
"set",
"type",
"to",
"to",
"(",
"default",
")",
"-",
"bcc",
":",
"set",
"type",
"to",
"bcc",
"-",
"integer",
":",
"a",
"user_id",
"or",
... | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L1488-L1514 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | attachment.create_checked | function create_checked($file, $forum_id, $mimetype = 'application/octetstream')
{
global $user;
if(!file_exists($file))
{
trigger_error('FILE_NOT_FOUND', E_USER_ERROR);
}
$filedata = array(
'realname' => basename($file),
'size' => filesize($file),
'type' => $mimetype
);
$filedata = uploa... | php | function create_checked($file, $forum_id, $mimetype = 'application/octetstream')
{
global $user;
if(!file_exists($file))
{
trigger_error('FILE_NOT_FOUND', E_USER_ERROR);
}
$filedata = array(
'realname' => basename($file),
'size' => filesize($file),
'type' => $mimetype
);
$filedata = uploa... | [
"function",
"create_checked",
"(",
"$",
"file",
",",
"$",
"forum_id",
",",
"$",
"mimetype",
"=",
"'application/octetstream'",
")",
"{",
"global",
"$",
"user",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"trigger_error",
"(",
"'FI... | creates an attachment through the phpBB function upload_attachment. i.e.
quota, allowed extensions etc. will be checked.
returns an attachment object on success or an array of error messages on failure
submit() is automatically called so that this attachment appears in the acp
"orphaned attachments" list if you dont as... | [
"creates",
"an",
"attachment",
"through",
"the",
"phpBB",
"function",
"upload_attachment",
".",
"i",
".",
"e",
".",
"quota",
"allowed",
"extensions",
"etc",
".",
"will",
"be",
"checked",
".",
"returns",
"an",
"attachment",
"object",
"on",
"success",
"or",
"a... | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L1636-L1668 |
gn36/phpbb-oo-posting-api | functions_post_oo.php | syncer.add | function add($type, $id, $field, $amount = 1)
{
$this->init($type, $id);
if(!isset($this->data[$type][$id]['add'][$field]))
{
$this->data[$type][$id]['add'][$field] = 0;
}
$this->data[$type][$id]['add'][$field] += $amount;
} | php | function add($type, $id, $field, $amount = 1)
{
$this->init($type, $id);
if(!isset($this->data[$type][$id]['add'][$field]))
{
$this->data[$type][$id]['add'][$field] = 0;
}
$this->data[$type][$id]['add'][$field] += $amount;
} | [
"function",
"add",
"(",
"$",
"type",
",",
"$",
"id",
",",
"$",
"field",
",",
"$",
"amount",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"init",
"(",
"$",
"type",
",",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
... | increments or decrements a field.
@param $type which table (topic, user, forum or post)
@param $id topic_id, user_id etc.
@param $field field name (e.g. topic_replies)
@param $amount how much to add/subtract (default 1)
example: $sync->add('topic', 123, 'topic_replies', 1)
-> UPDATE phpbb_topics SET topic_replies = top... | [
"increments",
"or",
"decrements",
"a",
"field",
"."
] | train | https://github.com/gn36/phpbb-oo-posting-api/blob/d0e19482a9e1e93a435c1758a66df9324145381a/functions_post_oo.php#L1866-L1874 |
php-lug/lug | src/Bundle/GridBundle/Filter/FilterManager.php | FilterManager.get | public function get(GridInterface $grid)
{
return $this->storage !== null && isset($this->storage[$key = $this->getKey($grid)])
? $this->storage[$key]
: $grid->getData();
} | php | public function get(GridInterface $grid)
{
return $this->storage !== null && isset($this->storage[$key = $this->getKey($grid)])
? $this->storage[$key]
: $grid->getData();
} | [
"public",
"function",
"get",
"(",
"GridInterface",
"$",
"grid",
")",
"{",
"return",
"$",
"this",
"->",
"storage",
"!==",
"null",
"&&",
"isset",
"(",
"$",
"this",
"->",
"storage",
"[",
"$",
"key",
"=",
"$",
"this",
"->",
"getKey",
"(",
"$",
"grid",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Filter/FilterManager.php#L38-L43 |
php-lug/lug | src/Bundle/GridBundle/Filter/FilterManager.php | FilterManager.set | public function set(GridInterface $grid, array $filters)
{
if ($this->storage !== null) {
$this->storage[$this->getKey($grid)] = $filters;
}
} | php | public function set(GridInterface $grid, array $filters)
{
if ($this->storage !== null) {
$this->storage[$this->getKey($grid)] = $filters;
}
} | [
"public",
"function",
"set",
"(",
"GridInterface",
"$",
"grid",
",",
"array",
"$",
"filters",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"storage",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"storage",
"[",
"$",
"this",
"->",
"getKey",
"(",
"$",
"gri... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/GridBundle/Filter/FilterManager.php#L48-L53 |
ronaldborla/chikka | src/Borla/Chikka/Sender.php | Sender.reply | public function reply(Message $message, $adjustCost = true) {
// Return
return $this->request($message->toReply($adjustCost))
// Attach message
->attach('message', $message);
} | php | public function reply(Message $message, $adjustCost = true) {
// Return
return $this->request($message->toReply($adjustCost))
// Attach message
->attach('message', $message);
} | [
"public",
"function",
"reply",
"(",
"Message",
"$",
"message",
",",
"$",
"adjustCost",
"=",
"true",
")",
"{",
"// Return",
"return",
"$",
"this",
"->",
"request",
"(",
"$",
"message",
"->",
"toReply",
"(",
"$",
"adjustCost",
")",
")",
"// Attach message",
... | Reply | [
"Reply"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Sender.php#L51-L56 |
ronaldborla/chikka | src/Borla/Chikka/Sender.php | Sender.request | public function request(array $data) {
// Create request
$request = Loader::request($this->config, $data);
// Return response
return Loader::response(
// Execute
$this->getHttp()->post($this->getRequestUrl(), (string) $request)->json
// Attach request
)->attach('request', $request)... | php | public function request(array $data) {
// Create request
$request = Loader::request($this->config, $data);
// Return response
return Loader::response(
// Execute
$this->getHttp()->post($this->getRequestUrl(), (string) $request)->json
// Attach request
)->attach('request', $request)... | [
"public",
"function",
"request",
"(",
"array",
"$",
"data",
")",
"{",
"// Create request",
"$",
"request",
"=",
"Loader",
"::",
"request",
"(",
"$",
"this",
"->",
"config",
",",
"$",
"data",
")",
";",
"// Return response",
"return",
"Loader",
"::",
"respon... | Create a request | [
"Create",
"a",
"request"
] | train | https://github.com/ronaldborla/chikka/blob/446987706f81d5a0efbc8bd6b7d3b259d0527719/src/Borla/Chikka/Sender.php#L61-L70 |
bfitech/zapstore | src/SQL.php | SQL.open_pdo_connection | private function open_pdo_connection() {
try {
$this->connection = in_array(
$this->dbtype, ['sqlite3', 'pgsql'])
? new \PDO($this->connection_string)
: new \PDO(
$this->connection_string,
$this->dbuser, $this->dbpass);
self::$logger->debug(sprintf(
"SQL: connection opened: '%s'.",
... | php | private function open_pdo_connection() {
try {
$this->connection = in_array(
$this->dbtype, ['sqlite3', 'pgsql'])
? new \PDO($this->connection_string)
: new \PDO(
$this->connection_string,
$this->dbuser, $this->dbpass);
self::$logger->debug(sprintf(
"SQL: connection opened: '%s'.",
... | [
"private",
"function",
"open_pdo_connection",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"connection",
"=",
"in_array",
"(",
"$",
"this",
"->",
"dbtype",
",",
"[",
"'sqlite3'",
",",
"'pgsql'",
"]",
")",
"?",
"new",
"\\",
"PDO",
"(",
"$",
"this",
"... | Open PDO connection. | [
"Open",
"PDO",
"connection",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L126-L151 |
bfitech/zapstore | src/SQL.php | SQL.format_connection_string | private function format_connection_string() {
if (!in_array($this->dbtype, ['sqlite3', 'mysql', 'pgsql'])) {
$this->verified_params = null;
self::$logger->error(sprintf(
"SQL: database not supported: '%s'.",
$this->dbtype));
throw new SQLError(SQLError::DBTYPE_ERROR,
$this->dbtype . " not support... | php | private function format_connection_string() {
if (!in_array($this->dbtype, ['sqlite3', 'mysql', 'pgsql'])) {
$this->verified_params = null;
self::$logger->error(sprintf(
"SQL: database not supported: '%s'.",
$this->dbtype));
throw new SQLError(SQLError::DBTYPE_ERROR,
$this->dbtype . " not support... | [
"private",
"function",
"format_connection_string",
"(",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"this",
"->",
"dbtype",
",",
"[",
"'sqlite3'",
",",
"'mysql'",
",",
"'pgsql'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"verified_params",
"=",
"null",
... | Verify and format connection string. | [
"Verify",
"and",
"format",
"connection",
"string",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L156-L193 |
bfitech/zapstore | src/SQL.php | SQL.time | final public function time() {
if ($this->dbtype == 'pgsql')
return $this->query(
"SELECT EXTRACT('epoch' from CURRENT_TIMESTAMP) AS now"
)['now'];
if ($this->dbtype == 'mysql')
return $this->query(
"SELECT UNIX_TIMESTAMP() AS now")['now'];
return $this->query(
"SELECT strftime('%s', CURRENT_T... | php | final public function time() {
if ($this->dbtype == 'pgsql')
return $this->query(
"SELECT EXTRACT('epoch' from CURRENT_TIMESTAMP) AS now"
)['now'];
if ($this->dbtype == 'mysql')
return $this->query(
"SELECT UNIX_TIMESTAMP() AS now")['now'];
return $this->query(
"SELECT strftime('%s', CURRENT_T... | [
"final",
"public",
"function",
"time",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dbtype",
"==",
"'pgsql'",
")",
"return",
"$",
"this",
"->",
"query",
"(",
"\"SELECT EXTRACT('epoch' from CURRENT_TIMESTAMP) AS now\"",
")",
"[",
"'now'",
"]",
";",
"if",
"("... | Get Unix timestamp from database server.
@return int Unix epoch. | [
"Get",
"Unix",
"timestamp",
"from",
"database",
"server",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L209-L220 |
bfitech/zapstore | src/SQL.php | SQL.stmt_fragment_datetime | private function stmt_fragment_datetime($delta) {
$sign = $delta >= 0 ? '+' : '-';
$delta = abs($delta);
$date = '';
switch ($this->dbtype) {
case 'sqlite3':
$date = "(datetime('now', '%s%s second'))";
break;
case 'pgsql':
$date = (
"(" .
"now() at time zone 'utc' %s " .
"inte... | php | private function stmt_fragment_datetime($delta) {
$sign = $delta >= 0 ? '+' : '-';
$delta = abs($delta);
$date = '';
switch ($this->dbtype) {
case 'sqlite3':
$date = "(datetime('now', '%s%s second'))";
break;
case 'pgsql':
$date = (
"(" .
"now() at time zone 'utc' %s " .
"inte... | [
"private",
"function",
"stmt_fragment_datetime",
"(",
"$",
"delta",
")",
"{",
"$",
"sign",
"=",
"$",
"delta",
">=",
"0",
"?",
"'+'",
":",
"'-'",
";",
"$",
"delta",
"=",
"abs",
"(",
"$",
"delta",
")",
";",
"$",
"date",
"=",
"''",
";",
"switch",
"(... | SQL datetime fragment. | [
"SQL",
"datetime",
"fragment",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L225-L250 |
bfitech/zapstore | src/SQL.php | SQL.stmt_fragment | public function stmt_fragment($part, $args=[]) {
$type = $this->dbtype;
if ($part == 'engine') {
if ($type == 'mysql')
# we only intent to support FOREIGN KEY-capable engines
return "ENGINE=InnoDB";
return '';
}
if ($part == "index") {
if ($type == 'pgsql')
return 'SERIAL PRIMARY KEY';
i... | php | public function stmt_fragment($part, $args=[]) {
$type = $this->dbtype;
if ($part == 'engine') {
if ($type == 'mysql')
# we only intent to support FOREIGN KEY-capable engines
return "ENGINE=InnoDB";
return '';
}
if ($part == "index") {
if ($type == 'pgsql')
return 'SERIAL PRIMARY KEY';
i... | [
"public",
"function",
"stmt_fragment",
"(",
"$",
"part",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"dbtype",
";",
"if",
"(",
"$",
"part",
"==",
"'engine'",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'mysql'",
... | SQL statement fragment.
@param string $part A part sensitive to the database being used,
one of these: 'engine', 'index', 'datetime'.
@param array $args Dict of parameters for $part, for 'datetime'
only. | [
"SQL",
"statement",
"fragment",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L260-L282 |
bfitech/zapstore | src/SQL.php | SQL.table_exists | public function table_exists($table) {
# we can't use placeholder for table name
if (!preg_match('!^[0-9a-z_]+$!i', $table))
return false;
self::$logger->deactivate();
try {
$this->query(sprintf("SELECT 1 FROM %s LIMIT 1", $table));
self::$logger->activate();
return true;
} catch(SQLError $e) {
... | php | public function table_exists($table) {
# we can't use placeholder for table name
if (!preg_match('!^[0-9a-z_]+$!i', $table))
return false;
self::$logger->deactivate();
try {
$this->query(sprintf("SELECT 1 FROM %s LIMIT 1", $table));
self::$logger->activate();
return true;
} catch(SQLError $e) {
... | [
"public",
"function",
"table_exists",
"(",
"$",
"table",
")",
"{",
"# we can't use placeholder for table name",
"if",
"(",
"!",
"preg_match",
"(",
"'!^[0-9a-z_]+$!i'",
",",
"$",
"table",
")",
")",
"return",
"false",
";",
"self",
"::",
"$",
"logger",
"->",
"dea... | Check if a table or view exists.
@param string $table Table or view name.
@return bool True if table or view does exist.
@fixme This will always re-activate logging at the end,
regardless the logging state. The fix must be in Logger
class itself where logging state must be exposed. | [
"Check",
"if",
"a",
"table",
"or",
"view",
"exists",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L293-L306 |
bfitech/zapstore | src/SQL.php | SQL.prepare_statement | private function prepare_statement($stmt, $args=[]) {
if (!$this->connection) {
self::$logger->error(sprintf(
"SQL: connection failed: '%s'.",
json_encode($this->verified_params)));
throw new SQLError(SQLError::CONNECTION_ERROR,
$this->dbtype . " connection error.");
}
$conn = $this->connection... | php | private function prepare_statement($stmt, $args=[]) {
if (!$this->connection) {
self::$logger->error(sprintf(
"SQL: connection failed: '%s'.",
json_encode($this->verified_params)));
throw new SQLError(SQLError::CONNECTION_ERROR,
$this->dbtype . " connection error.");
}
$conn = $this->connection... | [
"private",
"function",
"prepare_statement",
"(",
"$",
"stmt",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"connection",
")",
"{",
"self",
"::",
"$",
"logger",
"->",
"error",
"(",
"sprintf",
"(",
"\"SQL: connection fail... | Prepare and execute statement. | [
"Prepare",
"and",
"execute",
"statement",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L311-L350 |
bfitech/zapstore | src/SQL.php | SQL.query | final public function query($stmt, $args=[], $multiple=null) {
$pstmt = $this->prepare_statement($stmt, $args);
$res = $multiple
? $pstmt->fetchAll(\PDO::FETCH_ASSOC)
: $pstmt->fetch(\PDO::FETCH_ASSOC);
self::$logger->info(sprintf(
"SQL: query ok: %s <- '%s'.",
$stmt, json_encode($args)));
return $r... | php | final public function query($stmt, $args=[], $multiple=null) {
$pstmt = $this->prepare_statement($stmt, $args);
$res = $multiple
? $pstmt->fetchAll(\PDO::FETCH_ASSOC)
: $pstmt->fetch(\PDO::FETCH_ASSOC);
self::$logger->info(sprintf(
"SQL: query ok: %s <- '%s'.",
$stmt, json_encode($args)));
return $r... | [
"final",
"public",
"function",
"query",
"(",
"$",
"stmt",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"multiple",
"=",
"null",
")",
"{",
"$",
"pstmt",
"=",
"$",
"this",
"->",
"prepare_statement",
"(",
"$",
"stmt",
",",
"$",
"args",
")",
";",
"$",
... | Select query.
@param string $stmt SQL statement.
@param array $args Arguments in numeric array.
@param bool $multiple Whether returned result contains all rows.
@return mixed Rows or connection depending on $raw switch.
@note Since SQLite3 does not enforce type safety, make sure
arguments are cast properly before usag... | [
"Select",
"query",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L363-L372 |
bfitech/zapstore | src/SQL.php | SQL.query_raw | final public function query_raw($stmt, $args=[]) {
$pstmt = $this->prepare_statement($stmt, $args);
self::$logger->info(sprintf(
"SQL: query raw ok: %s.", $stmt));
return $pstmt;
} | php | final public function query_raw($stmt, $args=[]) {
$pstmt = $this->prepare_statement($stmt, $args);
self::$logger->info(sprintf(
"SQL: query raw ok: %s.", $stmt));
return $pstmt;
} | [
"final",
"public",
"function",
"query_raw",
"(",
"$",
"stmt",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"pstmt",
"=",
"$",
"this",
"->",
"prepare_statement",
"(",
"$",
"stmt",
",",
"$",
"args",
")",
";",
"self",
"::",
"$",
"logger",
"->",
"... | Execute raw query.
This will execute arbitray single SQL queries. Do not execute
multiple queries at once to avoid undocumented side effects.
To execute successive raw queries safely, disable autocommit as
follows:
@code
$connection = new SQL(...);
try {
$connection = $this->get_connection();
$connection->beginTransa... | [
"Execute",
"raw",
"query",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L402-L407 |
bfitech/zapstore | src/SQL.php | SQL.insert | final public function insert($table, $args=[], $pk=null) {
$keys = $vals = [];
$keys = array_keys($args);
$vals = array_fill(0, count($args), '?');
$columns = implode(',', $keys);
$placeholders = implode(',', $vals);
$stmt = "INSERT INTO $table ($columns) VALUES ($placeholders)";
if ($this->dbtype == '... | php | final public function insert($table, $args=[], $pk=null) {
$keys = $vals = [];
$keys = array_keys($args);
$vals = array_fill(0, count($args), '?');
$columns = implode(',', $keys);
$placeholders = implode(',', $vals);
$stmt = "INSERT INTO $table ($columns) VALUES ($placeholders)";
if ($this->dbtype == '... | [
"final",
"public",
"function",
"insert",
"(",
"$",
"table",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"pk",
"=",
"null",
")",
"{",
"$",
"keys",
"=",
"$",
"vals",
"=",
"[",
"]",
";",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"args",
")",
";",... | Insert statement.
@param string $table Table name.
@param array $args Dict of what to INSERT.
@param string $pk Primary key from which last insert ID should
be retrieved. This won't take any effect on databases other
than Postgres. This can take any column name, not necessarily
column with PRIMARY KEY attributes. If l... | [
"Insert",
"statement",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L423-L449 |
bfitech/zapstore | src/SQL.php | SQL.update | final public function update($table, $args, $where=[]) {
$pair_args = $params = [];
foreach ($args as $key => $val) {
$pair_args[] = "{$key}=?";
$params[] = $val;
}
$stmt = sprintf("UPDATE $table SET %s",
implode(",", $pair_args));
if ($where) {
$pair_wheres = [];
foreach ($where as $key => $... | php | final public function update($table, $args, $where=[]) {
$pair_args = $params = [];
foreach ($args as $key => $val) {
$pair_args[] = "{$key}=?";
$params[] = $val;
}
$stmt = sprintf("UPDATE $table SET %s",
implode(",", $pair_args));
if ($where) {
$pair_wheres = [];
foreach ($where as $key => $... | [
"final",
"public",
"function",
"update",
"(",
"$",
"table",
",",
"$",
"args",
",",
"$",
"where",
"=",
"[",
"]",
")",
"{",
"$",
"pair_args",
"=",
"$",
"params",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"key",
"=>",
"$",
"val",... | Update statement.
@param string $table Table name.
@param array $args Dict of what to UPDATE.
@param array $where Dict of WHERE to UPDATE. | [
"Update",
"statement",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L458-L483 |
bfitech/zapstore | src/SQL.php | SQL.delete | final public function delete($table, $where=[]) {
$stmt = "DELETE FROM $table";
if ($where) {
$pair_wheres = [];
$params = [];
foreach ($where as $key => $val) {
$pair_wheres[] = "{$key}=?";
$params[] = $val;
}
$stmt .= " WHERE " . implode(" AND ", $pair_wheres);
}
self::$logger->info(sp... | php | final public function delete($table, $where=[]) {
$stmt = "DELETE FROM $table";
if ($where) {
$pair_wheres = [];
$params = [];
foreach ($where as $key => $val) {
$pair_wheres[] = "{$key}=?";
$params[] = $val;
}
$stmt .= " WHERE " . implode(" AND ", $pair_wheres);
}
self::$logger->info(sp... | [
"final",
"public",
"function",
"delete",
"(",
"$",
"table",
",",
"$",
"where",
"=",
"[",
"]",
")",
"{",
"$",
"stmt",
"=",
"\"DELETE FROM $table\"",
";",
"if",
"(",
"$",
"where",
")",
"{",
"$",
"pair_wheres",
"=",
"[",
"]",
";",
"$",
"params",
"=",
... | Delete statement.
@param string $table Table name.
@param array $where Dict of WHERE to delete. | [
"Delete",
"statement",
"."
] | train | https://github.com/bfitech/zapstore/blob/0353a7a3f81cbc4e25fc1646fa2f98cb490b85d0/src/SQL.php#L491-L508 |
Danzabar/config-builder | src/Collections/Collection.php | Collection.registerStandardObjects | public function registerStandardObjects()
{
$this->extensionMap = new ExtensionMap();
$this->extensions = $this->extensionMap->getRegisteredExtensionNames();
$this->finder->files();
} | php | public function registerStandardObjects()
{
$this->extensionMap = new ExtensionMap();
$this->extensions = $this->extensionMap->getRegisteredExtensionNames();
$this->finder->files();
} | [
"public",
"function",
"registerStandardObjects",
"(",
")",
"{",
"$",
"this",
"->",
"extensionMap",
"=",
"new",
"ExtensionMap",
"(",
")",
";",
"$",
"this",
"->",
"extensions",
"=",
"$",
"this",
"->",
"extensionMap",
"->",
"getRegisteredExtensionNames",
"(",
")"... | Registers the extension map and sets the finder to look for files
@return void
@author Dan Cox | [
"Registers",
"the",
"extension",
"map",
"and",
"sets",
"the",
"finder",
"to",
"look",
"for",
"files"
] | train | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Collections/Collection.php#L95-L100 |
Danzabar/config-builder | src/Collections/Collection.php | Collection.filterByExtension | public function filterByExtension()
{
// The call back that filters files through the finder
$filter = function (\SplFileInfo $file) {
return in_array($file->getExtension(), $this->extensions);
};
$this->filter($filter);
} | php | public function filterByExtension()
{
// The call back that filters files through the finder
$filter = function (\SplFileInfo $file) {
return in_array($file->getExtension(), $this->extensions);
};
$this->filter($filter);
} | [
"public",
"function",
"filterByExtension",
"(",
")",
"{",
"// The call back that filters files through the finder",
"$",
"filter",
"=",
"function",
"(",
"\\",
"SplFileInfo",
"$",
"file",
")",
"{",
"return",
"in_array",
"(",
"$",
"file",
"->",
"getExtension",
"(",
... | Filters file results by their extension
@return void
@author Dan Cox | [
"Filters",
"file",
"results",
"by",
"their",
"extension"
] | train | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Collections/Collection.php#L108-L117 |
Danzabar/config-builder | src/Collections/Collection.php | Collection.fetch | public function fetch()
{
$this->filterByExtension();
$results = Array();
foreach ($this->finder as $file)
{
$config = new ConfigFile($this->fs, $this->fileInfo, $this->extracter);
$config->load($file->getRealPath());
$results[] = $config;
}
$this->finder = new Finder();
return new Collectio... | php | public function fetch()
{
$this->filterByExtension();
$results = Array();
foreach ($this->finder as $file)
{
$config = new ConfigFile($this->fs, $this->fileInfo, $this->extracter);
$config->load($file->getRealPath());
$results[] = $config;
}
$this->finder = new Finder();
return new Collectio... | [
"public",
"function",
"fetch",
"(",
")",
"{",
"$",
"this",
"->",
"filterByExtension",
"(",
")",
";",
"$",
"results",
"=",
"Array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"finder",
"as",
"$",
"file",
")",
"{",
"$",
"config",
"=",
"new",
... | Fetches results of current instance of the finder
@return CollectionResults
@author Dan Cox | [
"Fetches",
"results",
"of",
"current",
"instance",
"of",
"the",
"finder"
] | train | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Collections/Collection.php#L192-L208 |
Danzabar/config-builder | src/Collections/Collection.php | Collection.setDirectory | public function setDirectory($directory)
{
$this->directory = $directory;
// Set the finder to use this directory as well
$this->finder->in($directory);
return $this;
} | php | public function setDirectory($directory)
{
$this->directory = $directory;
// Set the finder to use this directory as well
$this->finder->in($directory);
return $this;
} | [
"public",
"function",
"setDirectory",
"(",
"$",
"directory",
")",
"{",
"$",
"this",
"->",
"directory",
"=",
"$",
"directory",
";",
"// Set the finder to use this directory as well",
"$",
"this",
"->",
"finder",
"->",
"in",
"(",
"$",
"directory",
")",
";",
"ret... | Sets the directory value
@param String $directory
@return Collection
@author Dan Cox | [
"Sets",
"the",
"directory",
"value"
] | train | https://github.com/Danzabar/config-builder/blob/3b237be578172c32498bbcdfb360e69a6243739d/src/Collections/Collection.php#L217-L225 |
nonzod/yii2-foundation | DropdownButton.php | DropdownButton.run | public function run() {
$dropdown = Dropdown::begin($this->getDropdownConfig());
echo "\n" . $this->renderButton($dropdown);
Dropdown::end();
$this->registerPlugin('button');
} | php | public function run() {
$dropdown = Dropdown::begin($this->getDropdownConfig());
echo "\n" . $this->renderButton($dropdown);
Dropdown::end();
$this->registerPlugin('button');
} | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"dropdown",
"=",
"Dropdown",
"::",
"begin",
"(",
"$",
"this",
"->",
"getDropdownConfig",
"(",
")",
")",
";",
"echo",
"\"\\n\"",
".",
"$",
"this",
"->",
"renderButton",
"(",
"$",
"dropdown",
")",
";",
"... | Renders the widget. | [
"Renders",
"the",
"widget",
"."
] | train | https://github.com/nonzod/yii2-foundation/blob/5df93b8a39a73a7fade2f3189693fdb6625205d2/DropdownButton.php#L60-L66 |
nonzod/yii2-foundation | DropdownButton.php | DropdownButton.renderButton | protected function renderButton($dropdown) {
$dropdownId = $dropdown->getId();
$label = $this->label;
if ($this->encodeLabel) {
$label = Html::encode($label);
}
if ($this->split) {
$this->tagName = 'a';
Html::addCssClass($this->options, 'button');
Html::addCssClass($this... | php | protected function renderButton($dropdown) {
$dropdownId = $dropdown->getId();
$label = $this->label;
if ($this->encodeLabel) {
$label = Html::encode($label);
}
if ($this->split) {
$this->tagName = 'a';
Html::addCssClass($this->options, 'button');
Html::addCssClass($this... | [
"protected",
"function",
"renderButton",
"(",
"$",
"dropdown",
")",
"{",
"$",
"dropdownId",
"=",
"$",
"dropdown",
"->",
"getId",
"(",
")",
";",
"$",
"label",
"=",
"$",
"this",
"->",
"label",
";",
"if",
"(",
"$",
"this",
"->",
"encodeLabel",
")",
"{",... | Generates the button dropdown.
@return string the rendering result. | [
"Generates",
"the",
"button",
"dropdown",
"."
] | train | https://github.com/nonzod/yii2-foundation/blob/5df93b8a39a73a7fade2f3189693fdb6625205d2/DropdownButton.php#L72-L99 |
nonzod/yii2-foundation | DropdownButton.php | DropdownButton.getDropdownConfig | protected function getDropdownConfig() {
$config = $this->dropdown;
$config['id'] = ArrayHelper::getValue($config, 'id', null);
$config['clientOptions'] = false;
$config['view'] = $this->getView();
return $config;
} | php | protected function getDropdownConfig() {
$config = $this->dropdown;
$config['id'] = ArrayHelper::getValue($config, 'id', null);
$config['clientOptions'] = false;
$config['view'] = $this->getView();
return $config;
} | [
"protected",
"function",
"getDropdownConfig",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"dropdown",
";",
"$",
"config",
"[",
"'id'",
"]",
"=",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"config",
",",
"'id'",
",",
"null",
")",
";",
"$",
"... | Get config for [[Dropdown]] widget
@return array config options | [
"Get",
"config",
"for",
"[[",
"Dropdown",
"]]",
"widget"
] | train | https://github.com/nonzod/yii2-foundation/blob/5df93b8a39a73a7fade2f3189693fdb6625205d2/DropdownButton.php#L105-L112 |
alevilar/ristorantino-vendor | Risto/Console/Command/RistoSchemaShell.php | RistoSchemaShell._update | protected function _update(&$Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
$this->out(__d('cake_console', 'Comparing Database to Schema...'));
$options = array();
$this->params['force'] = false;
if (isset($this->params['force'])) {
$options['models'] = false;
... | php | protected function _update(&$Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
$this->out(__d('cake_console', 'Comparing Database to Schema...'));
$options = array();
$this->params['force'] = false;
if (isset($this->params['force'])) {
$options['models'] = false;
... | [
"protected",
"function",
"_update",
"(",
"&",
"$",
"Schema",
",",
"$",
"table",
"=",
"null",
")",
"{",
"$",
"db",
"=",
"ConnectionManager",
"::",
"getDataSource",
"(",
"$",
"this",
"->",
"Schema",
"->",
"connection",
")",
";",
"$",
"this",
"->",
"out",... | Update database with Schema object
Should be called via the run method
@param CakeSchema &$Schema The schema instance
@param string $table The table name.
@return void | [
"Update",
"database",
"with",
"Schema",
"object",
"Should",
"be",
"called",
"via",
"the",
"run",
"method"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Console/Command/RistoSchemaShell.php#L26-L74 |
mithun12000/yii2-process | src/components/ProcessControlTrait.php | ProcessControlTrait.createPidfile | public function createPidfile($appName, $path='/var/run'){
if(!$this->control){
$this->createControl();
}
return new Pidfile($this->control, strtolower($appName), $path);
} | php | public function createPidfile($appName, $path='/var/run'){
if(!$this->control){
$this->createControl();
}
return new Pidfile($this->control, strtolower($appName), $path);
} | [
"public",
"function",
"createPidfile",
"(",
"$",
"appName",
",",
"$",
"path",
"=",
"'/var/run'",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"control",
")",
"{",
"$",
"this",
"->",
"createControl",
"(",
")",
";",
"}",
"return",
"new",
"Pidfile",
"("... | Create Pid file for process
@param string $appName
@param string $path | [
"Create",
"Pid",
"file",
"for",
"process"
] | train | https://github.com/mithun12000/yii2-process/blob/d4c660010381fee76159eb4c92d4b75e38442d3c/src/components/ProcessControlTrait.php#L47-L52 |
mothership-ec/composer | src/Composer/DependencyResolver/DefaultPolicy.php | DefaultPolicy.replaces | protected function replaces(PackageInterface $source, PackageInterface $target)
{
foreach ($source->getReplaces() as $link) {
if ($link->getTarget() === $target->getName()
// && (null === $link->getConstraint() ||
// $link->getConstraint()->matches(new VersionConstr... | php | protected function replaces(PackageInterface $source, PackageInterface $target)
{
foreach ($source->getReplaces() as $link) {
if ($link->getTarget() === $target->getName()
// && (null === $link->getConstraint() ||
// $link->getConstraint()->matches(new VersionConstr... | [
"protected",
"function",
"replaces",
"(",
"PackageInterface",
"$",
"source",
",",
"PackageInterface",
"$",
"target",
")",
"{",
"foreach",
"(",
"$",
"source",
"->",
"getReplaces",
"(",
")",
"as",
"$",
"link",
")",
"{",
"if",
"(",
"$",
"link",
"->",
"getTa... | Checks if source replaces a package with the same name as target.
Replace constraints are ignored. This method should only be used for
prioritisation, not for actual constraint verification.
@param PackageInterface $source
@param PackageInterface $target
@return bool | [
"Checks",
"if",
"source",
"replaces",
"a",
"package",
"with",
"the",
"same",
"name",
"as",
"target",
"."
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/DefaultPolicy.php#L192-L204 |
Humanized/yii2-location | controllers/CountryController.php | CountryController.actionIndex | public function actionIndex()
{
$model = new Country();
if ($model->load(\Yii::$app->request->post()) && $model->save()) {
$model = new Country(); //reset model
}
$searchModel = new CountrySearch();
$dataProvider = $searchModel->search(\Yii::$app->request->queryP... | php | public function actionIndex()
{
$model = new Country();
if ($model->load(\Yii::$app->request->post()) && $model->save()) {
$model = new Country(); //reset model
}
$searchModel = new CountrySearch();
$dataProvider = $searchModel->search(\Yii::$app->request->queryP... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"Country",
"(",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"\\",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post",
"(",
")",
")",
"&&",
"$",
"model",
... | Lists all Country models.
@return mixed | [
"Lists",
"all",
"Country",
"models",
"."
] | train | https://github.com/Humanized/yii2-location/blob/48ac12ceab741fc4c82ac8e979415a11bf9175f2/controllers/CountryController.php#L35-L50 |
ekuiter/feature-php | FeaturePhp/File/RefinedFile.php | RefinedFile.getContent | public function getContent() {
$composer = fphp\Collaboration\Composer::fromKind($this->roles[0]->getKind());
foreach ($this->roles as $role)
$composer = $composer->refine($role);
return $composer->getContent();
} | php | public function getContent() {
$composer = fphp\Collaboration\Composer::fromKind($this->roles[0]->getKind());
foreach ($this->roles as $role)
$composer = $composer->refine($role);
return $composer->getContent();
} | [
"public",
"function",
"getContent",
"(",
")",
"{",
"$",
"composer",
"=",
"fphp",
"\\",
"Collaboration",
"\\",
"Composer",
"::",
"fromKind",
"(",
"$",
"this",
"->",
"roles",
"[",
"0",
"]",
"->",
"getKind",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"thi... | Returns the refined file's content.
It is generated using an appropriate composition mechanism (see {@see \FeaturePhp\Collaboration\Composer}).
@return FileContent | [
"Returns",
"the",
"refined",
"file",
"s",
"content",
".",
"It",
"is",
"generated",
"using",
"an",
"appropriate",
"composition",
"mechanism",
"(",
"see",
"{"
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/File/RefinedFile.php#L37-L42 |
inhere/php-librarys | src/Traits/StdObjectTrait.php | StdObjectTrait.className | final public static function className(string $fullName = null): string
{
$fullName = $fullName ?: self::fullName();
$fullName = str_replace('\\', '/', $fullName);
return basename($fullName);
} | php | final public static function className(string $fullName = null): string
{
$fullName = $fullName ?: self::fullName();
$fullName = str_replace('\\', '/', $fullName);
return basename($fullName);
} | [
"final",
"public",
"static",
"function",
"className",
"(",
"string",
"$",
"fullName",
"=",
"null",
")",
":",
"string",
"{",
"$",
"fullName",
"=",
"$",
"fullName",
"?",
":",
"self",
"::",
"fullName",
"(",
")",
";",
"$",
"fullName",
"=",
"str_replace",
"... | get called class name
@param null|string $fullName
@return string | [
"get",
"called",
"class",
"name"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Traits/StdObjectTrait.php#L47-L53 |
colorium/web | src/Colorium/Web/Logic.php | Logic.override | public function override(array $specs)
{
unset($specs['param'], $specs['return'], $specs['throws']);
foreach($specs as $key => $value) {
$this->$key = $value;
}
return $this;
} | php | public function override(array $specs)
{
unset($specs['param'], $specs['return'], $specs['throws']);
foreach($specs as $key => $value) {
$this->$key = $value;
}
return $this;
} | [
"public",
"function",
"override",
"(",
"array",
"$",
"specs",
")",
"{",
"unset",
"(",
"$",
"specs",
"[",
"'param'",
"]",
",",
"$",
"specs",
"[",
"'return'",
"]",
",",
"$",
"specs",
"[",
"'throws'",
"]",
")",
";",
"foreach",
"(",
"$",
"specs",
"as",... | Override data
@param array $specs
@return $this | [
"Override",
"data"
] | train | https://github.com/colorium/web/blob/2a767658b8737022939b0cc4505b5f652c1683d2/src/Colorium/Web/Logic.php#L48-L56 |
colorium/web | src/Colorium/Web/Logic.php | Logic.resolve | public static function resolve($name, $callable)
{
$invokable = Resolver::of($callable);
$annotations = $invokable->annotations();
$annotations['method'] = $invokable;
return new Logic($name, $annotations);
} | php | public static function resolve($name, $callable)
{
$invokable = Resolver::of($callable);
$annotations = $invokable->annotations();
$annotations['method'] = $invokable;
return new Logic($name, $annotations);
} | [
"public",
"static",
"function",
"resolve",
"(",
"$",
"name",
",",
"$",
"callable",
")",
"{",
"$",
"invokable",
"=",
"Resolver",
"::",
"of",
"(",
"$",
"callable",
")",
";",
"$",
"annotations",
"=",
"$",
"invokable",
"->",
"annotations",
"(",
")",
";",
... | Resolve logic from callable
@param string $name
@param $callable
@return Logic | [
"Resolve",
"logic",
"from",
"callable"
] | train | https://github.com/colorium/web/blob/2a767658b8737022939b0cc4505b5f652c1683d2/src/Colorium/Web/Logic.php#L66-L73 |
php-lug/lug | src/Component/Grid/Column/Type/DateTimeType.php | DateTimeType.render | public function render($data, array $options)
{
$dateTime = $this->getValue($data, $options);
if ($dateTime === null) {
return;
}
if (!$dateTime instanceof \DateTimeInterface) {
throw new InvalidTypeException(sprintf(
'The "%s" %s column type... | php | public function render($data, array $options)
{
$dateTime = $this->getValue($data, $options);
if ($dateTime === null) {
return;
}
if (!$dateTime instanceof \DateTimeInterface) {
throw new InvalidTypeException(sprintf(
'The "%s" %s column type... | [
"public",
"function",
"render",
"(",
"$",
"data",
",",
"array",
"$",
"options",
")",
"{",
"$",
"dateTime",
"=",
"$",
"this",
"->",
"getValue",
"(",
"$",
"data",
",",
"$",
"options",
")",
";",
"if",
"(",
"$",
"dateTime",
"===",
"null",
")",
"{",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Column/Type/DateTimeType.php#L93-L111 |
php-lug/lug | src/Component/Grid/Column/Type/DateTimeType.php | DateTimeType.configureOptions | public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver
->setDefaults([
'calendar' => $this->calendar,
'date_format' => $this->dateFormat,
'lenient' => $this->lenient,
... | php | public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver
->setDefaults([
'calendar' => $this->calendar,
'date_format' => $this->dateFormat,
'lenient' => $this->lenient,
... | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"parent",
"::",
"configureOptions",
"(",
"$",
"resolver",
")",
";",
"$",
"resolver",
"->",
"setDefaults",
"(",
"[",
"'calendar'",
"=>",
"$",
"this",
"->",
"calendar",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/Column/Type/DateTimeType.php#L116-L141 |
FriendsOfApi/phraseapp | src/Model/Translation/Locale.php | Locale.createFromArray | public static function createFromArray(array $data)
{
$self = new self();
if (isset($data['id'])) {
$self->setId($data['id']);
}
if (isset($data['name'])) {
$self->setName($data['name']);
}
if (isset($data['code'])) {
$self->setCod... | php | public static function createFromArray(array $data)
{
$self = new self();
if (isset($data['id'])) {
$self->setId($data['id']);
}
if (isset($data['name'])) {
$self->setName($data['name']);
}
if (isset($data['code'])) {
$self->setCod... | [
"public",
"static",
"function",
"createFromArray",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"self",
"=",
"new",
"self",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
")",
"{",
"$",
"self",
"->",
"setId",
"(",
"$",
... | @param array $data
@return Locale | [
"@param",
"array",
"$data"
] | train | https://github.com/FriendsOfApi/phraseapp/blob/1553bf857eb0858f9a7eb905b085864d24f80886/src/Model/Translation/Locale.php#L39-L54 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php | ezcQueryExpressionOracle.bitXor | public function bitXor( $value1, $value2 )
{
$value1 = $this->getIdentifier( $value1 );
$value2 = $this->getIdentifier( $value2 );
return "( {$value1} + {$value2} - bitand( {$value1}, {$value2} ) * 2 )";
} | php | public function bitXor( $value1, $value2 )
{
$value1 = $this->getIdentifier( $value1 );
$value2 = $this->getIdentifier( $value2 );
return "( {$value1} + {$value2} - bitand( {$value1}, {$value2} ) * 2 )";
} | [
"public",
"function",
"bitXor",
"(",
"$",
"value1",
",",
"$",
"value2",
")",
"{",
"$",
"value1",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"value1",
")",
";",
"$",
"value2",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"value2",
")",
... | Returns the SQL that performs the bitwise XOR on two values.
@param string $value1
@param string $value2
@return string | [
"Returns",
"the",
"SQL",
"that",
"performs",
"the",
"bitwise",
"XOR",
"on",
"two",
"values",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php#L141-L146 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php | ezcQueryExpressionOracle.unixTimestamp | public function unixTimestamp( $column )
{
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
// // alternative
// if ( preg_match( '/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/', $c... | php | public function unixTimestamp( $column )
{
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
// // alternative
// if ( preg_match( '/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/', $c... | [
"public",
"function",
"unixTimestamp",
"(",
"$",
"column",
")",
"{",
"$",
"column",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"column",
")",
";",
"if",
"(",
"$",
"column",
"!=",
"'NOW()'",
")",
"{",
"$",
"column",
"=",
"\"CAST( {$column} AS TIME... | Returns the SQL that converts a timestamp value to a unix timestamp.
@param string $column
@return string | [
"Returns",
"the",
"SQL",
"that",
"converts",
"a",
"timestamp",
"value",
"to",
"a",
"unix",
"timestamp",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php#L154-L170 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php | ezcQueryExpressionOracle.dateSub | public function dateSub( $column, $expr, $type )
{
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
return " {$column} - INTERVAL '{$expr}' {$type} ";
... | php | public function dateSub( $column, $expr, $type )
{
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
return " {$column} - INTERVAL '{$expr}' {$type} ";
... | [
"public",
"function",
"dateSub",
"(",
"$",
"column",
",",
"$",
"expr",
",",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"intervalMap",
"[",
"$",
"type",
"]",
";",
"$",
"column",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"... | Returns the SQL that subtracts an interval from a timestamp value.
@param string $column
@param numeric $expr
@param string $type one of SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR
@return string | [
"Returns",
"the",
"SQL",
"that",
"subtracts",
"an",
"interval",
"from",
"a",
"timestamp",
"value",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php#L180-L191 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php | ezcQueryExpressionOracle.dateAdd | public function dateAdd( $column, $expr, $type )
{
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
return " {$column} + INTERVAL '{$expr}' {$type} ";
... | php | public function dateAdd( $column, $expr, $type )
{
$type = $this->intervalMap[$type];
$column = $this->getIdentifier( $column );
if ( $column != 'NOW()' )
{
$column = "CAST( {$column} AS TIMESTAMP )";
}
return " {$column} + INTERVAL '{$expr}' {$type} ";
... | [
"public",
"function",
"dateAdd",
"(",
"$",
"column",
",",
"$",
"expr",
",",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"intervalMap",
"[",
"$",
"type",
"]",
";",
"$",
"column",
"=",
"$",
"this",
"->",
"getIdentifier",
"(",
"$",
"... | Returns the SQL that adds an interval to a timestamp value.
@param string $column
@param numeric $expr
@param string $type one of SECOND, MINUTE, HOUR, DAY, MONTH, or YEAR
@return string | [
"Returns",
"the",
"SQL",
"that",
"adds",
"an",
"interval",
"to",
"a",
"timestamp",
"value",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php#L201-L212 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php | ezcQueryExpressionOracle.in | public function in( $column )
{
$args = func_get_args();
if ( count( $args ) < 2 )
{
throw new ezcQueryVariableParameterException( 'in', count( $args ), 2 );
}
if ( is_array( $args[1] ) && count( $args[1] ) == 0 )
{
throw new ezcQueryInvalidPa... | php | public function in( $column )
{
$args = func_get_args();
if ( count( $args ) < 2 )
{
throw new ezcQueryVariableParameterException( 'in', count( $args ), 2 );
}
if ( is_array( $args[1] ) && count( $args[1] ) == 0 )
{
throw new ezcQueryInvalidPa... | [
"public",
"function",
"in",
"(",
"$",
"column",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"args",
")",
"<",
"2",
")",
"{",
"throw",
"new",
"ezcQueryVariableParameterException",
"(",
"'in'",
",",
"count",
... | Returns the SQL to check if a value is one in a set of
given values.
in() accepts an arbitrary number of parameters. The first parameter
must always specify the value that should be matched against. Successive
parameters must contain a logical expression or an array with logical
expressions. These expressions will be... | [
"Returns",
"the",
"SQL",
"to",
"check",
"if",
"a",
"value",
"is",
"one",
"in",
"a",
"set",
"of",
"given",
"values",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/expression_oracle.php#L268-L326 |
nonzod/yii2-foundation | Dropdown.php | Dropdown.init | public function init() {
parent::init();
Html::addCssClass($this->options, 'f-dropdown');
$this->options['data-dropdown-content'] = 1;
$this->options['tabindex'] = '-1';
$this->_containerOptions = $this->options;
} | php | public function init() {
parent::init();
Html::addCssClass($this->options, 'f-dropdown');
$this->options['data-dropdown-content'] = 1;
$this->options['tabindex'] = '-1';
$this->_containerOptions = $this->options;
} | [
"public",
"function",
"init",
"(",
")",
"{",
"parent",
"::",
"init",
"(",
")",
";",
"Html",
"::",
"addCssClass",
"(",
"$",
"this",
"->",
"options",
",",
"'f-dropdown'",
")",
";",
"$",
"this",
"->",
"options",
"[",
"'data-dropdown-content'",
"]",
"=",
"... | Initializes the widget.
If you override this method, make sure you call the parent implementation first. | [
"Initializes",
"the",
"widget",
".",
"If",
"you",
"override",
"this",
"method",
"make",
"sure",
"you",
"call",
"the",
"parent",
"implementation",
"first",
"."
] | train | https://github.com/nonzod/yii2-foundation/blob/5df93b8a39a73a7fade2f3189693fdb6625205d2/Dropdown.php#L51-L58 |
nonzod/yii2-foundation | Dropdown.php | Dropdown.renderAsItems | protected function renderAsItems($items) {
$lines = [];
foreach ($items as $i => $item) {
if (isset($item['visible']) && !$item['visible']) {
unset($items[$i]);
continue;
}
if (is_string($item)) {
$lines[] = $item;
continue;
}
if (!isset($item['label... | php | protected function renderAsItems($items) {
$lines = [];
foreach ($items as $i => $item) {
if (isset($item['visible']) && !$item['visible']) {
unset($items[$i]);
continue;
}
if (is_string($item)) {
$lines[] = $item;
continue;
}
if (!isset($item['label... | [
"protected",
"function",
"renderAsItems",
"(",
"$",
"items",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"items",
"as",
"$",
"i",
"=>",
"$",
"item",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"item",
"[",
"'visible'",
"]",
")",
... | Renders menu items.
@param array $items the menu items to be rendered
@return string the rendering result.
@throws InvalidConfigException if the label option is not specified in one of the items. | [
"Renders",
"menu",
"items",
"."
] | train | https://github.com/nonzod/yii2-foundation/blob/5df93b8a39a73a7fade2f3189693fdb6625205d2/Dropdown.php#L92-L116 |
HedronDev/hedron | src/Tools/ComposerHelperTrait.php | ComposerHelperTrait.mergeComposerJsonFiles | protected function mergeComposerJsonFiles(string $composer_file, \stdClass $original_composer, \stdClass $new_composer, callable $callback = NULL) {
$new_composer = $this->mergeComposerObjects($original_composer, $new_composer, $callback);
$composer_content = file_get_contents($composer_file);
$replace_comp... | php | protected function mergeComposerJsonFiles(string $composer_file, \stdClass $original_composer, \stdClass $new_composer, callable $callback = NULL) {
$new_composer = $this->mergeComposerObjects($original_composer, $new_composer, $callback);
$composer_content = file_get_contents($composer_file);
$replace_comp... | [
"protected",
"function",
"mergeComposerJsonFiles",
"(",
"string",
"$",
"composer_file",
",",
"\\",
"stdClass",
"$",
"original_composer",
",",
"\\",
"stdClass",
"$",
"new_composer",
",",
"callable",
"$",
"callback",
"=",
"NULL",
")",
"{",
"$",
"new_composer",
"="... | Merges the original composer file with a new composer file.
This ensures that the composer.json file that is going to be installed
will have all the appropriate requirements documented by the git
repository that is kept up to date by the client.
@param string $composer_file
The absolute path to the composer file to w... | [
"Merges",
"the",
"original",
"composer",
"file",
"with",
"a",
"new",
"composer",
"file",
"."
] | train | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Tools/ComposerHelperTrait.php#L27-L35 |
HedronDev/hedron | src/Tools/ComposerHelperTrait.php | ComposerHelperTrait.mergeComposerObjects | protected function mergeComposerObjects(\stdClass $original_composer, \stdClass $new_composer, callable $callback = NULL) {
foreach ($original_composer as $key => $values) {
$is_array = is_array($values);
$values = (array) $values;
if (isset($new_composer->{$key})) {
$value = (array) $new... | php | protected function mergeComposerObjects(\stdClass $original_composer, \stdClass $new_composer, callable $callback = NULL) {
foreach ($original_composer as $key => $values) {
$is_array = is_array($values);
$values = (array) $values;
if (isset($new_composer->{$key})) {
$value = (array) $new... | [
"protected",
"function",
"mergeComposerObjects",
"(",
"\\",
"stdClass",
"$",
"original_composer",
",",
"\\",
"stdClass",
"$",
"new_composer",
",",
"callable",
"$",
"callback",
"=",
"NULL",
")",
"{",
"foreach",
"(",
"$",
"original_composer",
"as",
"$",
"key",
"... | Merges two composer objects into one.
@param \stdClass $original_composer
The original composer.json file before it was removed as a php object.
@param \stdClass $new_composer
The new composer file to generate.
@param callable $callback
A callback if necessary to customize the composer object further.
@return \stdCla... | [
"Merges",
"two",
"composer",
"objects",
"into",
"one",
"."
] | train | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Tools/ComposerHelperTrait.php#L50-L64 |
HedronDev/hedron | src/Tools/ComposerHelperTrait.php | ComposerHelperTrait.calculateRequirementChanges | protected function calculateRequirementChanges($replace_composer, $new_composer) {
$changes = [
'install' => [],
'update' => [],
'remove' => [],
];
foreach (['require', 'require-dev'] as $key) {
$old_requirements = !empty($replace_composer->{$key}) ? $replace_composer->{$key} : [];
... | php | protected function calculateRequirementChanges($replace_composer, $new_composer) {
$changes = [
'install' => [],
'update' => [],
'remove' => [],
];
foreach (['require', 'require-dev'] as $key) {
$old_requirements = !empty($replace_composer->{$key}) ? $replace_composer->{$key} : [];
... | [
"protected",
"function",
"calculateRequirementChanges",
"(",
"$",
"replace_composer",
",",
"$",
"new_composer",
")",
"{",
"$",
"changes",
"=",
"[",
"'install'",
"=>",
"[",
"]",
",",
"'update'",
"=>",
"[",
"]",
",",
"'remove'",
"=>",
"[",
"]",
",",
"]",
"... | Calculated requirements that need to be removed from the system.
@param $replace_composer
Composer object about to be replaced.
@param $new_composer
Composer object doing the replacing.
@return array
An array of requirements to install, update or remove. | [
"Calculated",
"requirements",
"that",
"need",
"to",
"be",
"removed",
"from",
"the",
"system",
"."
] | train | https://github.com/HedronDev/hedron/blob/3b4adec4912f2d7c0b7e7262dc36515fbc2e8e00/src/Tools/ComposerHelperTrait.php#L77-L101 |
php-lug/lug | src/Component/Translation/Model/TranslatableTrait.php | TranslatableTrait.getTranslation | public function getTranslation($allowCreate = false)
{
$locales = $this->getLocales();
if (empty($locales)) {
throw new LocaleNotFoundException();
}
$translation = null;
foreach ($locales as $locale) {
if (($translation = $this->translations->get($l... | php | public function getTranslation($allowCreate = false)
{
$locales = $this->getLocales();
if (empty($locales)) {
throw new LocaleNotFoundException();
}
$translation = null;
foreach ($locales as $locale) {
if (($translation = $this->translations->get($l... | [
"public",
"function",
"getTranslation",
"(",
"$",
"allowCreate",
"=",
"false",
")",
"{",
"$",
"locales",
"=",
"$",
"this",
"->",
"getLocales",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"locales",
")",
")",
"{",
"throw",
"new",
"LocaleNotFoundException... | @param bool $allowCreate
@return TranslationInterface | [
"@param",
"bool",
"$allowCreate"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Translation/Model/TranslatableTrait.php#L125-L159 |
gdbots/iam-php | src/ListAllRolesRequestHandler.php | ListAllRolesRequestHandler.handle | protected function handle(ListAllRolesRequest $request, Pbjx $pbjx): ListAllRolesResponse
{
$roles = [];
$this->ncr->pipeNodeRefs(RoleV1Mixin::findOne()->getQName(), function (NodeRef $nodeRef) use (&$roles) {
$roles[] = $nodeRef;
}, $this->createNcrContext($request));
r... | php | protected function handle(ListAllRolesRequest $request, Pbjx $pbjx): ListAllRolesResponse
{
$roles = [];
$this->ncr->pipeNodeRefs(RoleV1Mixin::findOne()->getQName(), function (NodeRef $nodeRef) use (&$roles) {
$roles[] = $nodeRef;
}, $this->createNcrContext($request));
r... | [
"protected",
"function",
"handle",
"(",
"ListAllRolesRequest",
"$",
"request",
",",
"Pbjx",
"$",
"pbjx",
")",
":",
"ListAllRolesResponse",
"{",
"$",
"roles",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"ncr",
"->",
"pipeNodeRefs",
"(",
"RoleV1Mixin",
"::",
"fin... | @param ListAllRolesRequest $request
@param Pbjx $pbjx
@return ListAllRolesResponse | [
"@param",
"ListAllRolesRequest",
"$request",
"@param",
"Pbjx",
"$pbjx"
] | train | https://github.com/gdbots/iam-php/blob/3dbfa602de183a7ac5fb5140304e8cf4c4b15ab3/src/ListAllRolesRequestHandler.php#L34-L42 |
gdbots/iam-php | src/ListAllRolesRequestHandler.php | ListAllRolesRequestHandler.createListAllRolesResponse | protected function createListAllRolesResponse(ListAllRolesRequest $request, Pbjx $pbjx): ListAllRolesResponse
{
/** @var ListAllRolesResponse $response */
$response = $this->createResponseFromRequest($request, $pbjx);
return $response;
} | php | protected function createListAllRolesResponse(ListAllRolesRequest $request, Pbjx $pbjx): ListAllRolesResponse
{
/** @var ListAllRolesResponse $response */
$response = $this->createResponseFromRequest($request, $pbjx);
return $response;
} | [
"protected",
"function",
"createListAllRolesResponse",
"(",
"ListAllRolesRequest",
"$",
"request",
",",
"Pbjx",
"$",
"pbjx",
")",
":",
"ListAllRolesResponse",
"{",
"/** @var ListAllRolesResponse $response */",
"$",
"response",
"=",
"$",
"this",
"->",
"createResponseFromRe... | @param ListAllRolesRequest $request
@param Pbjx $pbjx
@return ListAllRolesResponse | [
"@param",
"ListAllRolesRequest",
"$request",
"@param",
"Pbjx",
"$pbjx"
] | train | https://github.com/gdbots/iam-php/blob/3dbfa602de183a7ac5fb5140304e8cf4c4b15ab3/src/ListAllRolesRequestHandler.php#L50-L55 |
odiaseo/pagebuilder | src/PageBuilder/Model/TemplateModel.php | TemplateModel.updateTemplateSections | public function updateTemplateSections($id, $sections)
{
/** @var $entity \PageBuilder\Entity\Template */
if ($entity = $this->findObject($id)) {
/** @var $ts \PageBuilder\Entity\Join\TemplateSection */
foreach ($entity->getTemplateSections() as $ts) {
... | php | public function updateTemplateSections($id, $sections)
{
/** @var $entity \PageBuilder\Entity\Template */
if ($entity = $this->findObject($id)) {
/** @var $ts \PageBuilder\Entity\Join\TemplateSection */
foreach ($entity->getTemplateSections() as $ts) {
... | [
"public",
"function",
"updateTemplateSections",
"(",
"$",
"id",
",",
"$",
"sections",
")",
"{",
"/** @var $entity \\PageBuilder\\Entity\\Template */",
"if",
"(",
"$",
"entity",
"=",
"$",
"this",
"->",
"findObject",
"(",
"$",
"id",
")",
")",
"{",
"/** @var $ts \\... | @param $id
@param $sections
@return mixed | [
"@param",
"$id",
"@param",
"$sections"
] | train | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Model/TemplateModel.php#L33-L68 |
inhere/php-librarys | src/Files/SimpleFinder.php | SimpleFinder.inDir | public function inDir($dirs): self
{
$this->dirs = array_merge($this->dirs, (array)$dirs);
return $this;
} | php | public function inDir($dirs): self
{
$this->dirs = array_merge($this->dirs, (array)$dirs);
return $this;
} | [
"public",
"function",
"inDir",
"(",
"$",
"dirs",
")",
":",
"self",
"{",
"$",
"this",
"->",
"dirs",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"dirs",
",",
"(",
"array",
")",
"$",
"dirs",
")",
";",
"return",
"$",
"this",
";",
"}"
] | alias of the `in()`
@param string|array $dirs
@return SimpleFinder | [
"alias",
"of",
"the",
"in",
"()"
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Files/SimpleFinder.php#L317-L322 |
tequila/mongodb-odm | src/BulkWriteBuilder.php | BulkWriteBuilder.addWriteModel | public function addWriteModel($writeModel)
{
if (is_array($writeModel) || $writeModel instanceof WriteModelInterface) {
$this->writeModels[] = $writeModel;
return $this;
}
throw new InvalidArgumentException(
sprintf(
'$write model must be... | php | public function addWriteModel($writeModel)
{
if (is_array($writeModel) || $writeModel instanceof WriteModelInterface) {
$this->writeModels[] = $writeModel;
return $this;
}
throw new InvalidArgumentException(
sprintf(
'$write model must be... | [
"public",
"function",
"addWriteModel",
"(",
"$",
"writeModel",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"writeModel",
")",
"||",
"$",
"writeModel",
"instanceof",
"WriteModelInterface",
")",
"{",
"$",
"this",
"->",
"writeModels",
"[",
"]",
"=",
"$",
"writ... | @param array|WriteModelInterface $writeModel
@return $this | [
"@param",
"array|WriteModelInterface",
"$writeModel"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/BulkWriteBuilder.php#L41-L56 |
tequila/mongodb-odm | src/BulkWriteBuilder.php | BulkWriteBuilder.deleteMany | public function deleteMany(array $filter, array $options = [])
{
$this->writeModels[] = [BulkWrite::DELETE_MANY => [$filter, $options]];
return $this;
} | php | public function deleteMany(array $filter, array $options = [])
{
$this->writeModels[] = [BulkWrite::DELETE_MANY => [$filter, $options]];
return $this;
} | [
"public",
"function",
"deleteMany",
"(",
"array",
"$",
"filter",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"writeModels",
"[",
"]",
"=",
"[",
"BulkWrite",
"::",
"DELETE_MANY",
"=>",
"[",
"$",
"filter",
",",
"$",
"optio... | @param array $filter
@param array $options
@return $this | [
"@param",
"array",
"$filter",
"@param",
"array",
"$options"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/BulkWriteBuilder.php#L93-L98 |
tequila/mongodb-odm | src/BulkWriteBuilder.php | BulkWriteBuilder.deleteOne | public function deleteOne(array $filter, array $options = [])
{
$this->writeModels[] = [BulkWrite::DELETE_ONE => [$filter, $options]];
return $this;
} | php | public function deleteOne(array $filter, array $options = [])
{
$this->writeModels[] = [BulkWrite::DELETE_ONE => [$filter, $options]];
return $this;
} | [
"public",
"function",
"deleteOne",
"(",
"array",
"$",
"filter",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"writeModels",
"[",
"]",
"=",
"[",
"BulkWrite",
"::",
"DELETE_ONE",
"=>",
"[",
"$",
"filter",
",",
"$",
"options... | @param array $filter
@param array $options
@return $this | [
"@param",
"array",
"$filter",
"@param",
"array",
"$options"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/BulkWriteBuilder.php#L106-L111 |
tequila/mongodb-odm | src/BulkWriteBuilder.php | BulkWriteBuilder.insertMany | public function insertMany(array $documents)
{
foreach ($documents as $document) {
$this->writeModels[] = [BulkWrite::INSERT_ONE => [$document]];
}
return $this;
} | php | public function insertMany(array $documents)
{
foreach ($documents as $document) {
$this->writeModels[] = [BulkWrite::INSERT_ONE => [$document]];
}
return $this;
} | [
"public",
"function",
"insertMany",
"(",
"array",
"$",
"documents",
")",
"{",
"foreach",
"(",
"$",
"documents",
"as",
"$",
"document",
")",
"{",
"$",
"this",
"->",
"writeModels",
"[",
"]",
"=",
"[",
"BulkWrite",
"::",
"INSERT_ONE",
"=>",
"[",
"$",
"doc... | @param array $documents
@return $this | [
"@param",
"array",
"$documents"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/BulkWriteBuilder.php#L118-L125 |
tequila/mongodb-odm | src/BulkWriteBuilder.php | BulkWriteBuilder.updateMany | public function updateMany(array $filter, array $update, array $options = [])
{
$this->writeModels[] = [BulkWrite::UPDATE_MANY => [$filter, $update, $options]];
return $this;
} | php | public function updateMany(array $filter, array $update, array $options = [])
{
$this->writeModels[] = [BulkWrite::UPDATE_MANY => [$filter, $update, $options]];
return $this;
} | [
"public",
"function",
"updateMany",
"(",
"array",
"$",
"filter",
",",
"array",
"$",
"update",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"writeModels",
"[",
"]",
"=",
"[",
"BulkWrite",
"::",
"UPDATE_MANY",
"=>",
"[",
"$... | @param array $filter
@param array $update
@param array $options
@return $this | [
"@param",
"array",
"$filter",
"@param",
"array",
"$update",
"@param",
"array",
"$options"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/BulkWriteBuilder.php#L146-L151 |
tequila/mongodb-odm | src/BulkWriteBuilder.php | BulkWriteBuilder.updateOne | public function updateOne(array $filter, array $update, array $options = [])
{
$this->writeModels[] = [BulkWrite::UPDATE_ONE => [$filter, $update, $options]];
return $this;
} | php | public function updateOne(array $filter, array $update, array $options = [])
{
$this->writeModels[] = [BulkWrite::UPDATE_ONE => [$filter, $update, $options]];
return $this;
} | [
"public",
"function",
"updateOne",
"(",
"array",
"$",
"filter",
",",
"array",
"$",
"update",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"writeModels",
"[",
"]",
"=",
"[",
"BulkWrite",
"::",
"UPDATE_ONE",
"=>",
"[",
"$",... | @param array $filter
@param array $update
@param array $options
@return $this | [
"@param",
"array",
"$filter",
"@param",
"array",
"$update",
"@param",
"array",
"$options"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/BulkWriteBuilder.php#L160-L165 |
tequila/mongodb-odm | src/BulkWriteBuilder.php | BulkWriteBuilder.replaceOne | public function replaceOne(array $filter, $replacement, array $options = [])
{
$this->writeModels[] = [BulkWrite::REPLACE_ONE => [$filter, $replacement, $options]];
return $this;
} | php | public function replaceOne(array $filter, $replacement, array $options = [])
{
$this->writeModels[] = [BulkWrite::REPLACE_ONE => [$filter, $replacement, $options]];
return $this;
} | [
"public",
"function",
"replaceOne",
"(",
"array",
"$",
"filter",
",",
"$",
"replacement",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"writeModels",
"[",
"]",
"=",
"[",
"BulkWrite",
"::",
"REPLACE_ONE",
"=>",
"[",
"$",
"... | @param array $filter
@param array|object $replacement
@param array $options
@return $this | [
"@param",
"array",
"$filter",
"@param",
"array|object",
"$replacement",
"@param",
"array",
"$options"
] | train | https://github.com/tequila/mongodb-odm/blob/501d58529bbcb23ad7839680462f62d5c3466d23/src/BulkWriteBuilder.php#L174-L179 |
oroinc/OroLayoutComponent | Loader/Visitor/SimpleContextValueComparisonConditionVisitor.php | SimpleContextValueComparisonConditionVisitor.startVisit | public function startVisit(VisitContext $visitContext)
{
$visitContext->getUpdateMethodWriter()
->writeln('if (')
->indent()
->write(sprintf('$%s->getContext()', LayoutUpdateGeneratorInterface::PARAM_LAYOUT_ITEM))
->write(sprintf('->getOr(\'%s\')', $th... | php | public function startVisit(VisitContext $visitContext)
{
$visitContext->getUpdateMethodWriter()
->writeln('if (')
->indent()
->write(sprintf('$%s->getContext()', LayoutUpdateGeneratorInterface::PARAM_LAYOUT_ITEM))
->write(sprintf('->getOr(\'%s\')', $th... | [
"public",
"function",
"startVisit",
"(",
"VisitContext",
"$",
"visitContext",
")",
"{",
"$",
"visitContext",
"->",
"getUpdateMethodWriter",
"(",
")",
"->",
"writeln",
"(",
"'if ('",
")",
"->",
"indent",
"(",
")",
"->",
"write",
"(",
"sprintf",
"(",
"'$%s->ge... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/Visitor/SimpleContextValueComparisonConditionVisitor.php#L34-L46 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/Scrybe/Converter/RestructuredText/Roles/Doc.php | Doc.toXhtml | public function toXhtml(\DOMDocument $document, \DOMElement $root)
{
$content = '';
$caption = '';
foreach ($this->node->nodes as $node) {
$content .= $node->token->content;
}
$matches = array();
if (preg_match('/([^<]*)<?([^>]*)>?/', $content, $matches)... | php | public function toXhtml(\DOMDocument $document, \DOMElement $root)
{
$content = '';
$caption = '';
foreach ($this->node->nodes as $node) {
$content .= $node->token->content;
}
$matches = array();
if (preg_match('/([^<]*)<?([^>]*)>?/', $content, $matches)... | [
"public",
"function",
"toXhtml",
"(",
"\\",
"DOMDocument",
"$",
"document",
",",
"\\",
"DOMElement",
"$",
"root",
")",
"{",
"$",
"content",
"=",
"''",
";",
"$",
"caption",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"node",
"->",
"nodes",
"as"... | Transform text role to HTML.
Create a XHTML structure at the text roles position in the document.
@param \DOMDocument $document
@param \DOMElement $root
@return void | [
"Transform",
"text",
"role",
"to",
"HTML",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/Scrybe/Converter/RestructuredText/Roles/Doc.php#L47-L83 |
kecik-framework/kecik | Kecik/Route.php | Route.init | public static function init() {
if ( php_sapi_name() == 'cli' ) {
self::$BasePath = str_replace( '/', DIRECTORY_SEPARATOR, dirname( __FILE__ ) . '/' );
} else {
self::$BasePath = str_replace( '/', DIRECTORY_SEPARATOR, realpath( dirname( __FILE__ ) ) . "/" );
}
if ( isset( $_SERVER['HTTPS'] ) ||
( ... | php | public static function init() {
if ( php_sapi_name() == 'cli' ) {
self::$BasePath = str_replace( '/', DIRECTORY_SEPARATOR, dirname( __FILE__ ) . '/' );
} else {
self::$BasePath = str_replace( '/', DIRECTORY_SEPARATOR, realpath( dirname( __FILE__ ) ) . "/" );
}
if ( isset( $_SERVER['HTTPS'] ) ||
( ... | [
"public",
"static",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"php_sapi_name",
"(",
")",
"==",
"'cli'",
")",
"{",
"self",
"::",
"$",
"BasePath",
"=",
"str_replace",
"(",
"'/'",
",",
"DIRECTORY_SEPARATOR",
",",
"dirname",
"(",
"__FILE__",
")",
".",
... | Initialization Route Class | [
"Initialization",
"Route",
"Class"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L99-L187 |
kecik-framework/kecik | Kecik/Route.php | Route._getParams | public function _getParams( $key = - 1 ) {
if ( $key >= 0 ) {
if ( isset( self::$params[ $key ] ) ) {
return self::$params[ $key ];
} else {
return NULL;
}
} else {
return self::$params;
}
} | php | public function _getParams( $key = - 1 ) {
if ( $key >= 0 ) {
if ( isset( self::$params[ $key ] ) ) {
return self::$params[ $key ];
} else {
return NULL;
}
} else {
return self::$params;
}
} | [
"public",
"function",
"_getParams",
"(",
"$",
"key",
"=",
"-",
"1",
")",
"{",
"if",
"(",
"$",
"key",
">=",
"0",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"params",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$",
... | get Route Paramenters
@param int $key
@return array|null | [
"get",
"Route",
"Paramenters"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L196-L209 |
kecik-framework/kecik | Kecik/Route.php | Route.getParams | public function getParams( $key = - 1 ) {
if ( $key >= 0 ) {
if ( isset( self::$RealParams[ $key ] ) ) {
return self::$RealParams[ $key ];
} else {
return NULL;
}
} else {
return self::$RealParams;
}
} | php | public function getParams( $key = - 1 ) {
if ( $key >= 0 ) {
if ( isset( self::$RealParams[ $key ] ) ) {
return self::$RealParams[ $key ];
} else {
return NULL;
}
} else {
return self::$RealParams;
}
} | [
"public",
"function",
"getParams",
"(",
"$",
"key",
"=",
"-",
"1",
")",
"{",
"if",
"(",
"$",
"key",
">=",
"0",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"RealParams",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"self",
"::",
"$... | get Real Route Paramters
@param int $key
@return array|null | [
"get",
"Real",
"Route",
"Paramters",
"@param",
"int",
"$key"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L217-L230 |
kecik-framework/kecik | Kecik/Route.php | Route.setParams | public function setParams( $key, $value = '' ) {
//if (!isset($this->params)) $this->params = array();
if ( is_array( $key ) ) {
self::$RealParams = $key;
} else {
self::$RealParams[ $key ] = $value;
}
} | php | public function setParams( $key, $value = '' ) {
//if (!isset($this->params)) $this->params = array();
if ( is_array( $key ) ) {
self::$RealParams = $key;
} else {
self::$RealParams[ $key ] = $value;
}
} | [
"public",
"function",
"setParams",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"''",
")",
"{",
"//if (!isset($this->params)) $this->params = array();",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"self",
"::",
"$",
"RealParams",
"=",
"$",
"key",
";... | Set route paramters
@param $key
@param string $value | [
"Set",
"route",
"paramters"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L238-L247 |
kecik-framework/kecik | Kecik/Route.php | Route.is | public function is( $route = '' ) {
if ( $route == '' ) {
return self::$destination;
} else {
if ( self::$destination == $route ) {
return TRUE;
} else {
return FALSE;
}
}
} | php | public function is( $route = '' ) {
if ( $route == '' ) {
return self::$destination;
} else {
if ( self::$destination == $route ) {
return TRUE;
} else {
return FALSE;
}
}
} | [
"public",
"function",
"is",
"(",
"$",
"route",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"route",
"==",
"''",
")",
"{",
"return",
"self",
"::",
"$",
"destination",
";",
"}",
"else",
"{",
"if",
"(",
"self",
"::",
"$",
"destination",
"==",
"$",
"route",... | Get or Check current route
@param string $route
@return bool|string | [
"Get",
"or",
"Check",
"current",
"route",
"@param",
"string",
"$route"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L273-L287 |
kecik-framework/kecik | Kecik/Route.php | Route.isPut | public function isPut() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'PUT' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'PUT' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHOD'] );
... | php | public function isPut() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'PUT' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'PUT' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHOD'] );
... | [
"public",
"function",
"isPut",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
"==",
"'PUT'",
"||",
"(",
"isset",
"(",
"$",
"_POST",
"[",
... | Check request of Put method
@return bool | [
"Check",
"request",
"of",
"Put",
"method"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L335-L357 |
kecik-framework/kecik | Kecik/Route.php | Route.isDelete | public function isDelete() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'DELETE' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'DELETE' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHO... | php | public function isDelete() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'DELETE' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'DELETE' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHO... | [
"public",
"function",
"isDelete",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
"==",
"'DELETE'",
"||",
"(",
"isset",
"(",
"$",
"_POST",
"... | Check request of delete method
@return bool | [
"Check",
"request",
"of",
"delete",
"method"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L364-L385 |
kecik-framework/kecik | Kecik/Route.php | Route.isPatch | public function isPatch() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'PATCH' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'PATCH' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHOD']... | php | public function isPatch() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'PATCH' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'PATCH' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_METHOD']... | [
"public",
"function",
"isPatch",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
"==",
"'PATCH'",
"||",
"(",
"isset",
"(",
"$",
"_POST",
"["... | Check request of Patch method
@return bool | [
"Check",
"request",
"of",
"Patch",
"method"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L392-L413 |
kecik-framework/kecik | Kecik/Route.php | Route.isOptions | public function isOptions() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'OPTIONS' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_ME... | php | public function isOptions() {
if ( isset( $_SERVER['REQUEST_METHOD'] ) ) {
if ( $_SERVER['REQUEST_METHOD'] == 'OPTIONS' || ( isset( $_POST['_METHOD'] ) && $_POST['_METHOD'] == 'OPTIONS' ) ) {
parse_str( file_get_contents( "php://input" ), $vars );
if ( isset( $vars['_METHOD'] ) ) {
unset( $vars['_ME... | [
"public",
"function",
"isOptions",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
"==",
"'OPTIONS'",
"||",
"(",
"isset",
"(",
"$",
"_POST",
... | Check request of Options method
@return bool | [
"Check",
"request",
"of",
"Options",
"method"
] | train | https://github.com/kecik-framework/kecik/blob/fa87e593affe1c9c51a2acd264b85ec06df31d7c/Kecik/Route.php#L420-L441 |
GrupaZero/api | src/Gzero/Api/Transformer/BlockTransformer.php | BlockTransformer.transform | public function transform($block)
{
$block = $this->entityToArray(Block::class, $block);
return [
'id' => $this->setNullableValue($block['id']),
'type' => $block['type'],
'region' => $block['region'],
'filter' => $block['filte... | php | public function transform($block)
{
$block = $this->entityToArray(Block::class, $block);
return [
'id' => $this->setNullableValue($block['id']),
'type' => $block['type'],
'region' => $block['region'],
'filter' => $block['filte... | [
"public",
"function",
"transform",
"(",
"$",
"block",
")",
"{",
"$",
"block",
"=",
"$",
"this",
"->",
"entityToArray",
"(",
"Block",
"::",
"class",
",",
"$",
"block",
")",
";",
"return",
"[",
"'id'",
"=>",
"$",
"this",
"->",
"setNullableValue",
"(",
... | Transforms block entity
@param Block|array $block Block entity
@return array | [
"Transforms",
"block",
"entity"
] | train | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/BlockTransformer.php#L45-L61 |
GrupaZero/api | src/Gzero/Api/Transformer/BlockTransformer.php | BlockTransformer.includeTranslations | public function includeTranslations(Block $block)
{
$translations = $block->translations;
return $this->collection($translations, new BlockTranslationTransformer());
} | php | public function includeTranslations(Block $block)
{
$translations = $block->translations;
return $this->collection($translations, new BlockTranslationTransformer());
} | [
"public",
"function",
"includeTranslations",
"(",
"Block",
"$",
"block",
")",
"{",
"$",
"translations",
"=",
"$",
"block",
"->",
"translations",
";",
"return",
"$",
"this",
"->",
"collection",
"(",
"$",
"translations",
",",
"new",
"BlockTranslationTransformer",
... | Include Translations
@param Block $block Translation
@return \League\Fractal\ItemResource | [
"Include",
"Translations"
] | train | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/BlockTransformer.php#L71-L75 |
GrupaZero/api | src/Gzero/Api/Transformer/BlockTransformer.php | BlockTransformer.includeAuthor | public function includeAuthor(Block $block)
{
$author = $block->author;
return (!empty($author)) ? $this->item($author, new UserTransformer()) : null;
} | php | public function includeAuthor(Block $block)
{
$author = $block->author;
return (!empty($author)) ? $this->item($author, new UserTransformer()) : null;
} | [
"public",
"function",
"includeAuthor",
"(",
"Block",
"$",
"block",
")",
"{",
"$",
"author",
"=",
"$",
"block",
"->",
"author",
";",
"return",
"(",
"!",
"empty",
"(",
"$",
"author",
")",
")",
"?",
"$",
"this",
"->",
"item",
"(",
"$",
"author",
",",
... | Include Author
@param Block $block User
@return \League\Fractal\ItemResource | [
"Include",
"Author"
] | train | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/BlockTransformer.php#L84-L88 |
GrupaZero/api | src/Gzero/Api/Transformer/BlockTransformer.php | BlockTransformer.includeBlockabale | public function includeBlockabale(Block $block)
{
$blockable = $block->blockable;
if (!empty($blockable)) {
$entityClassName = (new ReflectionClass($blockable))->getShortName();
$transformerClass = 'Gzero\\Api\\Transformer\\' . $entityClassName . 'Transformer';
r... | php | public function includeBlockabale(Block $block)
{
$blockable = $block->blockable;
if (!empty($blockable)) {
$entityClassName = (new ReflectionClass($blockable))->getShortName();
$transformerClass = 'Gzero\\Api\\Transformer\\' . $entityClassName . 'Transformer';
r... | [
"public",
"function",
"includeBlockabale",
"(",
"Block",
"$",
"block",
")",
"{",
"$",
"blockable",
"=",
"$",
"block",
"->",
"blockable",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"blockable",
")",
")",
"{",
"$",
"entityClassName",
"=",
"(",
"new",
"Refle... | Include Author
@param Block $block User
@return \League\Fractal\ItemResource | [
"Include",
"Author"
] | train | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Transformer/BlockTransformer.php#L97-L106 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php | Dwootemplate.add_js | public function add_js($js) {
$current = $this->dwoo_data->js_files;
$current[] = $js;
$this->dwoo_data->js_files = $current;
} | php | public function add_js($js) {
$current = $this->dwoo_data->js_files;
$current[] = $js;
$this->dwoo_data->js_files = $current;
} | [
"public",
"function",
"add_js",
"(",
"$",
"js",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"dwoo_data",
"->",
"js_files",
";",
"$",
"current",
"[",
"]",
"=",
"$",
"js",
";",
"$",
"this",
"->",
"dwoo_data",
"->",
"js_files",
"=",
"$",
"curren... | Add Javascript files to template
@param string $js | [
"Add",
"Javascript",
"files",
"to",
"template"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php#L66-L70 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php | Dwootemplate.add_css | public function add_css($css) {
$current = $this->dwoo_data->css_files;
$current[] = $css;
$this->dwoo_data->css_files = $current;
} | php | public function add_css($css) {
$current = $this->dwoo_data->css_files;
$current[] = $css;
$this->dwoo_data->css_files = $current;
} | [
"public",
"function",
"add_css",
"(",
"$",
"css",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"dwoo_data",
"->",
"css_files",
";",
"$",
"current",
"[",
"]",
"=",
"$",
"css",
";",
"$",
"this",
"->",
"dwoo_data",
"->",
"css_files",
"=",
"$",
"c... | Add Css stylesheets to template
@param string $css | [
"Add",
"Css",
"stylesheets",
"to",
"template"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php#L78-L82 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php | Dwootemplate.display | public function display($sTemplate, $return = FALSE) {
// Start benchmark
$CI = get_instance();
$CI->benchmark->mark('dwoo_parse_start');
// Check if file exists
if ( !file_exists($this->template_dir . $sTemplate ) ) {
$message = sprintf('Template file \'%s\' not fou... | php | public function display($sTemplate, $return = FALSE) {
// Start benchmark
$CI = get_instance();
$CI->benchmark->mark('dwoo_parse_start');
// Check if file exists
if ( !file_exists($this->template_dir . $sTemplate ) ) {
$message = sprintf('Template file \'%s\' not fou... | [
"public",
"function",
"display",
"(",
"$",
"sTemplate",
",",
"$",
"return",
"=",
"FALSE",
")",
"{",
"// Start benchmark",
"$",
"CI",
"=",
"get_instance",
"(",
")",
";",
"$",
"CI",
"->",
"benchmark",
"->",
"mark",
"(",
"'dwoo_parse_start'",
")",
";",
"// ... | Display or return the compiled template
Since we assign the results to the standard CI output module
you can also use the helper from CI in your templates!!
@param string $sTemplate
@param boolean $return
@return mixed | [
"Display",
"or",
"return",
"the",
"compiled",
"template",
"Since",
"we",
"assign",
"the",
"results",
"to",
"the",
"standard",
"CI",
"output",
"module",
"you",
"can",
"also",
"use",
"the",
"helper",
"from",
"CI",
"in",
"your",
"templates!!"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php#L94-L121 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php | Dwootemplate.initialize | private function initialize() {
$CI = get_instance();
$CI->config->load('dwootemplate', TRUE);
$config = $CI->config->item('dwootemplate');
foreach ($config as $key => $val) {
$this->$key = $val;
}
} | php | private function initialize() {
$CI = get_instance();
$CI->config->load('dwootemplate', TRUE);
$config = $CI->config->item('dwootemplate');
foreach ($config as $key => $val) {
$this->$key = $val;
}
} | [
"private",
"function",
"initialize",
"(",
")",
"{",
"$",
"CI",
"=",
"get_instance",
"(",
")",
";",
"$",
"CI",
"->",
"config",
"->",
"load",
"(",
"'dwootemplate'",
",",
"TRUE",
")",
";",
"$",
"config",
"=",
"$",
"CI",
"->",
"config",
"->",
"item",
"... | Assign the dwootemplate config items to the instance | [
"Assign",
"the",
"dwootemplate",
"config",
"items",
"to",
"the",
"instance"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Adapters/CodeIgniter/libraries/Dwootemplate.php#L164-L171 |
rem42/scraper | Utils/Tools.php | Tools.frenchDateToEnglish | public static function frenchDateToEnglish($date)
{
$date = mb_strtolower($date);
$date = ucwords($date);
$frenchDays = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'];
$englishDays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
$date = st... | php | public static function frenchDateToEnglish($date)
{
$date = mb_strtolower($date);
$date = ucwords($date);
$frenchDays = ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'];
$englishDays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
$date = st... | [
"public",
"static",
"function",
"frenchDateToEnglish",
"(",
"$",
"date",
")",
"{",
"$",
"date",
"=",
"mb_strtolower",
"(",
"$",
"date",
")",
";",
"$",
"date",
"=",
"ucwords",
"(",
"$",
"date",
")",
";",
"$",
"frenchDays",
"=",
"[",
"'Lundi'",
",",
"'... | @param $date
@return mixed|null|string|string[] | [
"@param",
"$date"
] | train | https://github.com/rem42/scraper/blob/7c4ec23ce61b8187f2d8cfebdd233525359adb83/Utils/Tools.php#L12-L26 |
devgiants/mosquitto-clients-php-react-wrapper | src/Client/MosquittoClientsReactWrapper.php | MosquittoClientsReactWrapper.create | public static function create( LoopInterface $loop ) {
// Check clients are installed
if ( ! static::hasDependency() ) {
exit(Codes::MOSQUITTO_CLIENTS_NOT_INSTALLED);
}
// Check config files presents
if ( ! file_exists( $_SERVER['HOME'] . '/.config/mosquitto_pub' ) ) {
exit(Codes::MOSQUITTO_PUB_CONFIG... | php | public static function create( LoopInterface $loop ) {
// Check clients are installed
if ( ! static::hasDependency() ) {
exit(Codes::MOSQUITTO_CLIENTS_NOT_INSTALLED);
}
// Check config files presents
if ( ! file_exists( $_SERVER['HOME'] . '/.config/mosquitto_pub' ) ) {
exit(Codes::MOSQUITTO_PUB_CONFIG... | [
"public",
"static",
"function",
"create",
"(",
"LoopInterface",
"$",
"loop",
")",
"{",
"// Check clients are installed",
"if",
"(",
"!",
"static",
"::",
"hasDependency",
"(",
")",
")",
"{",
"exit",
"(",
"Codes",
"::",
"MOSQUITTO_CLIENTS_NOT_INSTALLED",
")",
";",... | @param LoopInterface $loop
@return static
@throws MosquittoClientsMissingConfigFileException
@throws MosquittoClientsMissingException | [
"@param",
"LoopInterface",
"$loop"
] | train | https://github.com/devgiants/mosquitto-clients-php-react-wrapper/blob/1ac770e4a55e81eac272f0adb2c80fb450a9345b/src/Client/MosquittoClientsReactWrapper.php#L54-L71 |
Opifer/EavBundle | Form/Type/AttributeType.php | AttributeType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('valueType', ValueProviderType::class, [
'label' => 'attribute.value_type',
'attr' => [
'placeholder' => 'form.value_type.placeholder',
'help_text' => 'form.val... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('valueType', ValueProviderType::class, [
'label' => 'attribute.value_type',
'attr' => [
'placeholder' => 'form.value_type.placeholder',
'help_text' => 'form.val... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"$",
"builder",
"->",
"add",
"(",
"'valueType'",
",",
"ValueProviderType",
"::",
"class",
",",
"[",
"'label'",
"=>",
"'attribute.value_type'",... | {@inheritDoc} | [
"{"
] | train | https://github.com/Opifer/EavBundle/blob/4236fdc28b7574dac43f420704d0fc3c04905a4c/Form/Type/AttributeType.php#L39-L96 |
i-lateral/silverstripe-modeladminplus | src/DataObjectExtension.php | DataObjectExtension.getModelAdminSearchContext | public function getModelAdminSearchContext()
{
return SearchContext::create(
get_class($this->getOwner()),
$this->getOwner()->scaffoldSearchFields(),
$this->getOwner()->defaultSearchFilters()
);
} | php | public function getModelAdminSearchContext()
{
return SearchContext::create(
get_class($this->getOwner()),
$this->getOwner()->scaffoldSearchFields(),
$this->getOwner()->defaultSearchFilters()
);
} | [
"public",
"function",
"getModelAdminSearchContext",
"(",
")",
"{",
"return",
"SearchContext",
"::",
"create",
"(",
"get_class",
"(",
"$",
"this",
"->",
"getOwner",
"(",
")",
")",
",",
"$",
"this",
"->",
"getOwner",
"(",
")",
"->",
"scaffoldSearchFields",
"("... | Get a custom search context for model admin plus | [
"Get",
"a",
"custom",
"search",
"context",
"for",
"model",
"admin",
"plus"
] | train | https://github.com/i-lateral/silverstripe-modeladminplus/blob/c5209d9610cdb36ddc7b9231fad342df7e75ffc0/src/DataObjectExtension.php#L12-L19 |
InactiveProjects/limoncello-illuminate | app/Http/Controllers/Api/BoardsController.php | BoardsController.indexPosts | public function indexPosts($boardId)
{
$parameters = $this->getRequest()->getParameters();
$pagedData = $this->getApi()->indexPosts($boardId, $parameters);
return $this->getResponses()->getPagedDataResponse($pagedData);
} | php | public function indexPosts($boardId)
{
$parameters = $this->getRequest()->getParameters();
$pagedData = $this->getApi()->indexPosts($boardId, $parameters);
return $this->getResponses()->getPagedDataResponse($pagedData);
} | [
"public",
"function",
"indexPosts",
"(",
"$",
"boardId",
")",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParameters",
"(",
")",
";",
"$",
"pagedData",
"=",
"$",
"this",
"->",
"getApi",
"(",
")",
"->",
"indexPosts"... | @param string $boardId
@return Response | [
"@param",
"string",
"$boardId"
] | train | https://github.com/InactiveProjects/limoncello-illuminate/blob/cae6fc26190efcf090495a5c3582c10fa2430897/app/Http/Controllers/Api/BoardsController.php#L33-L40 |
fccn/oai-pmh-core | src/schemas/ands_dces.php | ANDS_DCES.create_dc_node | protected function create_dc_node($name, $value = '')
{
if (empty($value)) {
return;
}
$this->addChild($this->working_node, "dc:".$name, utf8_encode($value));
} | php | protected function create_dc_node($name, $value = '')
{
if (empty($value)) {
return;
}
$this->addChild($this->working_node, "dc:".$name, utf8_encode($value));
} | [
"protected",
"function",
"create_dc_node",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"addChild",
"(",
"$",
"this",
"->",
"working_node",
",... | Creates a generic dc:element node | [
"Creates",
"a",
"generic",
"dc",
":",
"element",
"node"
] | train | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/schemas/ands_dces.php#L87-L93 |
fccn/oai-pmh-core | src/schemas/ands_dces.php | DC_DataHolder.combine | public function combine($another)
{
if (is_a($another, DC_DataHolder::getKlass())) {
// debug_message("entering combine...");
// debug_var_dump("another", $another);
//identifier
if (empty($this->identifier)) {
debug_message("DC_DataHolder::ide... | php | public function combine($another)
{
if (is_a($another, DC_DataHolder::getKlass())) {
// debug_message("entering combine...");
// debug_var_dump("another", $another);
//identifier
if (empty($this->identifier)) {
debug_message("DC_DataHolder::ide... | [
"public",
"function",
"combine",
"(",
"$",
"another",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"another",
",",
"DC_DataHolder",
"::",
"getKlass",
"(",
")",
")",
")",
"{",
"// debug_message(\"entering combine...\");",
"// debug_var_dump(\"another\", $another);",
"//ide... | Combines this object with another DC_DataHolder object | [
"Combines",
"this",
"object",
"with",
"another",
"DC_DataHolder",
"object"
] | train | https://github.com/fccn/oai-pmh-core/blob/a9c6852482c7bd7c48911a2165120325ecc27ea2/src/schemas/ands_dces.php#L184-L214 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.