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 |
|---|---|---|---|---|---|---|---|---|---|---|
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.initialise | public function initialise($options = array())
{
// Set the language in the class.
$config = JFactory::getConfig();
// Check that we were given a language in the array (since by default may be blank).
if (isset($options['language']))
{
$config->set('language', $options['language']);
}
// Set user sp... | php | public function initialise($options = array())
{
// Set the language in the class.
$config = JFactory::getConfig();
// Check that we were given a language in the array (since by default may be blank).
if (isset($options['language']))
{
$config->set('language', $options['language']);
}
// Set user sp... | [
"public",
"function",
"initialise",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"// Set the language in the class.",
"$",
"config",
"=",
"JFactory",
"::",
"getConfig",
"(",
")",
";",
"// Check that we were given a language in the array (since by default may be ... | Initialise the application.
@param array $options An optional associative array of configuration settings.
@return void
@since 11.1
@deprecated 4.0 | [
"Initialise",
"the",
"application",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L194-L224 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.route | public function route()
{
// Get the full request URI.
$uri = clone JUri::getInstance();
$router = $this->getRouter();
$result = $router->parse($uri);
foreach ($result as $key => $value)
{
$this->input->def($key, $value);
}
// Trigger the onAfterRoute event.
JPluginHelper::importPlugin('system'... | php | public function route()
{
// Get the full request URI.
$uri = clone JUri::getInstance();
$router = $this->getRouter();
$result = $router->parse($uri);
foreach ($result as $key => $value)
{
$this->input->def($key, $value);
}
// Trigger the onAfterRoute event.
JPluginHelper::importPlugin('system'... | [
"public",
"function",
"route",
"(",
")",
"{",
"// Get the full request URI.",
"$",
"uri",
"=",
"clone",
"JUri",
"::",
"getInstance",
"(",
")",
";",
"$",
"router",
"=",
"$",
"this",
"->",
"getRouter",
"(",
")",
";",
"$",
"result",
"=",
"$",
"router",
"-... | Route the application.
Routing is the process of examining the request environment to determine which
component should receive the request. The component optional parameters
are then set in the request object to be processed when the application is being
dispatched.
@return void
@since 11.1
@deprecated 4.0 | [
"Route",
"the",
"application",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L239-L255 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.dispatch | public function dispatch($component = null)
{
$document = JFactory::getDocument();
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
... | php | public function dispatch($component = null)
{
$document = JFactory::getDocument();
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer($contents, 'component');
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('system');
$this->triggerEvent('onAfterDispatch');
... | [
"public",
"function",
"dispatch",
"(",
"$",
"component",
"=",
"null",
")",
"{",
"$",
"document",
"=",
"JFactory",
"::",
"getDocument",
"(",
")",
";",
"$",
"contents",
"=",
"JComponentHelper",
"::",
"renderComponent",
"(",
"$",
"component",
")",
";",
"$",
... | Dispatch the application.
Dispatching is the process of pulling the option from the request object and
mapping them to a component. If the component does not exist, it handles
determining a default component to dispatch.
@param string $component The component to dispatch.
@return void
@since 11.1
@deprecated... | [
"Dispatch",
"the",
"application",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L271-L281 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.render | public function render()
{
$template = $this->getTemplate(true);
$params = array('template' => $template->template, 'file' => 'index.php', 'directory' => JPATH_THEMES, 'params' => $template->params);
// Parse the document.
$document = JFactory::getDocument();
$document->parse($params);
// Trigger the on... | php | public function render()
{
$template = $this->getTemplate(true);
$params = array('template' => $template->template, 'file' => 'index.php', 'directory' => JPATH_THEMES, 'params' => $template->params);
// Parse the document.
$document = JFactory::getDocument();
$document->parse($params);
// Trigger the on... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"template",
"=",
"$",
"this",
"->",
"getTemplate",
"(",
"true",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'template'",
"=>",
"$",
"template",
"->",
"template",
",",
"'file'",
"=>",
"'index.php'",
"... | Render the application.
Rendering is the process of pushing the document buffers into the template
placeholders, retrieving data from the document and pushing it into
the JResponse buffer.
@return void
@since 11.1
@deprecated 4.0 | [
"Render",
"the",
"application",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L295-L315 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.redirect | public function redirect($url, $msg = '', $msgType = 'message', $moved = false)
{
// Check for relative internal links.
if (preg_match('#^index2?\.php#', $url))
{
$url = JUri::base() . $url;
}
// Strip out any line breaks.
$url = preg_split("/[\r\n]/", $url);
$url = $url[0];
/*
* If we don't st... | php | public function redirect($url, $msg = '', $msgType = 'message', $moved = false)
{
// Check for relative internal links.
if (preg_match('#^index2?\.php#', $url))
{
$url = JUri::base() . $url;
}
// Strip out any line breaks.
$url = preg_split("/[\r\n]/", $url);
$url = $url[0];
/*
* If we don't st... | [
"public",
"function",
"redirect",
"(",
"$",
"url",
",",
"$",
"msg",
"=",
"''",
",",
"$",
"msgType",
"=",
"'message'",
",",
"$",
"moved",
"=",
"false",
")",
"{",
"// Check for relative internal links.",
"if",
"(",
"preg_match",
"(",
"'#^index2?\\.php#'",
",",... | Redirect to another URL.
Optionally enqueues a message in the system message queue (which will be displayed
the next time a page is loaded) using the enqueueMessage method. If the headers have
not been sent the redirect will be accomplished using a "301 Moved Permanently"
code in the header pointing to the new locatio... | [
"Redirect",
"to",
"another",
"URL",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L338-L414 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.enqueueMessage | public function enqueueMessage($msg, $type = 'message')
{
// For empty queue, if messages exists in the session, enqueue them first.
if (!count($this->_messageQueue))
{
$session = JFactory::getSession();
$sessionQueue = $session->get('application.queue');
if (count($sessionQueue))
{
$this->_mess... | php | public function enqueueMessage($msg, $type = 'message')
{
// For empty queue, if messages exists in the session, enqueue them first.
if (!count($this->_messageQueue))
{
$session = JFactory::getSession();
$sessionQueue = $session->get('application.queue');
if (count($sessionQueue))
{
$this->_mess... | [
"public",
"function",
"enqueueMessage",
"(",
"$",
"msg",
",",
"$",
"type",
"=",
"'message'",
")",
"{",
"// For empty queue, if messages exists in the session, enqueue them first.",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"_messageQueue",
")",
")",
"{",
"$... | Enqueue a system message.
@param string $msg The message to enqueue.
@param string $type The message type. Default is message.
@return void
@since 11.1
@deprecated 4.0 | [
"Enqueue",
"a",
"system",
"message",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L427-L444 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.getMessageQueue | public function getMessageQueue()
{
// For empty queue, if messages exists in the session, enqueue them.
if (!count($this->_messageQueue))
{
$session = JFactory::getSession();
$sessionQueue = $session->get('application.queue');
if (count($sessionQueue))
{
$this->_messageQueue = $sessionQueue;
... | php | public function getMessageQueue()
{
// For empty queue, if messages exists in the session, enqueue them.
if (!count($this->_messageQueue))
{
$session = JFactory::getSession();
$sessionQueue = $session->get('application.queue');
if (count($sessionQueue))
{
$this->_messageQueue = $sessionQueue;
... | [
"public",
"function",
"getMessageQueue",
"(",
")",
"{",
"// For empty queue, if messages exists in the session, enqueue them.",
"if",
"(",
"!",
"count",
"(",
"$",
"this",
"->",
"_messageQueue",
")",
")",
"{",
"$",
"session",
"=",
"JFactory",
"::",
"getSession",
"(",... | Get the system message queue.
@return array The system message queue.
@since 11.1
@deprecated 4.0 | [
"Get",
"the",
"system",
"message",
"queue",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L454-L470 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.getName | public function getName()
{
$name = $this->_name;
if (empty($name))
{
$r = null;
if (!preg_match('/J(.*)/i', get_class($this), $r))
{
JLog::add(JText::_('JLIB_APPLICATION_ERROR_APPLICATION_GET_NAME'), JLog::WARNING, 'jerror');
}
$name = strtolower($r[1]);
}
return $name;
} | php | public function getName()
{
$name = $this->_name;
if (empty($name))
{
$r = null;
if (!preg_match('/J(.*)/i', get_class($this), $r))
{
JLog::add(JText::_('JLIB_APPLICATION_ERROR_APPLICATION_GET_NAME'), JLog::WARNING, 'jerror');
}
$name = strtolower($r[1]);
}
return $name;
} | [
"public",
"function",
"getName",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"_name",
";",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
")",
"{",
"$",
"r",
"=",
"null",
";",
"if",
"(",
"!",
"preg_match",
"(",
"'/J(.*)/i'",
",",
"get_class",... | Method to get the application name.
The dispatcher name is by default parsed using the classname, or it can be set
by passing a $config['name'] in the class constructor.
@return string The name of the dispatcher.
@since 11.1
@deprecated 4.0 | [
"Method",
"to",
"get",
"the",
"application",
"name",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L503-L520 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.getUserStateFromRequest | public function getUserStateFromRequest($key, $request, $default = null, $type = 'none')
{
$cur_state = $this->getUserState($key, $default);
$new_state = $this->input->get($request, null, $type);
// Save the new value only if it was set in this request.
if ($new_state !== null)
{
$this->setUserState($key... | php | public function getUserStateFromRequest($key, $request, $default = null, $type = 'none')
{
$cur_state = $this->getUserState($key, $default);
$new_state = $this->input->get($request, null, $type);
// Save the new value only if it was set in this request.
if ($new_state !== null)
{
$this->setUserState($key... | [
"public",
"function",
"getUserStateFromRequest",
"(",
"$",
"key",
",",
"$",
"request",
",",
"$",
"default",
"=",
"null",
",",
"$",
"type",
"=",
"'none'",
")",
"{",
"$",
"cur_state",
"=",
"$",
"this",
"->",
"getUserState",
"(",
"$",
"key",
",",
"$",
"... | Gets the value of a user state variable.
@param string $key The key of the user state variable.
@param string $request The name of the variable passed in a request.
@param string $default The default value for the variable if not found. Optional.
@param string $type Filter for the variable, for ... | [
"Gets",
"the",
"value",
"of",
"a",
"user",
"state",
"variable",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L583-L599 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.login | public function login($credentials, $options = array())
{
// Get the global JAuthentication object.
jimport('joomla.user.authentication');
JPluginHelper::importPlugin('user');
$authenticate = JAuthentication::getInstance();
$response = $authenticate->authenticate($credentials, $options);
if ($response->... | php | public function login($credentials, $options = array())
{
// Get the global JAuthentication object.
jimport('joomla.user.authentication');
JPluginHelper::importPlugin('user');
$authenticate = JAuthentication::getInstance();
$response = $authenticate->authenticate($credentials, $options);
if ($response->... | [
"public",
"function",
"login",
"(",
"$",
"credentials",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"// Get the global JAuthentication object.",
"jimport",
"(",
"'joomla.user.authentication'",
")",
";",
"JPluginHelper",
"::",
"importPlugin",
"(",
"'user'"... | Login authentication function.
Username and encoded password are passed the onUserLogin event which
is responsible for the user validation. A successful validation updates
the current session record with the user's details.
Username and encoded password are sent as credentials (along with other
possibilities) to each... | [
"Login",
"authentication",
"function",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L621-L725 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.logout | public function logout($userid = null, $options = array())
{
// Get a user object from the JApplication.
$user = JFactory::getUser($userid);
// Build the credentials array.
$parameters['username'] = $user->get('username');
$parameters['id'] = $user->get('id');
// Set clientid in the options array if it h... | php | public function logout($userid = null, $options = array())
{
// Get a user object from the JApplication.
$user = JFactory::getUser($userid);
// Build the credentials array.
$parameters['username'] = $user->get('username');
$parameters['id'] = $user->get('id');
// Set clientid in the options array if it h... | [
"public",
"function",
"logout",
"(",
"$",
"userid",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"// Get a user object from the JApplication.",
"$",
"user",
"=",
"JFactory",
"::",
"getUser",
"(",
"$",
"userid",
")",
";",
"// Build the ... | Logout authentication function.
Passed the current user information to the onUserLogout event and reverts the current
session record back to 'anonymous' parameters.
If any of the authentication plugins did not successfully complete
the logout routine then the whole method fails. Any errors raised
should be done in the... | [
"Logout",
"authentication",
"function",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L745-L778 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.getTemplate | public function getTemplate($params = false)
{
$template = new stdClass;
$template->template = 'system';
$template->params = new Registry;
if ($params)
{
return $template;
}
return $template->template;
} | php | public function getTemplate($params = false)
{
$template = new stdClass;
$template->template = 'system';
$template->params = new Registry;
if ($params)
{
return $template;
}
return $template->template;
} | [
"public",
"function",
"getTemplate",
"(",
"$",
"params",
"=",
"false",
")",
"{",
"$",
"template",
"=",
"new",
"stdClass",
";",
"$",
"template",
"->",
"template",
"=",
"'system'",
";",
"$",
"template",
"->",
"params",
"=",
"new",
"Registry",
";",
"if",
... | Gets the name of the current template.
@param boolean $params An optional associative array of configuration settings
@return mixed System is the fallback.
@since 11.1
@deprecated 4.0 | [
"Gets",
"the",
"name",
"of",
"the",
"current",
"template",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L790-L803 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.getPathway | public function getPathway($name = null, $options = array())
{
if (!isset($name))
{
$name = $this->_name;
}
try
{
$pathway = JPathway::getInstance($name, $options);
}
catch (Exception $e)
{
return;
}
return $pathway;
} | php | public function getPathway($name = null, $options = array())
{
if (!isset($name))
{
$name = $this->_name;
}
try
{
$pathway = JPathway::getInstance($name, $options);
}
catch (Exception $e)
{
return;
}
return $pathway;
} | [
"public",
"function",
"getPathway",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"_name",
";",
"}",
"try",
... | Returns the application JPathway object.
@param string $name The name of the application.
@param array $options An optional associative array of configuration settings.
@return JPathway|null A JPathway object
@since 11.1
@deprecated 4.0 | [
"Returns",
"the",
"application",
"JPathway",
"object",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L864-L881 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.getMenu | public function getMenu($name = null, $options = array())
{
if (!isset($name))
{
$name = $this->_name;
}
try
{
$menu = JMenu::getInstance($name, $options);
}
catch (Exception $e)
{
return;
}
return $menu;
} | php | public function getMenu($name = null, $options = array())
{
if (!isset($name))
{
$name = $this->_name;
}
try
{
$menu = JMenu::getInstance($name, $options);
}
catch (Exception $e)
{
return;
}
return $menu;
} | [
"public",
"function",
"getMenu",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"name",
")",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"_name",
";",
"}",
"try",
"{... | Returns the application JPathway object.
@param string $name The name of the application/client.
@param array $options An optional associative array of configuration settings.
@return JMenu|null JMenu object.
@since 11.1
@deprecated 4.0 | [
"Returns",
"the",
"application",
"JPathway",
"object",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L894-L911 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication._createConfiguration | protected function _createConfiguration($file)
{
JLoader::register('JConfig', $file);
// Create the JConfig object.
$config = new JConfig;
// Get the global configuration object.
$registry = JFactory::getConfig();
// Load the configuration values into the registry.
$registry->loadObject($config);
r... | php | protected function _createConfiguration($file)
{
JLoader::register('JConfig', $file);
// Create the JConfig object.
$config = new JConfig;
// Get the global configuration object.
$registry = JFactory::getConfig();
// Load the configuration values into the registry.
$registry->loadObject($config);
r... | [
"protected",
"function",
"_createConfiguration",
"(",
"$",
"file",
")",
"{",
"JLoader",
"::",
"register",
"(",
"'JConfig'",
",",
"$",
"file",
")",
";",
"// Create the JConfig object.",
"$",
"config",
"=",
"new",
"JConfig",
";",
"// Get the global configuration objec... | Create the configuration registry.
@param string $file The path to the configuration file
@return JConfig A JConfig object
@since 11.1
@deprecated 4.0 | [
"Create",
"the",
"configuration",
"registry",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L938-L952 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication._createSession | protected function _createSession($name, $auto_start = true)
{
$options = array();
$options['name'] = $name;
switch ($this->_clientId)
{
case 0:
if ($this->getCfg('force_ssl') == 2)
{
$options['force_ssl'] = true;
}
break;
case 1:
if ($this->getCfg('force_ssl') >= 1)
{
... | php | protected function _createSession($name, $auto_start = true)
{
$options = array();
$options['name'] = $name;
switch ($this->_clientId)
{
case 0:
if ($this->getCfg('force_ssl') == 2)
{
$options['force_ssl'] = true;
}
break;
case 1:
if ($this->getCfg('force_ssl') >= 1)
{
... | [
"protected",
"function",
"_createSession",
"(",
"$",
"name",
",",
"$",
"auto_start",
"=",
"true",
")",
"{",
"$",
"options",
"=",
"array",
"(",
")",
";",
"$",
"options",
"[",
"'name'",
"]",
"=",
"$",
"name",
";",
"switch",
"(",
"$",
"this",
"->",
"_... | Create the user session.
Old sessions are flushed based on the configuration value for the cookie
lifetime. If an existing session, then the last access time is updated.
If a new session, a session id is generated and a record is created in
the #__users_sessions table.
@param string $name The sessions name.
@ret... | [
"Create",
"the",
"user",
"session",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L969-L1040 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.checkSession | public function checkSession()
{
$db = JFactory::getDbo();
$session = JFactory::getSession();
$user = JFactory::getUser();
$query = $db->getQuery(true)
->select($db->quoteName('session_id'))
->from($db->quoteName('#__users_sessions'))
->where($db->quoteName('session_id') . ' = ' . $db->quote($session... | php | public function checkSession()
{
$db = JFactory::getDbo();
$session = JFactory::getSession();
$user = JFactory::getUser();
$query = $db->getQuery(true)
->select($db->quoteName('session_id'))
->from($db->quoteName('#__users_sessions'))
->where($db->quoteName('session_id') . ' = ' . $db->quote($session... | [
"public",
"function",
"checkSession",
"(",
")",
"{",
"$",
"db",
"=",
"JFactory",
"::",
"getDbo",
"(",
")",
";",
"$",
"session",
"=",
"JFactory",
"::",
"getSession",
"(",
")",
";",
"$",
"user",
"=",
"JFactory",
"::",
"getUser",
"(",
")",
";",
"$",
"... | Checks the user session.
If the session record doesn't exist, initialise it.
If session is new, create session variables
@return void
@since 11.1
@deprecated 4.0 | [
"Checks",
"the",
"user",
"session",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L1053-L1104 |
joomlatools/joomlatools-platform-legacy | code/application/application.php | JApplication.afterSessionStart | public function afterSessionStart()
{
$session = JFactory::getSession();
if ($session->isNew())
{
$session->set('registry', new Registry('session'));
$session->set('user', new JUser);
}
} | php | public function afterSessionStart()
{
$session = JFactory::getSession();
if ($session->isNew())
{
$session->set('registry', new Registry('session'));
$session->set('user', new JUser);
}
} | [
"public",
"function",
"afterSessionStart",
"(",
")",
"{",
"$",
"session",
"=",
"JFactory",
"::",
"getSession",
"(",
")",
";",
"if",
"(",
"$",
"session",
"->",
"isNew",
"(",
")",
")",
"{",
"$",
"session",
"->",
"set",
"(",
"'registry'",
",",
"new",
"R... | After the session has been started we need to populate it with some default values.
@return void
@since 12.2
@deprecated 4.0 | [
"After",
"the",
"session",
"has",
"been",
"started",
"we",
"need",
"to",
"populate",
"it",
"with",
"some",
"default",
"values",
"."
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/application/application.php#L1114-L1123 |
mremi/Flowdock | src/Mremi/Flowdock/Command/SendTeamInboxMessageCommand.php | SendTeamInboxMessageCommand.configure | protected function configure()
{
$this
->setName('send-team-inbox-message')
->setDescription('Sends a mail-like message to the team inbox of a flow')
->addArgument('flow-api-token', InputArgument::REQUIRED, 'The flow API token')
->addArgument('source', ... | php | protected function configure()
{
$this
->setName('send-team-inbox-message')
->setDescription('Sends a mail-like message to the team inbox of a flow')
->addArgument('flow-api-token', InputArgument::REQUIRED, 'The flow API token')
->addArgument('source', ... | [
"protected",
"function",
"configure",
"(",
")",
"{",
"$",
"this",
"->",
"setName",
"(",
"'send-team-inbox-message'",
")",
"->",
"setDescription",
"(",
"'Sends a mail-like message to the team inbox of a flow'",
")",
"->",
"addArgument",
"(",
"'flow-api-token'",
",",
"Inp... | {@inheritdoc} | [
"{"
] | train | https://github.com/mremi/Flowdock/blob/287bfdcef17529055f803f2316e3ad31826e79eb/src/Mremi/Flowdock/Command/SendTeamInboxMessageCommand.php#L33-L52 |
mremi/Flowdock | src/Mremi/Flowdock/Command/SendTeamInboxMessageCommand.php | SendTeamInboxMessageCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$push = new Push($input->getArgument('flow-api-token'));
$message = TeamInboxMessage::create()
->setSource($input->getArgument('source'))
->setFromAddress($input->getArgument('from-address'))
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$push = new Push($input->getArgument('flow-api-token'));
$message = TeamInboxMessage::create()
->setSource($input->getArgument('source'))
->setFromAddress($input->getArgument('from-address'))
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"push",
"=",
"new",
"Push",
"(",
"$",
"input",
"->",
"getArgument",
"(",
"'flow-api-token'",
")",
")",
";",
"$",
"message",
"=",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/mremi/Flowdock/blob/287bfdcef17529055f803f2316e3ad31826e79eb/src/Mremi/Flowdock/Command/SendTeamInboxMessageCommand.php#L57-L83 |
qcubed/orm | src/Codegen/SqlTable.php | SqlTable.getColumnByName | public function getColumnByName($strColumnName) {
if ($this->objColumnArray) {
foreach ($this->objColumnArray as $objColumn){
if ($objColumn->Name == $strColumnName)
return $objColumn;
}
}
return null;
} | php | public function getColumnByName($strColumnName) {
if ($this->objColumnArray) {
foreach ($this->objColumnArray as $objColumn){
if ($objColumn->Name == $strColumnName)
return $objColumn;
}
}
return null;
} | [
"public",
"function",
"getColumnByName",
"(",
"$",
"strColumnName",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"objColumnArray",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"objColumnArray",
"as",
"$",
"objColumn",
")",
"{",
"if",
"(",
"$",
"objColumn",
"-... | return the SqlColumn object related to that column name
@param string $strColumnName Name of the column
@return SqlColumn | [
"return",
"the",
"SqlColumn",
"object",
"related",
"to",
"that",
"column",
"name"
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Codegen/SqlTable.php#L115-L123 |
qcubed/orm | src/Codegen/SqlTable.php | SqlTable.lookupColumnPropertyName | public function lookupColumnPropertyName($strColumnName){
$objColumn = $this->getColumnByName($strColumnName);
if ($objColumn)
return $objColumn->PropertyName;
else
return null;
} | php | public function lookupColumnPropertyName($strColumnName){
$objColumn = $this->getColumnByName($strColumnName);
if ($objColumn)
return $objColumn->PropertyName;
else
return null;
} | [
"public",
"function",
"lookupColumnPropertyName",
"(",
"$",
"strColumnName",
")",
"{",
"$",
"objColumn",
"=",
"$",
"this",
"->",
"getColumnByName",
"(",
"$",
"strColumnName",
")",
";",
"if",
"(",
"$",
"objColumn",
")",
"return",
"$",
"objColumn",
"->",
"Prop... | Return the property name for a given column name (false if it doesn't exists)
@param string $strColumnName name of the column
@return string | [
"Return",
"the",
"property",
"name",
"for",
"a",
"given",
"column",
"name",
"(",
"false",
"if",
"it",
"doesn",
"t",
"exists",
")"
] | train | https://github.com/qcubed/orm/blob/f320eba671f20874b1f3809c5293f8c02d5b1204/src/Codegen/SqlTable.php#L139-L145 |
4devs/ElfinderPhpConnector | Response.php | Response.toArray | public function toArray()
{
$data = array(
'added' => $this->getAdded(true),
'api' => $this->getApi(),
'cwd' => $this->getCwd(true),
'debug' => $this->getDebug(),
'files' => $this->getFiles(true),
'list' => $this->getList(),
... | php | public function toArray()
{
$data = array(
'added' => $this->getAdded(true),
'api' => $this->getApi(),
'cwd' => $this->getCwd(true),
'debug' => $this->getDebug(),
'files' => $this->getFiles(true),
'list' => $this->getList(),
... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
"'added'",
"=>",
"$",
"this",
"->",
"getAdded",
"(",
"true",
")",
",",
"'api'",
"=>",
"$",
"this",
"->",
"getApi",
"(",
")",
",",
"'cwd'",
"=>",
"$",
"this",
"->",
"g... | get response as array.
@return array | [
"get",
"response",
"as",
"array",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Response.php#L80-L106 |
4devs/ElfinderPhpConnector | Response.php | Response.getAdded | public function getAdded($asArray = true)
{
$return = array();
if ($asArray && $this->added) {
foreach ($this->added as $file) {
$return[] = $file->toArray();
}
}
return $asArray ? $return : $this->added;
} | php | public function getAdded($asArray = true)
{
$return = array();
if ($asArray && $this->added) {
foreach ($this->added as $file) {
$return[] = $file->toArray();
}
}
return $asArray ? $return : $this->added;
} | [
"public",
"function",
"getAdded",
"(",
"$",
"asArray",
"=",
"true",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"asArray",
"&&",
"$",
"this",
"->",
"added",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"added",
"as",
"$"... | get Added.
@param bool $asArray
@return array|FileInfo[] | [
"get",
"Added",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Response.php#L223-L233 |
4devs/ElfinderPhpConnector | Response.php | Response.getCwd | public function getCwd($asArray = false)
{
return $this->cwd && $asArray ? $this->cwd->toArray() : $this->cwd;
} | php | public function getCwd($asArray = false)
{
return $this->cwd && $asArray ? $this->cwd->toArray() : $this->cwd;
} | [
"public",
"function",
"getCwd",
"(",
"$",
"asArray",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"cwd",
"&&",
"$",
"asArray",
"?",
"$",
"this",
"->",
"cwd",
"->",
"toArray",
"(",
")",
":",
"$",
"this",
"->",
"cwd",
";",
"}"
] | get Current Working Directory.
@param bool $asArray
@return array|FileInfo | [
"get",
"Current",
"Working",
"Directory",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Response.php#L272-L275 |
4devs/ElfinderPhpConnector | Response.php | Response.getFiles | public function getFiles($asArray = false)
{
$return = array();
if ($asArray && $this->files) {
foreach ($this->files as $file) {
$return[] = $file->toArray();
}
}
return $asArray ? $return : $this->files;
} | php | public function getFiles($asArray = false)
{
$return = array();
if ($asArray && $this->files) {
foreach ($this->files as $file) {
$return[] = $file->toArray();
}
}
return $asArray ? $return : $this->files;
} | [
"public",
"function",
"getFiles",
"(",
"$",
"asArray",
"=",
"false",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"asArray",
"&&",
"$",
"this",
"->",
"files",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"files",
"as",
"$... | get Files.
@param bool $asArray
@return array|FileInfo[] | [
"get",
"Files",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Response.php#L355-L365 |
4devs/ElfinderPhpConnector | Response.php | Response.getTree | public function getTree($asArray = false)
{
$return = array();
if ($asArray && $this->tree) {
foreach ($this->tree as $file) {
$return[] = $file->toArray();
}
}
return $asArray ? $return : $this->tree;
} | php | public function getTree($asArray = false)
{
$return = array();
if ($asArray && $this->tree) {
foreach ($this->tree as $file) {
$return[] = $file->toArray();
}
}
return $asArray ? $return : $this->tree;
} | [
"public",
"function",
"getTree",
"(",
"$",
"asArray",
"=",
"false",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"asArray",
"&&",
"$",
"this",
"->",
"tree",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"tree",
"as",
"$",
... | get Tree.
@param bool $asArray
@return array|FileInfo[] | [
"get",
"Tree",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Response.php#L503-L513 |
webforge-labs/psc-cms | lib/Psc/JS/JS.php | JS.register | public static function register($jsFile, $alias = NULL, Array $dependencies = array()) {
return self::getManager()->register($jsFile, $alias, $dependencies);
} | php | public static function register($jsFile, $alias = NULL, Array $dependencies = array()) {
return self::getManager()->register($jsFile, $alias, $dependencies);
} | [
"public",
"static",
"function",
"register",
"(",
"$",
"jsFile",
",",
"$",
"alias",
"=",
"NULL",
",",
"Array",
"$",
"dependencies",
"=",
"array",
"(",
")",
")",
"{",
"return",
"self",
"::",
"getManager",
"(",
")",
"->",
"register",
"(",
"$",
"jsFile",
... | Macht dem Standard JS Manager eine JS Datei bekannt | [
"Macht",
"dem",
"Standard",
"JS",
"Manager",
"eine",
"JS",
"Datei",
"bekannt"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/JS/JS.php#L20-L22 |
picamator/CacheManager | src/Cache/CacheItemFactory.php | CacheItemFactory.create | public function create(string $key, array $value) : CacheItemInterface
{
/** @var \Cache\Adapter\Common\CacheItem $cacheItem */
$cacheItem = $this->objectManager->create($this->className, [$key])
->set($value);
return $cacheItem;
} | php | public function create(string $key, array $value) : CacheItemInterface
{
/** @var \Cache\Adapter\Common\CacheItem $cacheItem */
$cacheItem = $this->objectManager->create($this->className, [$key])
->set($value);
return $cacheItem;
} | [
"public",
"function",
"create",
"(",
"string",
"$",
"key",
",",
"array",
"$",
"value",
")",
":",
"CacheItemInterface",
"{",
"/** @var \\Cache\\Adapter\\Common\\CacheItem $cacheItem */",
"$",
"cacheItem",
"=",
"$",
"this",
"->",
"objectManager",
"->",
"create",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/picamator/CacheManager/blob/5e5493910610b65ae31a362786d7963ba3e33806/src/Cache/CacheItemFactory.php#L41-L48 |
maniaplanet/maniaplanet-ws-sdk | libraries/Maniaplanet/WebServices/ManiaConnect/Player.php | Player.getPlayer | function getPlayer()
{
$player = self::$persistance->getVariable('player');
if(!$player)
{
if($this->getAccessToken())
{
$player = $this->executeOAuth2('GET', '/player/');
self::$persistance->setVariable('player', $player);
}
}
return $player;
} | php | function getPlayer()
{
$player = self::$persistance->getVariable('player');
if(!$player)
{
if($this->getAccessToken())
{
$player = $this->executeOAuth2('GET', '/player/');
self::$persistance->setVariable('player', $player);
}
}
return $player;
} | [
"function",
"getPlayer",
"(",
")",
"{",
"$",
"player",
"=",
"self",
"::",
"$",
"persistance",
"->",
"getVariable",
"(",
"'player'",
")",
";",
"if",
"(",
"!",
"$",
"player",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getAccessToken",
"(",
")",
")",
"{... | This is the first method to call when you have an authorization code.
It will retrieve an access token if possible and then call the service to
retrieve a basic object about the authentified player.
You do not need any special scope to call this service, as long as you
have an access token.
If an access token is not ... | [
"This",
"is",
"the",
"first",
"method",
"to",
"call",
"when",
"you",
"have",
"an",
"authorization",
"code",
".",
"It",
"will",
"retrieve",
"an",
"access",
"token",
"if",
"possible",
"and",
"then",
"call",
"the",
"service",
"to",
"retrieve",
"a",
"basic",
... | train | https://github.com/maniaplanet/maniaplanet-ws-sdk/blob/027a458388035fe66f2f56ff3ea1f85eff2a5a4e/libraries/Maniaplanet/WebServices/ManiaConnect/Player.php#L33-L45 |
webforge-labs/psc-cms | lib/PHPWord/PHPWord/Shared/File.php | PHPWord_Shared_File.realpath | public static function realpath($pFilename) {
// Returnvalue
$returnValue = '';
// Try using realpath()
$returnValue = realpath($pFilename);
// Found something?
if ($returnValue == '' || is_null($returnValue)) {
$pathArray = split('/' , $pFilename);
while(in_array('..', $pathArray) && $pathArray[0] ... | php | public static function realpath($pFilename) {
// Returnvalue
$returnValue = '';
// Try using realpath()
$returnValue = realpath($pFilename);
// Found something?
if ($returnValue == '' || is_null($returnValue)) {
$pathArray = split('/' , $pFilename);
while(in_array('..', $pathArray) && $pathArray[0] ... | [
"public",
"static",
"function",
"realpath",
"(",
"$",
"pFilename",
")",
"{",
"// Returnvalue",
"$",
"returnValue",
"=",
"''",
";",
"// Try using realpath()",
"$",
"returnValue",
"=",
"realpath",
"(",
"$",
"pFilename",
")",
";",
"// Found something?",
"if",
"(",
... | Returns canonicalized absolute pathname, also for ZIP archives
@param string $pFilename
@return string | [
"Returns",
"canonicalized",
"absolute",
"pathname",
"also",
"for",
"ZIP",
"archives"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Shared/File.php#L66-L90 |
2amigos/yiifoundation | widgets/Alert.php | Alert.init | public function init()
{
if (is_string($this->config)) {
throw new InvalidConfigException('"config" must be of type array.');
}
$this->assets = array(
'js' => YII_DEBUG ? 'foundation/foundation.alerts.js' : 'foundation.min.js'
);
if (!isset($this->con... | php | public function init()
{
if (is_string($this->config)) {
throw new InvalidConfigException('"config" must be of type array.');
}
$this->assets = array(
'js' => YII_DEBUG ? 'foundation/foundation.alerts.js' : 'foundation.min.js'
);
if (!isset($this->con... | [
"public",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"config",
")",
")",
"{",
"throw",
"new",
"InvalidConfigException",
"(",
"'\"config\" must be of type array.'",
")",
";",
"}",
"$",
"this",
"->",
"assets",
"=",
"ar... | Initializes the widget
@throws \foundation\exception\InvalidConfigException | [
"Initializes",
"the",
"widget"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Alert.php#L44-L63 |
2amigos/yiifoundation | widgets/Alert.php | Alert.renderAlert | public function renderAlert()
{
$user = \Yii::app()->user;
if (count($user->getFlashes(false)) == 0) {
return;
}
$alerts = array();
foreach ($this->config as $style => $config) {
if ($user->hasFlash($style)) {
$options = ArrayHelper::ge... | php | public function renderAlert()
{
$user = \Yii::app()->user;
if (count($user->getFlashes(false)) == 0) {
return;
}
$alerts = array();
foreach ($this->config as $style => $config) {
if ($user->hasFlash($style)) {
$options = ArrayHelper::ge... | [
"public",
"function",
"renderAlert",
"(",
")",
"{",
"$",
"user",
"=",
"\\",
"Yii",
"::",
"app",
"(",
")",
"->",
"user",
";",
"if",
"(",
"count",
"(",
"$",
"user",
"->",
"getFlashes",
"(",
"false",
")",
")",
"==",
"0",
")",
"{",
"return",
";",
"... | Renders the alert
@return string the rendering result | [
"Renders",
"the",
"alert"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/Alert.php#L77-L95 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Validate/Sitemap/Loc.php | Zend_Validate_Sitemap_Loc.isValid | public function isValid($value)
{
$this->_setValue($value);
if (!is_string($value)) {
return false;
}
return Zend_Uri::check($value);
} | php | public function isValid($value)
{
$this->_setValue($value);
if (!is_string($value)) {
return false;
}
return Zend_Uri::check($value);
} | [
"public",
"function",
"isValid",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_setValue",
"(",
"$",
"value",
")",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"Zend_Uri",
"::",
"chec... | Validates if a string is valid as a sitemap location
@link http://www.sitemaps.org/protocol.php#locdef <loc>
@param string $value value to validate
@return boolean | [
"Validates",
"if",
"a",
"string",
"is",
"valid",
"as",
"a",
"sitemap",
"location"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Validate/Sitemap/Loc.php#L68-L77 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.setWsConfig | public function setWsConfig($wsConfig = array())
{
$this->wsConfig = $wsConfig;
$this->logger->debug(__FUNCTION__, 'Web Service Config => ' . json_encode($this->wsConfig));
return $this;
} | php | public function setWsConfig($wsConfig = array())
{
$this->wsConfig = $wsConfig;
$this->logger->debug(__FUNCTION__, 'Web Service Config => ' . json_encode($this->wsConfig));
return $this;
} | [
"public",
"function",
"setWsConfig",
"(",
"$",
"wsConfig",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"wsConfig",
"=",
"$",
"wsConfig",
";",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Web Service Config => '",
".",
... | Function setWsConfig
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/22/18 15:30
@param array $wsConfig
@return $this | [
"Function",
"setWsConfig"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L168-L174 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.setInputData | public function setInputData($inputData = array())
{
$this->inputData = $inputData;
$this->logger->debug(__FUNCTION__, 'Input Data => ' . json_encode($this->inputData));
return $this;
} | php | public function setInputData($inputData = array())
{
$this->inputData = $inputData;
$this->logger->debug(__FUNCTION__, 'Input Data => ' . json_encode($this->inputData));
return $this;
} | [
"public",
"function",
"setInputData",
"(",
"$",
"inputData",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"inputData",
"=",
"$",
"inputData",
";",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Input Data => '",
".",
"jso... | Function setInputData
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/22/18 15:20
@param array $inputData
@return $this | [
"Function",
"setInputData"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L216-L222 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.sendSmsToWebService | public function sendSmsToWebService()
{
$getConfig = $this->getConfigData();
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS To Web Service => ' . json_encode($this->inputData));
$phone_number = $this->inputData['phone_number'];
$msg = $this->inputData['msg'];
... | php | public function sendSmsToWebService()
{
$getConfig = $this->getConfigData();
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS To Web Service => ' . json_encode($this->inputData));
$phone_number = $this->inputData['phone_number'];
$msg = $this->inputData['msg'];
... | [
"public",
"function",
"sendSmsToWebService",
"(",
")",
"{",
"$",
"getConfig",
"=",
"$",
"this",
"->",
"getConfigData",
"(",
")",
";",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Input Data Send SMS To Web Service => '",
".",
"json_enc... | Function sendSmsToWebService
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/22/18 15:28
@return $this | [
"Function",
"sendSmsToWebService"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L260-L361 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.sendSmsToSmppVersion2 | public function sendSmsToSmppVersion2()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS to SMPP Version 2 => ' . json_encode($this->inputData));
$phone_number = $this->inputData['phone_number'];
$msg = $this->inputData['msg'];
$callbackParams = isset($this->inp... | php | public function sendSmsToSmppVersion2()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS to SMPP Version 2 => ' . json_encode($this->inputData));
$phone_number = $this->inputData['phone_number'];
$msg = $this->inputData['msg'];
$callbackParams = isset($this->inp... | [
"public",
"function",
"sendSmsToSmppVersion2",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Input Data Send SMS to SMPP Version 2 => '",
".",
"json_encode",
"(",
"$",
"this",
"->",
"inputData",
")",
")",
";",
"$",
"phone... | Function sendSmsToSmppVersion2
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/22/18 15:48
@return $this | [
"Function",
"sendSmsToSmppVersion2"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L371-L464 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.sendSmsToSmppVersion1 | public function sendSmsToSmppVersion1()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS to SMPP Version 1 => ' . json_encode($this->inputData));
$phone_number = $this->inputData['phone_number'];
$msg = $this->inputData['msg'];
$phone_number = $this->phoneNumber->v... | php | public function sendSmsToSmppVersion1()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS to SMPP Version 1 => ' . json_encode($this->inputData));
$phone_number = $this->inputData['phone_number'];
$msg = $this->inputData['msg'];
$phone_number = $this->phoneNumber->v... | [
"public",
"function",
"sendSmsToSmppVersion1",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Input Data Send SMS to SMPP Version 1 => '",
".",
"json_encode",
"(",
"$",
"this",
"->",
"inputData",
")",
")",
";",
"$",
"phone... | Function sendSmsToSmppVersion1
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/22/18 15:49
@return $this | [
"Function",
"sendSmsToSmppVersion1"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L474-L559 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.sendSmsToGatewayWithoutMo | public function sendSmsToGatewayWithoutMo()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS To SMS Gateway without MO => ' . json_encode($this->inputData));
$getConfig = $this->getConfigData();
$phone_number = $this->inputData['phone_number'];
$msg = $this->inp... | php | public function sendSmsToGatewayWithoutMo()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS To SMS Gateway without MO => ' . json_encode($this->inputData));
$getConfig = $this->getConfigData();
$phone_number = $this->inputData['phone_number'];
$msg = $this->inp... | [
"public",
"function",
"sendSmsToGatewayWithoutMo",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Input Data Send SMS To SMS Gateway without MO => '",
".",
"json_encode",
"(",
"$",
"this",
"->",
"inputData",
")",
")",
";",
... | Function sendSmsToGatewayWithoutMo
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/22/18 15:54
@return $this | [
"Function",
"sendSmsToGatewayWithoutMo"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L569-L646 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.sendSmsToGatewayWithMo | public function sendSmsToGatewayWithMo()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS To SMS Gateway with MO => ' . json_encode($this->inputData));
$getConfig = $this->getConfigData();
$moId = $this->inputData['moId'];
$phone_number = $this->inputData['phone_... | php | public function sendSmsToGatewayWithMo()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS To SMS Gateway with MO => ' . json_encode($this->inputData));
$getConfig = $this->getConfigData();
$moId = $this->inputData['moId'];
$phone_number = $this->inputData['phone_... | [
"public",
"function",
"sendSmsToGatewayWithMo",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Input Data Send SMS To SMS Gateway with MO => '",
".",
"json_encode",
"(",
"$",
"this",
"->",
"inputData",
")",
")",
";",
"$",
... | Function sendSmsToGatewayWithMo
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/22/18 16:01
@return $this | [
"Function",
"sendSmsToGatewayWithMo"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L656-L735 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.sendSmsToVasCloudGatewayVina | public function sendSmsToVasCloudGatewayVina()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS To VinaPhone VasCloud Gateway => ' . json_encode($this->inputData));
$getConfig = $this->getConfigData();
$phone_number = $this->inputData['phone_number'];
$mo = $th... | php | public function sendSmsToVasCloudGatewayVina()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS To VinaPhone VasCloud Gateway => ' . json_encode($this->inputData));
$getConfig = $this->getConfigData();
$phone_number = $this->inputData['phone_number'];
$mo = $th... | [
"public",
"function",
"sendSmsToVasCloudGatewayVina",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Input Data Send SMS To VinaPhone VasCloud Gateway => '",
".",
"json_encode",
"(",
"$",
"this",
"->",
"inputData",
")",
")",
... | Function sendSmsToVasCloudGatewayVina
@author: 713uk13m <dev@nguyenanhung.com>
@time : 2018-12-06 23:17
@return $this | [
"Function",
"sendSmsToVasCloudGatewayVina"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L745-L838 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.sendSmsToViettelWithMPSGateway | public function sendSmsToViettelWithMPSGateway()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS to Viettel MPS Gateway => ' . json_encode($this->inputData));
$getConfig = $this->getConfigData();
$phone_number = $this->inputData['phone_number'];
$msg = $this->in... | php | public function sendSmsToViettelWithMPSGateway()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS to Viettel MPS Gateway => ' . json_encode($this->inputData));
$getConfig = $this->getConfigData();
$phone_number = $this->inputData['phone_number'];
$msg = $this->in... | [
"public",
"function",
"sendSmsToViettelWithMPSGateway",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Input Data Send SMS to Viettel MPS Gateway => '",
".",
"json_encode",
"(",
"$",
"this",
"->",
"inputData",
")",
")",
";",
... | Function sendSmsToViettelWithMPSGateway
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/22/18 16:19
@return $this | [
"Function",
"sendSmsToViettelWithMPSGateway"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L848-L930 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.sendSmsToViettelWithWebService | public function sendSmsToViettelWithWebService()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS to Viettel Web Service => ' . json_encode($this->inputData));
$phone_number = $this->inputData['phone_number'];
$msg = $this->inputData['msg'];
$alias = $this->i... | php | public function sendSmsToViettelWithWebService()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS to Viettel Web Service => ' . json_encode($this->inputData));
$phone_number = $this->inputData['phone_number'];
$msg = $this->inputData['msg'];
$alias = $this->i... | [
"public",
"function",
"sendSmsToViettelWithWebService",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Input Data Send SMS to Viettel Web Service => '",
".",
"json_encode",
"(",
"$",
"this",
"->",
"inputData",
")",
")",
";",
... | Function sendSmsToViettelWithWebService
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/22/18 16:20
@return $this | [
"Function",
"sendSmsToViettelWithWebService"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L940-L1035 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.sendSmsToMobiFoneWithCSPSendMessage | public function sendSmsToMobiFoneWithCSPSendMessage()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS to MobiFone CSP=> ' . json_encode($this->inputData));
$phone_number = $this->inputData['phone_number'];
$msg = $this->inputData['msg'];
$mo = $this->inpu... | php | public function sendSmsToMobiFoneWithCSPSendMessage()
{
$this->logger->debug(__FUNCTION__, 'Input Data Send SMS to MobiFone CSP=> ' . json_encode($this->inputData));
$phone_number = $this->inputData['phone_number'];
$msg = $this->inputData['msg'];
$mo = $this->inpu... | [
"public",
"function",
"sendSmsToMobiFoneWithCSPSendMessage",
"(",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"__FUNCTION__",
",",
"'Input Data Send SMS to MobiFone CSP=> '",
".",
"json_encode",
"(",
"$",
"this",
"->",
"inputData",
")",
")",
";",
"$... | Function sendSmsToMobiFoneWithCSPSendMessage
@author: 713uk13m <dev@nguyenanhung.com>
@time : 2018-12-27 09:43
@return $this | [
"Function",
"sendSmsToMobiFoneWithCSPSendMessage"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L1045-L1137 |
nguyenanhung/td-send-sms | src/SendSMS/SendSms.php | SendSms.sendSmsToVnmSDPWithSOAP | public function sendSmsToVnmSDPWithSOAP()
{
$result = array();
if ($this->responseIsObject) {
$result = Utils::arrayToObject($result);
}
$this->sendSmsResult = $result;
$this->logger->info(__FUNCTION__, 'Send SMS Result: ' . json_encode($this->sendSmsResult));
... | php | public function sendSmsToVnmSDPWithSOAP()
{
$result = array();
if ($this->responseIsObject) {
$result = Utils::arrayToObject($result);
}
$this->sendSmsResult = $result;
$this->logger->info(__FUNCTION__, 'Send SMS Result: ' . json_encode($this->sendSmsResult));
... | [
"public",
"function",
"sendSmsToVnmSDPWithSOAP",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"responseIsObject",
")",
"{",
"$",
"result",
"=",
"Utils",
"::",
"arrayToObject",
"(",
"$",
"result",
")",
";",
"}... | Function sendSmsToVnmSDPWithSOAP
@author: 713uk13m <dev@nguyenanhung.com>
@time : 11/22/18 16:22
@return $this | [
"Function",
"sendSmsToVnmSDPWithSOAP"
] | train | https://github.com/nguyenanhung/td-send-sms/blob/ed7b413aa09918e0dab3354cbc1d0c4565d39463/src/SendSMS/SendSms.php#L1187-L1197 |
arsengoian/viper-framework | src/Viper/Support/Libs/Util.php | Util.match | public static function match(string $switch, array $fields, callable $default = NULL): bool {
foreach ($fields as $key => $call) {
if (self::contains($switch, $key)){
return $call();
}
}
if ($default)
$default();
return FALSE;
} | php | public static function match(string $switch, array $fields, callable $default = NULL): bool {
foreach ($fields as $key => $call) {
if (self::contains($switch, $key)){
return $call();
}
}
if ($default)
$default();
return FALSE;
} | [
"public",
"static",
"function",
"match",
"(",
"string",
"$",
"switch",
",",
"array",
"$",
"fields",
",",
"callable",
"$",
"default",
"=",
"NULL",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"key",
"=>",
"$",
"call",
")",
"{",
"... | String functions | [
"String",
"functions"
] | train | https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Support/Libs/Util.php#L17-L26 |
arsengoian/viper-framework | src/Viper/Support/Libs/Util.php | Util.recursiveMkdir | public static function recursiveMkdir(string $dir, int $loops = 0) {
if ($loops > 20)
throw new UtilException('No more than 20 directories in a row');
if(!file_exists($newdir = dirname($dir)))
self::recursiveMkdir($newdir);
@mkdir($dir);
@chmod($dir, 0777);
} | php | public static function recursiveMkdir(string $dir, int $loops = 0) {
if ($loops > 20)
throw new UtilException('No more than 20 directories in a row');
if(!file_exists($newdir = dirname($dir)))
self::recursiveMkdir($newdir);
@mkdir($dir);
@chmod($dir, 0777);
} | [
"public",
"static",
"function",
"recursiveMkdir",
"(",
"string",
"$",
"dir",
",",
"int",
"$",
"loops",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"loops",
">",
"20",
")",
"throw",
"new",
"UtilException",
"(",
"'No more than 20 directories in a row'",
")",
";",
"i... | Warning! Ignoring warnings | [
"Warning!",
"Ignoring",
"warnings"
] | train | https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Support/Libs/Util.php#L84-L91 |
PortaText/php-sdk | src/PortaText/Command/Api/Destinations.php | Destinations.getEndpoint | protected function getEndpoint($method)
{
$endpoint = "destinations";
$queryString = array();
$page = $this->getArgument("page");
$sortBy = $this->getArgument("sortBy");
$order = $this->getArgument("order");
if (!is_null($page)) {
$queryString['page'] = $p... | php | protected function getEndpoint($method)
{
$endpoint = "destinations";
$queryString = array();
$page = $this->getArgument("page");
$sortBy = $this->getArgument("sortBy");
$order = $this->getArgument("order");
if (!is_null($page)) {
$queryString['page'] = $p... | [
"protected",
"function",
"getEndpoint",
"(",
"$",
"method",
")",
"{",
"$",
"endpoint",
"=",
"\"destinations\"",
";",
"$",
"queryString",
"=",
"array",
"(",
")",
";",
"$",
"page",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"\"page\"",
")",
";",
"$",
"s... | Returns a string with the endpoint for the given command.
@param string $method Method for this command.
@return string | [
"Returns",
"a",
"string",
"with",
"the",
"endpoint",
"for",
"the",
"given",
"command",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/Destinations.php#L64-L88 |
PortaText/php-sdk | src/PortaText/Command/Api/EmailVerify.php | EmailVerify.getEndpoint | protected function getEndpoint($method)
{
$endpoint = "me/email_verify";
$nonce = $this->getArgument("nonce");
if (!is_null($nonce)) {
$endpoint .= "/$nonce";
$this->delArgument("nonce");
}
return $endpoint;
} | php | protected function getEndpoint($method)
{
$endpoint = "me/email_verify";
$nonce = $this->getArgument("nonce");
if (!is_null($nonce)) {
$endpoint .= "/$nonce";
$this->delArgument("nonce");
}
return $endpoint;
} | [
"protected",
"function",
"getEndpoint",
"(",
"$",
"method",
")",
"{",
"$",
"endpoint",
"=",
"\"me/email_verify\"",
";",
"$",
"nonce",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"\"nonce\"",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"nonce",
")",
... | Returns a string with the endpoint for the given command.
@param string $method Method for this command.
@return string | [
"Returns",
"a",
"string",
"with",
"the",
"endpoint",
"for",
"the",
"given",
"command",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/EmailVerify.php#L38-L47 |
webforge-labs/psc-cms | lib/Psc/Code/Build/Phar.php | Phar.addFile | public function addFile(File $file, File $fileInPhar) {
if (!$fileInPhar->getDirectory()->isRelative()) {
throw new \Psc\Exception('fileInPhar muss ein relatives Verzeichnis haben');
}
$this->additionalFiles[(string) $fileInPhar] = array($file, $fileInPhar);
return $this;
} | php | public function addFile(File $file, File $fileInPhar) {
if (!$fileInPhar->getDirectory()->isRelative()) {
throw new \Psc\Exception('fileInPhar muss ein relatives Verzeichnis haben');
}
$this->additionalFiles[(string) $fileInPhar] = array($file, $fileInPhar);
return $this;
} | [
"public",
"function",
"addFile",
"(",
"File",
"$",
"file",
",",
"File",
"$",
"fileInPhar",
")",
"{",
"if",
"(",
"!",
"$",
"fileInPhar",
"->",
"getDirectory",
"(",
")",
"->",
"isRelative",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"Psc",
"\\",
"Except... | Fügt eine beliebige Datei zum Phar hinzu
Achtung: wenn dies eine PHP-Datei ist mit einer Klasse drin, wird diese nicht "indiziert", sondern einfach nur dump eingefügt
Dies ist also nur für andere PHARs oder andere Dateien ohne PHP-Klassen darin
@param File $fileInPhar ist eine RELATIVE Datei => d. h. das Verzeichnis i... | [
"Fügt",
"eine",
"beliebige",
"Datei",
"zum",
"Phar",
"hinzu"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Build/Phar.php#L160-L167 |
webforge-labs/psc-cms | lib/Psc/Code/Build/Phar.php | Phar.inferClassName | protected function inferClassName(File $file) {
return Code::mapFileToClass($file, $this->classPath->up(), $this->underscoreStyle ? '_' : '\\');
} | php | protected function inferClassName(File $file) {
return Code::mapFileToClass($file, $this->classPath->up(), $this->underscoreStyle ? '_' : '\\');
} | [
"protected",
"function",
"inferClassName",
"(",
"File",
"$",
"file",
")",
"{",
"return",
"Code",
"::",
"mapFileToClass",
"(",
"$",
"file",
",",
"$",
"this",
"->",
"classPath",
"->",
"up",
"(",
")",
",",
"$",
"this",
"->",
"underscoreStyle",
"?",
"'_'",
... | Gibt zu einer Datei im Phar die Klasse zurück
dies funktioniert im Moment nur mit der Konvention, dass jedes Verzeichnis ein unter-namespace von $this->namespace ist | [
"Gibt",
"zu",
"einer",
"Datei",
"im",
"Phar",
"die",
"Klasse",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Code/Build/Phar.php#L207-L209 |
yuncms/framework | src/base/Snowflake.php | Snowflake.next | public function next():int
{
$timestamp = $this->milliTime();
if ($timestamp < $this->_lastTimestamp) {
throw new Exception(sprintf("Clock moved backwards. Refusing to generate id for %d milliseconds", $this->_lastTimestamp - $timestamp));
}
if ($this->_lastTimestamp == ... | php | public function next():int
{
$timestamp = $this->milliTime();
if ($timestamp < $this->_lastTimestamp) {
throw new Exception(sprintf("Clock moved backwards. Refusing to generate id for %d milliseconds", $this->_lastTimestamp - $timestamp));
}
if ($this->_lastTimestamp == ... | [
"public",
"function",
"next",
"(",
")",
":",
"int",
"{",
"$",
"timestamp",
"=",
"$",
"this",
"->",
"milliTime",
"(",
")",
";",
"if",
"(",
"$",
"timestamp",
"<",
"$",
"this",
"->",
"_lastTimestamp",
")",
"{",
"throw",
"new",
"Exception",
"(",
"sprintf... | 获得下一个ID (该方法是线程安全的)
@return int
@throws Exception | [
"获得下一个ID",
"(",
"该方法是线程安全的",
")"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/base/Snowflake.php#L76-L95 |
yuncms/framework | src/base/Snowflake.php | Snowflake.waitNextMilli | protected function waitNextMilli($lastTimestamp):int
{
$timestamp = $this->milliTime();
while ($timestamp <= $lastTimestamp) {
$timestamp = $this->milliTime();
}
return $timestamp;
} | php | protected function waitNextMilli($lastTimestamp):int
{
$timestamp = $this->milliTime();
while ($timestamp <= $lastTimestamp) {
$timestamp = $this->milliTime();
}
return $timestamp;
} | [
"protected",
"function",
"waitNextMilli",
"(",
"$",
"lastTimestamp",
")",
":",
"int",
"{",
"$",
"timestamp",
"=",
"$",
"this",
"->",
"milliTime",
"(",
")",
";",
"while",
"(",
"$",
"timestamp",
"<=",
"$",
"lastTimestamp",
")",
"{",
"$",
"timestamp",
"=",
... | 阻塞到下一个毫秒,直到获得新的时间戳
@param int $lastTimestamp 上次生成ID的时间截
@return int 当前时间戳 | [
"阻塞到下一个毫秒,直到获得新的时间戳"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/base/Snowflake.php#L102-L109 |
yuncms/framework | src/base/Snowflake.php | Snowflake.milliTime | protected function milliTime(): int
{
$microTime = microtime();
$comps = explode(' ', $microTime);
// Note: Using a string here to prevent loss of precision
// in case of "overflow" (PHP converts it to a double)
return (int)sprintf('%d%03d', $comps[1], $comps[0] * 1000);
... | php | protected function milliTime(): int
{
$microTime = microtime();
$comps = explode(' ', $microTime);
// Note: Using a string here to prevent loss of precision
// in case of "overflow" (PHP converts it to a double)
return (int)sprintf('%d%03d', $comps[1], $comps[0] * 1000);
... | [
"protected",
"function",
"milliTime",
"(",
")",
":",
"int",
"{",
"$",
"microTime",
"=",
"microtime",
"(",
")",
";",
"$",
"comps",
"=",
"explode",
"(",
"' '",
",",
"$",
"microTime",
")",
";",
"// Note: Using a string here to prevent loss of precision",
"// in cas... | 返回以毫秒为单位的当前时间
@return int 当前时间(毫秒) | [
"返回以毫秒为单位的当前时间"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/base/Snowflake.php#L115-L122 |
webforge-labs/psc-cms | lib/Psc/CMS/ComponentsForm.php | ComponentsForm.sortComponents | public function sortComponents($sorting) {
if (is_array($sorting)) {
$order = array_flip($sorting); // $name => $position
// wir erstellen unseren name => componenten index
$components = \Psc\Doctrine\Helper::reindex($this->components->toArray(),'getFormName');
// wir fügen alle Komponenten ... | php | public function sortComponents($sorting) {
if (is_array($sorting)) {
$order = array_flip($sorting); // $name => $position
// wir erstellen unseren name => componenten index
$components = \Psc\Doctrine\Helper::reindex($this->components->toArray(),'getFormName');
// wir fügen alle Komponenten ... | [
"public",
"function",
"sortComponents",
"(",
"$",
"sorting",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"sorting",
")",
")",
"{",
"$",
"order",
"=",
"array_flip",
"(",
"$",
"sorting",
")",
";",
"// $name => $position",
"// wir erstellen unseren name => component... | Verändert die aktuelle Reihenfolge der Componenten
$sorting kann entweder ein Closure sein welches als Parameter 2 Komponenten bekommt und dann entscheidet welche weiter vorne stehen soll.
oder ein array von property Names. Diese werden dann in der Reihenfolge wie im Array gesetzt, alle restlichen (nicht im array ange... | [
"Verändert",
"die",
"aktuelle",
"Reihenfolge",
"der",
"Componenten"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/ComponentsForm.php#L127-L156 |
teneleven/GeolocatorBundle | Controller/GeolocatorController.php | GeolocatorController.locate | public function locate($entity, Request $request, $template = null)
{
if (!$template) {
$template = 'TenelevenGeolocatorBundle::results.html.twig';
}
$provider = $this->getLocationProvider($entity);
$form = $this->get('form.factory')->createNamed('', $provider->getFilter... | php | public function locate($entity, Request $request, $template = null)
{
if (!$template) {
$template = 'TenelevenGeolocatorBundle::results.html.twig';
}
$provider = $this->getLocationProvider($entity);
$form = $this->get('form.factory')->createNamed('', $provider->getFilter... | [
"public",
"function",
"locate",
"(",
"$",
"entity",
",",
"Request",
"$",
"request",
",",
"$",
"template",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"template",
")",
"{",
"$",
"template",
"=",
"'TenelevenGeolocatorBundle::results.html.twig'",
";",
"}",
"$... | Displays a geo-locator screen with map, form, and locations
@param string $entity The entity key that the provider is registered under
@param Request $request
@param string $template The template to render
@return Response | [
"Displays",
"a",
"geo",
"-",
"locator",
"screen",
"with",
"map",
"form",
"and",
"locations"
] | train | https://github.com/teneleven/GeolocatorBundle/blob/4ead8e783a91577f2a67aa302b79641d4b9e99ad/Controller/GeolocatorController.php#L44-L89 |
teneleven/GeolocatorBundle | Controller/GeolocatorController.php | GeolocatorController.buildMap | protected function buildMap($template, Search $result)
{
$map = $this->getMap();
if (!$result->hasResults()) { //in case of no result we center on the searched location
$map->setCenter(
new Coordinate(
$result->getCenter()->getLatitude(),
... | php | protected function buildMap($template, Search $result)
{
$map = $this->getMap();
if (!$result->hasResults()) { //in case of no result we center on the searched location
$map->setCenter(
new Coordinate(
$result->getCenter()->getLatitude(),
... | [
"protected",
"function",
"buildMap",
"(",
"$",
"template",
",",
"Search",
"$",
"result",
")",
"{",
"$",
"map",
"=",
"$",
"this",
"->",
"getMap",
"(",
")",
";",
"if",
"(",
"!",
"$",
"result",
"->",
"hasResults",
"(",
")",
")",
"{",
"//in case of no re... | Builds a map of locations
@param string $template
@param Search $result
@return \Ivory\GoogleMap\Map | [
"Builds",
"a",
"map",
"of",
"locations"
] | train | https://github.com/teneleven/GeolocatorBundle/blob/4ead8e783a91577f2a67aa302b79641d4b9e99ad/Controller/GeolocatorController.php#L108-L157 |
arsengoian/viper-framework | src/Viper/Core/Model/DB/MySQL/Types/StringType.php | StringType.validate | public function validate ($value): void
{
switch ($this -> sqlType) {
case 'ENUM':
case 'SET':
// Not implemented;
break;
default:
$common = self::TYPES[$this -> sqlType];
if (!$this -> size)
... | php | public function validate ($value): void
{
switch ($this -> sqlType) {
case 'ENUM':
case 'SET':
// Not implemented;
break;
default:
$common = self::TYPES[$this -> sqlType];
if (!$this -> size)
... | [
"public",
"function",
"validate",
"(",
"$",
"value",
")",
":",
"void",
"{",
"switch",
"(",
"$",
"this",
"->",
"sqlType",
")",
"{",
"case",
"'ENUM'",
":",
"case",
"'SET'",
":",
"// Not implemented;",
"break",
";",
"default",
":",
"$",
"common",
"=",
"se... | Checks if the type is correspondent | [
"Checks",
"if",
"the",
"type",
"is",
"correspondent"
] | train | https://github.com/arsengoian/viper-framework/blob/22796c5cc219cae3ca0b4af370a347ba2acab0f2/src/Viper/Core/Model/DB/MySQL/Types/StringType.php#L36-L51 |
redaigbaria/oauth2 | src/TokenType/AbstractTokenType.php | AbstractTokenType.getParam | public function getParam($key)
{
return isset($this->response[$key]) ? $this->response[$key] : null;
} | php | public function getParam($key)
{
return isset($this->response[$key]) ? $this->response[$key] : null;
} | [
"public",
"function",
"getParam",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"response",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"response",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/TokenType/AbstractTokenType.php#L71-L74 |
krzysztofmazur/php-object-mapper | src/KrzysztofMazur/ObjectMapper/ObjectMapper.php | ObjectMapper.map | public function map($source, $targetClass, $mapId = null)
{
$object = $this->instantiator->instantiate($targetClass);
$this->mapToObject($source, $object, $mapId);
return $object;
} | php | public function map($source, $targetClass, $mapId = null)
{
$object = $this->instantiator->instantiate($targetClass);
$this->mapToObject($source, $object, $mapId);
return $object;
} | [
"public",
"function",
"map",
"(",
"$",
"source",
",",
"$",
"targetClass",
",",
"$",
"mapId",
"=",
"null",
")",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"instantiator",
"->",
"instantiate",
"(",
"$",
"targetClass",
")",
";",
"$",
"this",
"->",
"map... | {@inheritdoc} | [
"{"
] | train | https://github.com/krzysztofmazur/php-object-mapper/blob/2c22acad9634cfe8e9a75d72e665d450ada8d4e3/src/KrzysztofMazur/ObjectMapper/ObjectMapper.php#L42-L48 |
krzysztofmazur/php-object-mapper | src/KrzysztofMazur/ObjectMapper/ObjectMapper.php | ObjectMapper.mapToObject | public function mapToObject($source, $target, $mapId = null)
{
$this->repository->getMapping(get_class($source), get_class($target), $mapId)->map($source, $target);
return $target;
} | php | public function mapToObject($source, $target, $mapId = null)
{
$this->repository->getMapping(get_class($source), get_class($target), $mapId)->map($source, $target);
return $target;
} | [
"public",
"function",
"mapToObject",
"(",
"$",
"source",
",",
"$",
"target",
",",
"$",
"mapId",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"repository",
"->",
"getMapping",
"(",
"get_class",
"(",
"$",
"source",
")",
",",
"get_class",
"(",
"$",
"target",... | {@inheritdoc} | [
"{"
] | train | https://github.com/krzysztofmazur/php-object-mapper/blob/2c22acad9634cfe8e9a75d72e665d450ada8d4e3/src/KrzysztofMazur/ObjectMapper/ObjectMapper.php#L53-L58 |
2amigos/yiifoundation | widgets/TopBar.php | TopBar.init | public function init()
{
$this->assets = array(
'js' => YII_DEBUG ? 'foundation/foundation.topbar.js' : 'foundation.min.js'
);
Html::addCssClass($this->htmlOptions, Enum::NAV_TOPBAR);
if ($this->fixed) {
Html::addCssClass($this->htmlOptions, Enum::NAV_FIXED);... | php | public function init()
{
$this->assets = array(
'js' => YII_DEBUG ? 'foundation/foundation.topbar.js' : 'foundation.min.js'
);
Html::addCssClass($this->htmlOptions, Enum::NAV_TOPBAR);
if ($this->fixed) {
Html::addCssClass($this->htmlOptions, Enum::NAV_FIXED);... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"assets",
"=",
"array",
"(",
"'js'",
"=>",
"YII_DEBUG",
"?",
"'foundation/foundation.topbar.js'",
":",
"'foundation.min.js'",
")",
";",
"Html",
"::",
"addCssClass",
"(",
"$",
"this",
"->",
"html... | Initializes the widget | [
"Initializes",
"the",
"widget"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/TopBar.php#L137-L155 |
2amigos/yiifoundation | widgets/TopBar.php | TopBar.renderNavigation | protected function renderNavigation()
{
$nav = array();
if (!empty($this->wrapperOptions)) {
$nav[] = \CHtml::openTag('div', $this->wrapperOptions);
}
$nav[] = \CHtml::openTag('nav', $this->htmlOptions);
$nav[] = $this->renderTitle();
$nav[] = $this->rende... | php | protected function renderNavigation()
{
$nav = array();
if (!empty($this->wrapperOptions)) {
$nav[] = \CHtml::openTag('div', $this->wrapperOptions);
}
$nav[] = \CHtml::openTag('nav', $this->htmlOptions);
$nav[] = $this->renderTitle();
$nav[] = $this->rende... | [
"protected",
"function",
"renderNavigation",
"(",
")",
"{",
"$",
"nav",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"wrapperOptions",
")",
")",
"{",
"$",
"nav",
"[",
"]",
"=",
"\\",
"CHtml",
"::",
"openTag",
"(",
... | Renders the navigation | [
"Renders",
"the",
"navigation"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/TopBar.php#L168-L183 |
2amigos/yiifoundation | widgets/TopBar.php | TopBar.renderTitle | protected function renderTitle()
{
$items = array();
$title = \CHtml::tag('h1', array(), \CHtml::link($this->title, $this->titleUrl, $this->titleOptions));
$items[] = \CHtml::tag('li', array('class' => 'name'), $title);
$items[] = \CHtml::tag(
'li',
array(... | php | protected function renderTitle()
{
$items = array();
$title = \CHtml::tag('h1', array(), \CHtml::link($this->title, $this->titleUrl, $this->titleOptions));
$items[] = \CHtml::tag('li', array('class' => 'name'), $title);
$items[] = \CHtml::tag(
'li',
array(... | [
"protected",
"function",
"renderTitle",
"(",
")",
"{",
"$",
"items",
"=",
"array",
"(",
")",
";",
"$",
"title",
"=",
"\\",
"CHtml",
"::",
"tag",
"(",
"'h1'",
",",
"array",
"(",
")",
",",
"\\",
"CHtml",
"::",
"link",
"(",
"$",
"this",
"->",
"title... | Renders the title of navigation
@return string | [
"Renders",
"the",
"title",
"of",
"navigation"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/TopBar.php#L189-L200 |
2amigos/yiifoundation | widgets/TopBar.php | TopBar.renderItems | protected function renderItems()
{
$items = array();
if (!empty($this->leftItems)) {
$tItems = array();
foreach ($this->leftItems as $item) {
$tItems[] = $this->renderItem($item);
}
$items[] = \CHtml::openTag('ul', array('class' => Enum... | php | protected function renderItems()
{
$items = array();
if (!empty($this->leftItems)) {
$tItems = array();
foreach ($this->leftItems as $item) {
$tItems[] = $this->renderItem($item);
}
$items[] = \CHtml::openTag('ul', array('class' => Enum... | [
"protected",
"function",
"renderItems",
"(",
")",
"{",
"$",
"items",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"leftItems",
")",
")",
"{",
"$",
"tItems",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this"... | Renders widget's items.
@return string | [
"Renders",
"widget",
"s",
"items",
"."
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/TopBar.php#L206-L235 |
2amigos/yiifoundation | widgets/TopBar.php | TopBar.renderItem | protected function renderItem($item)
{
if (is_string($item)) {
return $item;
}
if (!isset($item['label'])) {
throw new InvalidConfigException("The 'label' option is required.");
}
$label = $this->encodeLabels ? \CHtml::encode($item['label']) : $i... | php | protected function renderItem($item)
{
if (is_string($item)) {
return $item;
}
if (!isset($item['label'])) {
throw new InvalidConfigException("The 'label' option is required.");
}
$label = $this->encodeLabels ? \CHtml::encode($item['label']) : $i... | [
"protected",
"function",
"renderItem",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"item",
")",
")",
"{",
"return",
"$",
"item",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"item",
"[",
"'label'",
"]",
")",
")",
"{",
"throw",
... | Renders a widget's item
@param mixed $item the item to render
@return string the rendering result.
@throws InvalidConfigException | [
"Renders",
"a",
"widget",
"s",
"item"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/TopBar.php#L243-L269 |
afrittella/back-project | src/app/Http/ViewComposers/AdminMenuComposer.php | AdminMenuComposer.menu | function menu($menus)
{
// Retrieve current user (for permissions)
$user = Auth::user();
$templates = [
"menu" => '
<ul class="sidebar-menu" data-widget="tree">
%s
</ul>
',
"menu_row" => '
<li class="%s">... | php | function menu($menus)
{
// Retrieve current user (for permissions)
$user = Auth::user();
$templates = [
"menu" => '
<ul class="sidebar-menu" data-widget="tree">
%s
</ul>
',
"menu_row" => '
<li class="%s">... | [
"function",
"menu",
"(",
"$",
"menus",
")",
"{",
"// Retrieve current user (for permissions)",
"$",
"user",
"=",
"Auth",
"::",
"user",
"(",
")",
";",
"$",
"templates",
"=",
"[",
"\"menu\"",
"=>",
"'\n <ul class=\"sidebar-menu\" data-widget=\"tree\">\n ... | Format an AdminLTE Menu
$menus must be formatted in this way:
Menu
children
children
@param array $menus
@return string | [
"Format",
"an",
"AdminLTE",
"Menu"
] | train | https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/app/Http/ViewComposers/AdminMenuComposer.php#L39-L119 |
ruvents/ruwork-upload-bundle | Manager/UploadManager.php | UploadManager.register | public function register($object, $source): void
{
$resolvedSource = $this->sourceResolver->resolve($source);
$this->accessor->setPath($object, $resolvedSource->getPath());
$this->accessor->setAttributes($object, $resolvedSource->getAttributes());
$this->resolvedSources->attach($obje... | php | public function register($object, $source): void
{
$resolvedSource = $this->sourceResolver->resolve($source);
$this->accessor->setPath($object, $resolvedSource->getPath());
$this->accessor->setAttributes($object, $resolvedSource->getAttributes());
$this->resolvedSources->attach($obje... | [
"public",
"function",
"register",
"(",
"$",
"object",
",",
"$",
"source",
")",
":",
"void",
"{",
"$",
"resolvedSource",
"=",
"$",
"this",
"->",
"sourceResolver",
"->",
"resolve",
"(",
"$",
"source",
")",
";",
"$",
"this",
"->",
"accessor",
"->",
"setPa... | {@inheritdoc} | [
"{"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Manager/UploadManager.php#L38-L44 |
ruvents/ruwork-upload-bundle | Manager/UploadManager.php | UploadManager.getResolvedSource | public function getResolvedSource($object): ResolvedSource
{
if (!$this->resolvedSources->contains($object)) {
throw new NotRegisteredException('Object is not registered.');
}
return $this->resolvedSources[$object];
} | php | public function getResolvedSource($object): ResolvedSource
{
if (!$this->resolvedSources->contains($object)) {
throw new NotRegisteredException('Object is not registered.');
}
return $this->resolvedSources[$object];
} | [
"public",
"function",
"getResolvedSource",
"(",
"$",
"object",
")",
":",
"ResolvedSource",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"resolvedSources",
"->",
"contains",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"NotRegisteredException",
"(",
"'Object... | {@inheritdoc} | [
"{"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Manager/UploadManager.php#L49-L56 |
ruvents/ruwork-upload-bundle | Manager/UploadManager.php | UploadManager.save | public function save($object): void
{
$this->getResolvedSource($object)->save();
$this->detach($object);
} | php | public function save($object): void
{
$this->getResolvedSource($object)->save();
$this->detach($object);
} | [
"public",
"function",
"save",
"(",
"$",
"object",
")",
":",
"void",
"{",
"$",
"this",
"->",
"getResolvedSource",
"(",
"$",
"object",
")",
"->",
"save",
"(",
")",
";",
"$",
"this",
"->",
"detach",
"(",
"$",
"object",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Manager/UploadManager.php#L61-L65 |
ruvents/ruwork-upload-bundle | Manager/UploadManager.php | UploadManager.locate | public function locate($object): string
{
$path = $this->getPath($object);
return $this->pathLocator->locatePath($path);
} | php | public function locate($object): string
{
$path = $this->getPath($object);
return $this->pathLocator->locatePath($path);
} | [
"public",
"function",
"locate",
"(",
"$",
"object",
")",
":",
"string",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getPath",
"(",
"$",
"object",
")",
";",
"return",
"$",
"this",
"->",
"pathLocator",
"->",
"locatePath",
"(",
"$",
"path",
")",
";",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Manager/UploadManager.php#L94-L99 |
xinix-technology/norm | src/Norm/Cursor/OCICursor.php | OCICursor.count | public function count($foundOnly = false)
{
$wheres = array();
$data = array();
$matchOrs = array();
$criteria = $this->translateCriteria($this->criteria);
if (is_null($this->match)) {
$criteria = $this->translateCriteria($this->criteria);
if ($... | php | public function count($foundOnly = false)
{
$wheres = array();
$data = array();
$matchOrs = array();
$criteria = $this->translateCriteria($this->criteria);
if (is_null($this->match)) {
$criteria = $this->translateCriteria($this->criteria);
if ($... | [
"public",
"function",
"count",
"(",
"$",
"foundOnly",
"=",
"false",
")",
"{",
"$",
"wheres",
"=",
"array",
"(",
")",
";",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"matchOrs",
"=",
"array",
"(",
")",
";",
"$",
"criteria",
"=",
"$",
"this",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/OCICursor.php#L155-L227 |
xinix-technology/norm | src/Norm/Cursor/OCICursor.php | OCICursor.prepareCriteria | public function prepareCriteria($criteria)
{
if (is_null($criteria)) {
$criteria = array();
}
if (array_key_exists('$id', $criteria)) {
$criteria['id'] = $criteria['$id'];
unset($criteria['$id']);
}
return $criteria ? : array();
} | php | public function prepareCriteria($criteria)
{
if (is_null($criteria)) {
$criteria = array();
}
if (array_key_exists('$id', $criteria)) {
$criteria['id'] = $criteria['$id'];
unset($criteria['$id']);
}
return $criteria ? : array();
} | [
"public",
"function",
"prepareCriteria",
"(",
"$",
"criteria",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"criteria",
")",
")",
"{",
"$",
"criteria",
"=",
"array",
"(",
")",
";",
"}",
"if",
"(",
"array_key_exists",
"(",
"'$id'",
",",
"$",
"criteria",
... | comment for other criteria | [
"comment",
"for",
"other",
"criteria"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/OCICursor.php#L244-L256 |
xinix-technology/norm | src/Norm/Cursor/OCICursor.php | OCICursor.getStatement | public function getStatement($type = null)
{
$data = array();
$wheres = array();
$matchOrs = array();
if (is_null($this->match)) {
$criteria = $this->translateCriteria($this->criteria);
if ($criteria) {
foreach ($criteria as $key ... | php | public function getStatement($type = null)
{
$data = array();
$wheres = array();
$matchOrs = array();
if (is_null($this->match)) {
$criteria = $this->translateCriteria($this->criteria);
if ($criteria) {
foreach ($criteria as $key ... | [
"public",
"function",
"getStatement",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"wheres",
"=",
"array",
"(",
")",
";",
"$",
"matchOrs",
"=",
"array",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"... | Execute a query.
@return int | [
"Execute",
"a",
"query",
"."
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/OCICursor.php#L280-L391 |
xinix-technology/norm | src/Norm/Cursor/OCICursor.php | OCICursor.sort | public function sort(array $sorts = array())
{
if (func_num_args() === 0) {
return $this->sorts;
}
$this->sorts = array();
foreach ($sorts as $key => $value) {
if ($key[0] === '$') {
$key = 'h_' . substr($key, 1);
... | php | public function sort(array $sorts = array())
{
if (func_num_args() === 0) {
return $this->sorts;
}
$this->sorts = array();
foreach ($sorts as $key => $value) {
if ($key[0] === '$') {
$key = 'h_' . substr($key, 1);
... | [
"public",
"function",
"sort",
"(",
"array",
"$",
"sorts",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"===",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"sorts",
";",
"}",
"$",
"this",
"->",
"sorts",
"=",
"array",
"(",... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/OCICursor.php#L397-L417 |
xinix-technology/norm | src/Norm/Cursor/OCICursor.php | OCICursor.getQueryReference | public function getQueryReference($key = '', $foreign = '', $foreignLabel = '', $foreignKey = '', &$i)
{
$model = Norm::factory($foreign);
$refSchemes = $model->schema();
$foreignKey = $foreignKey ?: 'id';
if ($foreignKey == '$id') {
$foreignKey = 'id';
}
... | php | public function getQueryReference($key = '', $foreign = '', $foreignLabel = '', $foreignKey = '', &$i)
{
$model = Norm::factory($foreign);
$refSchemes = $model->schema();
$foreignKey = $foreignKey ?: 'id';
if ($foreignKey == '$id') {
$foreignKey = 'id';
}
... | [
"public",
"function",
"getQueryReference",
"(",
"$",
"key",
"=",
"''",
",",
"$",
"foreign",
"=",
"''",
",",
"$",
"foreignLabel",
"=",
"''",
",",
"$",
"foreignKey",
"=",
"''",
",",
"&",
"$",
"i",
")",
"{",
"$",
"model",
"=",
"Norm",
"::",
"factory",... | Find reference of a foreign key.
@param string $key
@param string $foreign
@param string $foreignLabel
@param string $foreignKey
@param int &$i
@return string | [
"Find",
"reference",
"of",
"a",
"foreign",
"key",
"."
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/OCICursor.php#L450-L464 |
dms-org/package.blog | src/Domain/Services/Loader/BlogAuthorLoader.php | BlogAuthorLoader.loadFromSlug | public function loadFromSlug(string $slug) : BlogAuthor
{
$categories = $this->blogAuthorRepo->matching(
$this->blogAuthorRepo->criteria()
->where(BlogAuthor::SLUG, '=', $slug)
);
if (!$categories) {
throw new EntityNotFoundException(BlogAuthor::class... | php | public function loadFromSlug(string $slug) : BlogAuthor
{
$categories = $this->blogAuthorRepo->matching(
$this->blogAuthorRepo->criteria()
->where(BlogAuthor::SLUG, '=', $slug)
);
if (!$categories) {
throw new EntityNotFoundException(BlogAuthor::class... | [
"public",
"function",
"loadFromSlug",
"(",
"string",
"$",
"slug",
")",
":",
"BlogAuthor",
"{",
"$",
"categories",
"=",
"$",
"this",
"->",
"blogAuthorRepo",
"->",
"matching",
"(",
"$",
"this",
"->",
"blogAuthorRepo",
"->",
"criteria",
"(",
")",
"->",
"where... | @param string $slug
@return BlogAuthor
@throws EntityNotFoundException | [
"@param",
"string",
"$slug"
] | train | https://github.com/dms-org/package.blog/blob/1500f6fad20d81289a0dfa617fc1c54699f01e16/src/Domain/Services/Loader/BlogAuthorLoader.php#L46-L58 |
webforge-labs/psc-cms | lib/Psc/System/File.php | File.replaceContents | public function replaceContents(Array $replacements) {
$this->writeContents(
str_replace(
array_keys($replacements),
array_values($replacements),
$this->getContents()
)
);
return $this;
} | php | public function replaceContents(Array $replacements) {
$this->writeContents(
str_replace(
array_keys($replacements),
array_values($replacements),
$this->getContents()
)
);
return $this;
} | [
"public",
"function",
"replaceContents",
"(",
"Array",
"$",
"replacements",
")",
"{",
"$",
"this",
"->",
"writeContents",
"(",
"str_replace",
"(",
"array_keys",
"(",
"$",
"replacements",
")",
",",
"array_values",
"(",
"$",
"replacements",
")",
",",
"$",
"thi... | Replaces the contents of the file
@deprecated | [
"Replaces",
"the",
"contents",
"of",
"the",
"file"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/System/File.php#L11-L20 |
anime-db/app-bundle | src/DQL/Datetime.php | Datetime.getSql | public function getSql(SqlWalker $sqlWalker)
{
return sprintf(
'DATETIME(%s, %s)',
$this->firstDateExpression->dispatch($sqlWalker),
$this->secondDateExpression->dispatch($sqlWalker)
);
} | php | public function getSql(SqlWalker $sqlWalker)
{
return sprintf(
'DATETIME(%s, %s)',
$this->firstDateExpression->dispatch($sqlWalker),
$this->secondDateExpression->dispatch($sqlWalker)
);
} | [
"public",
"function",
"getSql",
"(",
"SqlWalker",
"$",
"sqlWalker",
")",
"{",
"return",
"sprintf",
"(",
"'DATETIME(%s, %s)'",
",",
"$",
"this",
"->",
"firstDateExpression",
"->",
"dispatch",
"(",
"$",
"sqlWalker",
")",
",",
"$",
"this",
"->",
"secondDateExpres... | @param SqlWalker $sqlWalker
@return string | [
"@param",
"SqlWalker",
"$sqlWalker"
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/DQL/Datetime.php#L56-L63 |
askupasoftware/amarkal | Extensions/WordPress/Widget/Widget.php | Widget.set_field_names | private function set_field_names()
{
foreach ( $this->config->fields as $field )
{
$field->init_name = $field->name;
}
} | php | private function set_field_names()
{
foreach ( $this->config->fields as $field )
{
$field->init_name = $field->name;
}
} | [
"private",
"function",
"set_field_names",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"config",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"field",
"->",
"init_name",
"=",
"$",
"field",
"->",
"name",
";",
"}",
"}"
] | Since the widget's form sets custom names and ids to each field,
the original field name must be stored seperately using this function. | [
"Since",
"the",
"widget",
"s",
"form",
"sets",
"custom",
"names",
"and",
"ids",
"to",
"each",
"field",
"the",
"original",
"field",
"name",
"must",
"be",
"stored",
"seperately",
"using",
"this",
"function",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Widget/Widget.php#L85-L91 |
askupasoftware/amarkal | Extensions/WordPress/Widget/Widget.php | Widget.form | public function form( $instance )
{
// Reset the names so that the form's update function works properly
foreach ( $this->config->fields as $field )
{
$field->name = $field->init_name;
}
// Update values
$this->form->updater->set_new_instance( $instance )... | php | public function form( $instance )
{
// Reset the names so that the form's update function works properly
foreach ( $this->config->fields as $field )
{
$field->name = $field->init_name;
}
// Update values
$this->form->updater->set_new_instance( $instance )... | [
"public",
"function",
"form",
"(",
"$",
"instance",
")",
"{",
"// Reset the names so that the form's update function works properly",
"foreach",
"(",
"$",
"this",
"->",
"config",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"field",
"->",
"name",
"=",
"$",... | Generates the administration form for the widget
@param array $instance The array of keys and
values for the widget | [
"Generates",
"the",
"administration",
"form",
"for",
"the",
"widget"
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Widget/Widget.php#L99-L119 |
askupasoftware/amarkal | Extensions/WordPress/Widget/Widget.php | Widget.update | public function update( $new_instance, $old_instance )
{
$this->form->updater->set_new_instance( $new_instance );
return $this->form->updater->update( $old_instance );
} | php | public function update( $new_instance, $old_instance )
{
$this->form->updater->set_new_instance( $new_instance );
return $this->form->updater->update( $old_instance );
} | [
"public",
"function",
"update",
"(",
"$",
"new_instance",
",",
"$",
"old_instance",
")",
"{",
"$",
"this",
"->",
"form",
"->",
"updater",
"->",
"set_new_instance",
"(",
"$",
"new_instance",
")",
";",
"return",
"$",
"this",
"->",
"form",
"->",
"updater",
... | Processes the widget's options to be saved.
@param array new_instance The previous instance
of values before the update.
@param array old_instance The new instance of
values to be generated via the update. | [
"Processes",
"the",
"widget",
"s",
"options",
"to",
"be",
"saved",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Extensions/WordPress/Widget/Widget.php#L129-L133 |
djgadd/themosis-illuminate | src/Filesystem/StorageFacade.php | StorageFacade.fake | public static function fake($disk)
{
(new Filesystem)->cleanDirectory(
$root = storage_path('framework/testing/disks/'.$disk)
);
static::set($disk, self::createLocalDriver(['root' => $root]));
} | php | public static function fake($disk)
{
(new Filesystem)->cleanDirectory(
$root = storage_path('framework/testing/disks/'.$disk)
);
static::set($disk, self::createLocalDriver(['root' => $root]));
} | [
"public",
"static",
"function",
"fake",
"(",
"$",
"disk",
")",
"{",
"(",
"new",
"Filesystem",
")",
"->",
"cleanDirectory",
"(",
"$",
"root",
"=",
"storage_path",
"(",
"'framework/testing/disks/'",
".",
"$",
"disk",
")",
")",
";",
"static",
"::",
"set",
"... | Replace the given disk with a local, testing disk.
@param string $disk
@return void | [
"Replace",
"the",
"given",
"disk",
"with",
"a",
"local",
"testing",
"disk",
"."
] | train | https://github.com/djgadd/themosis-illuminate/blob/13ee4c3413cddd85a2f262ac361f35c81da0c53c/src/Filesystem/StorageFacade.php#L19-L26 |
askupasoftware/amarkal | Form/Form.php | Form.validate_components | private function validate_components( $components )
{
foreach( $components as $component )
{
if( ! $component instanceof UI\AbstractComponent )
{
throw new WrongTypeException( \gettype( $component ) );
}
if( $component inst... | php | private function validate_components( $components )
{
foreach( $components as $component )
{
if( ! $component instanceof UI\AbstractComponent )
{
throw new WrongTypeException( \gettype( $component ) );
}
if( $component inst... | [
"private",
"function",
"validate_components",
"(",
"$",
"components",
")",
"{",
"foreach",
"(",
"$",
"components",
"as",
"$",
"component",
")",
"{",
"if",
"(",
"!",
"$",
"component",
"instanceof",
"UI",
"\\",
"AbstractComponent",
")",
"{",
"throw",
"new",
... | Internally used to validate each form component.
@param \Amarkal\UI\AbstractComponent[] $components
@throws \Amarkal\Form\DuplicateNameException | [
"Internally",
"used",
"to",
"validate",
"each",
"form",
"component",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Form/Form.php#L42-L64 |
ClanCats/Core | src/bundles/Mail/Transporter/Smtp.php | Transporter_Smtp.setup_driver | protected function setup_driver( &$driver )
{
$driver->IsSMTP();
$driver->Host = $this->config->host;
// smtp auth?
if ( $this->config->auth === true )
{
$driver->SMTPAuth = true;
$driver->Username = $this->config->user;
$driver->Password = $this->config->pass;
}
$driver->SMTPSecure = $t... | php | protected function setup_driver( &$driver )
{
$driver->IsSMTP();
$driver->Host = $this->config->host;
// smtp auth?
if ( $this->config->auth === true )
{
$driver->SMTPAuth = true;
$driver->Username = $this->config->user;
$driver->Password = $this->config->pass;
}
$driver->SMTPSecure = $t... | [
"protected",
"function",
"setup_driver",
"(",
"&",
"$",
"driver",
")",
"{",
"$",
"driver",
"->",
"IsSMTP",
"(",
")",
";",
"$",
"driver",
"->",
"Host",
"=",
"$",
"this",
"->",
"config",
"->",
"host",
";",
"// smtp auth?",
"if",
"(",
"$",
"this",
"->",... | Set the driver settings ( smtp / sendmail )
@param PHPMailer $driver
@return void | [
"Set",
"the",
"driver",
"settings",
"(",
"smtp",
"/",
"sendmail",
")"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/Transporter/Smtp.php#L20-L35 |
digitalkaoz/versioneye-php | src/Console/CommandFactory.php | CommandFactory.generateCommands | public function generateCommands(array $classes = [])
{
$classes = $this->readApis($classes);
$token = $this->token->read();
$commands = [];
foreach ($classes as $class) {
$api = new \ReflectionClass($class);
foreach ($api->getMethods(\ReflectionMethod::... | php | public function generateCommands(array $classes = [])
{
$classes = $this->readApis($classes);
$token = $this->token->read();
$commands = [];
foreach ($classes as $class) {
$api = new \ReflectionClass($class);
foreach ($api->getMethods(\ReflectionMethod::... | [
"public",
"function",
"generateCommands",
"(",
"array",
"$",
"classes",
"=",
"[",
"]",
")",
"{",
"$",
"classes",
"=",
"$",
"this",
"->",
"readApis",
"(",
"$",
"classes",
")",
";",
"$",
"token",
"=",
"$",
"this",
"->",
"token",
"->",
"read",
"(",
")... | generates Commands from all Api Methods.
@param array $classes
@return Command[] | [
"generates",
"Commands",
"from",
"all",
"Api",
"Methods",
"."
] | train | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Console/CommandFactory.php#L48-L66 |
digitalkaoz/versioneye-php | src/Console/CommandFactory.php | CommandFactory.buildDefinition | private function buildDefinition(\ReflectionMethod $method, $token = null)
{
$definition = new InputDefinition();
foreach ($method->getParameters() as $parameter) {
if ($parameter->isDefaultValueAvailable()) {
//option
$definition->addOption(new InputOpti... | php | private function buildDefinition(\ReflectionMethod $method, $token = null)
{
$definition = new InputDefinition();
foreach ($method->getParameters() as $parameter) {
if ($parameter->isDefaultValueAvailable()) {
//option
$definition->addOption(new InputOpti... | [
"private",
"function",
"buildDefinition",
"(",
"\\",
"ReflectionMethod",
"$",
"method",
",",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"definition",
"=",
"new",
"InputDefinition",
"(",
")",
";",
"foreach",
"(",
"$",
"method",
"->",
"getParameters",
"(",
")... | builds the Input Definition based upon Api Method Parameters.
@param \ReflectionMethod $method
@param string $token
@return InputDefinition | [
"builds",
"the",
"Input",
"Definition",
"based",
"upon",
"Api",
"Method",
"Parameters",
"."
] | train | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Console/CommandFactory.php#L99-L117 |
ClanCats/Core | src/bundles/UI/Builder.php | Builder._init | public static function _init()
{
// select the current builder
$builder_class = \ClanCats::$config->get( 'ui.builder', "\\UI\\Builder_Bootstrap" );
static::$builder = new $builder_class;
// load the ui configuration
static::$config = \CCConfig::create( 'ui' );
} | php | public static function _init()
{
// select the current builder
$builder_class = \ClanCats::$config->get( 'ui.builder', "\\UI\\Builder_Bootstrap" );
static::$builder = new $builder_class;
// load the ui configuration
static::$config = \CCConfig::create( 'ui' );
} | [
"public",
"static",
"function",
"_init",
"(",
")",
"{",
"// select the current builder",
"$",
"builder_class",
"=",
"\\",
"ClanCats",
"::",
"$",
"config",
"->",
"get",
"(",
"'ui.builder'",
",",
"\"\\\\UI\\\\Builder_Bootstrap\"",
")",
";",
"static",
"::",
"$",
"b... | Static init
@return void | [
"Static",
"init"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Builder.php#L32-L40 |
ClanCats/Core | src/bundles/UI/Builder.php | Builder.handle | public static function handle()
{
$args = func_get_args();
$key = array_shift( $args );
return call_user_func_array( array( static::$builder, 'build_'.$key ), $args );
} | php | public static function handle()
{
$args = func_get_args();
$key = array_shift( $args );
return call_user_func_array( array( static::$builder, 'build_'.$key ), $args );
} | [
"public",
"static",
"function",
"handle",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"key",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"return",
"call_user_func_array",
"(",
"array",
"(",
"static",
"::",
"$",
"builder",
... | Handle a build request
@param string $key
@param mixed ... | [
"Handle",
"a",
"build",
"request"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/Builder.php#L48-L54 |
anime-db/app-bundle | src/Service/TwigExtension.php | TwigExtension.favicon | public function favicon($url)
{
return $url ? $this->router->generate('media_favicon', ['host' => parse_url($url, PHP_URL_HOST)]) : false;
} | php | public function favicon($url)
{
return $url ? $this->router->generate('media_favicon', ['host' => parse_url($url, PHP_URL_HOST)]) : false;
} | [
"public",
"function",
"favicon",
"(",
"$",
"url",
")",
"{",
"return",
"$",
"url",
"?",
"$",
"this",
"->",
"router",
"->",
"generate",
"(",
"'media_favicon'",
",",
"[",
"'host'",
"=>",
"parse_url",
"(",
"$",
"url",
",",
"PHP_URL_HOST",
")",
"]",
")",
... | @param string $url
@return string|false | [
"@param",
"string",
"$url"
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Service/TwigExtension.php#L69-L72 |
anime-db/app-bundle | src/Service/TwigExtension.php | TwigExtension.widgets | public function widgets($place, array $attributes = [], array $options = [])
{
$result = '';
foreach ($this->widgets->getWidgetsForPlace($place) as $controller) {
$result .= $this->handler->render(
new ControllerReference($controller, $attributes, []),
'hi... | php | public function widgets($place, array $attributes = [], array $options = [])
{
$result = '';
foreach ($this->widgets->getWidgetsForPlace($place) as $controller) {
$result .= $this->handler->render(
new ControllerReference($controller, $attributes, []),
'hi... | [
"public",
"function",
"widgets",
"(",
"$",
"place",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"widgets",
"->",
"getWidget... | @param string $place
@param array $attributes
@param array $options
@return string | [
"@param",
"string",
"$place",
"@param",
"array",
"$attributes",
"@param",
"array",
"$options"
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Service/TwigExtension.php#L81-L93 |
dms-org/package.blog | src/Domain/Entities/BlogArticleComment.php | BlogArticleComment.defineEntity | protected function defineEntity(ClassDefinition $class)
{
$class->property($this->article)->asObject(BlogArticle::class);
$class->property($this->authorName)->asString();
$class->property($this->authorEmail)->asObject(EmailAddress::class);
$class->property($this->content)->asStrin... | php | protected function defineEntity(ClassDefinition $class)
{
$class->property($this->article)->asObject(BlogArticle::class);
$class->property($this->authorName)->asString();
$class->property($this->authorEmail)->asObject(EmailAddress::class);
$class->property($this->content)->asStrin... | [
"protected",
"function",
"defineEntity",
"(",
"ClassDefinition",
"$",
"class",
")",
"{",
"$",
"class",
"->",
"property",
"(",
"$",
"this",
"->",
"article",
")",
"->",
"asObject",
"(",
"BlogArticle",
"::",
"class",
")",
";",
"$",
"class",
"->",
"property",
... | Defines the structure of this entity.
@param ClassDefinition $class | [
"Defines",
"the",
"structure",
"of",
"this",
"entity",
"."
] | train | https://github.com/dms-org/package.blog/blob/1500f6fad20d81289a0dfa617fc1c54699f01e16/src/Domain/Entities/BlogArticleComment.php#L80-L93 |
yuncms/framework | src/web/XmlParser.php | XmlParser.parse | public function parse($rawBody, $contentType)
{
try {
$parameters = simplexml_load_string($rawBody, 'SimpleXMLElement', LIBXML_NOCDATA);
$parameters = $this->asArray ? (array)$parameters : $parameters;
return $parameters === null ? [] : $parameters;
} catch (Inval... | php | public function parse($rawBody, $contentType)
{
try {
$parameters = simplexml_load_string($rawBody, 'SimpleXMLElement', LIBXML_NOCDATA);
$parameters = $this->asArray ? (array)$parameters : $parameters;
return $parameters === null ? [] : $parameters;
} catch (Inval... | [
"public",
"function",
"parse",
"(",
"$",
"rawBody",
",",
"$",
"contentType",
")",
"{",
"try",
"{",
"$",
"parameters",
"=",
"simplexml_load_string",
"(",
"$",
"rawBody",
",",
"'SimpleXMLElement'",
",",
"LIBXML_NOCDATA",
")",
";",
"$",
"parameters",
"=",
"$",
... | Parses a HTTP request body.
@param string $rawBody the raw HTTP request body.
@param string $contentType the content type specified for the request body.
@return array parameters parsed from the request body
@throws BadRequestHttpException if the body contains invalid json and [[throwException]] is `true`. | [
"Parses",
"a",
"HTTP",
"request",
"body",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/web/XmlParser.php#L48-L60 |
yuncms/framework | src/rest/controllers/NotificationController.php | NotificationController.actionIndex | public function actionIndex()
{
$user = $this->findModel(Yii::$app->user->id);
$query = $user->getNotifications()->orderBy(new Expression("IF(ISNULL(read_at),0,1) asc"))->addOrderBy(['created_at' => SORT_DESC]);
$requestParams = Yii::$app->getRequest()->getBodyParams();
if (empty($re... | php | public function actionIndex()
{
$user = $this->findModel(Yii::$app->user->id);
$query = $user->getNotifications()->orderBy(new Expression("IF(ISNULL(read_at),0,1) asc"))->addOrderBy(['created_at' => SORT_DESC]);
$requestParams = Yii::$app->getRequest()->getBodyParams();
if (empty($re... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"findModel",
"(",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"id",
")",
";",
"$",
"query",
"=",
"$",
"user",
"->",
"getNotifications",
"(",
")",
"->",
"order... | 跟用户相关的通知列表
@return ActiveDataProvider|ActiveDataFilter
@throws NotFoundHttpException
@throws \yii\base\InvalidConfigException | [
"跟用户相关的通知列表"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/controllers/NotificationController.php#L62-L97 |
yuncms/framework | src/rest/controllers/NotificationController.php | NotificationController.actionView | public function actionView($id)
{
$user = $this->findModel(Yii::$app->user->id);
/** @var DatabaseNotification $notification */
if (($notification = $user->getNotifications()->andWhere(['id' => $id])->one()) != null) {
$notification->setRead();
return $notification;
... | php | public function actionView($id)
{
$user = $this->findModel(Yii::$app->user->id);
/** @var DatabaseNotification $notification */
if (($notification = $user->getNotifications()->andWhere(['id' => $id])->one()) != null) {
$notification->setRead();
return $notification;
... | [
"public",
"function",
"actionView",
"(",
"$",
"id",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"findModel",
"(",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"id",
")",
";",
"/** @var DatabaseNotification $notification */",
"if",
"(",
"(",
"$",
"noti... | 查看通知详情
@param string $id
@return DatabaseNotification
@throws NotFoundHttpException | [
"查看通知详情"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/controllers/NotificationController.php#L105-L115 |
yuncms/framework | src/rest/controllers/NotificationController.php | NotificationController.actionBatchMarkRead | public function actionBatchMarkRead()
{
if (($ids = Yii::$app->request->post('ids', null)) != null) {
foreach ($ids as $id) {
DatabaseNotification::updateAll(['read_at' => time()], ['id' => $id, 'notifiable_id' => Yii::$app->user->id, 'notifiable_class' => \yuncms\user\models\Use... | php | public function actionBatchMarkRead()
{
if (($ids = Yii::$app->request->post('ids', null)) != null) {
foreach ($ids as $id) {
DatabaseNotification::updateAll(['read_at' => time()], ['id' => $id, 'notifiable_id' => Yii::$app->user->id, 'notifiable_class' => \yuncms\user\models\Use... | [
"public",
"function",
"actionBatchMarkRead",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"ids",
"=",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"post",
"(",
"'ids'",
",",
"null",
")",
")",
"!=",
"null",
")",
"{",
"foreach",
"(",
"$",
"ids",
"as",
"$... | 标记指定通知为已读 | [
"标记指定通知为已读"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/controllers/NotificationController.php#L120-L129 |
yuncms/framework | src/rest/controllers/NotificationController.php | NotificationController.actionMarkRead | public function actionMarkRead()
{
DatabaseNotification::updateAll(['read_at' => time()], ['notifiable_id' => Yii::$app->user->id, 'notifiable_class' => \yuncms\user\models\User::class]);
Yii::$app->getResponse()->setStatusCode(200);
} | php | public function actionMarkRead()
{
DatabaseNotification::updateAll(['read_at' => time()], ['notifiable_id' => Yii::$app->user->id, 'notifiable_class' => \yuncms\user\models\User::class]);
Yii::$app->getResponse()->setStatusCode(200);
} | [
"public",
"function",
"actionMarkRead",
"(",
")",
"{",
"DatabaseNotification",
"::",
"updateAll",
"(",
"[",
"'read_at'",
"=>",
"time",
"(",
")",
"]",
",",
"[",
"'notifiable_id'",
"=>",
"Yii",
"::",
"$",
"app",
"->",
"user",
"->",
"id",
",",
"'notifiable_cl... | 标记所有通知为已读 | [
"标记所有通知为已读"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/controllers/NotificationController.php#L134-L138 |
simple-php-mvc/simple-php-mvc | src/MVC/Server/Route.php | Route.getInstance | static function getInstance($methods, $patternUri, $action, $name = null)
{
if (!self::$instance) {
self::$instance = new self($methods, $patternUri, $action, $name);
}
return self::$instance;
} | php | static function getInstance($methods, $patternUri, $action, $name = null)
{
if (!self::$instance) {
self::$instance = new self($methods, $patternUri, $action, $name);
}
return self::$instance;
} | [
"static",
"function",
"getInstance",
"(",
"$",
"methods",
",",
"$",
"patternUri",
",",
"$",
"action",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"instance",
")",
"{",
"self",
"::",
"$",
"instance",
"=",
"new",
"self... | Get Route instance
@param string|array $methods
@param string $patternUri
@param string|\callable $action
@param string $name
@return Route | [
"Get",
"Route",
"instance"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Server/Route.php#L88-L95 |
simple-php-mvc/simple-php-mvc | src/MVC/Server/Route.php | Route.setAction | public function setAction($action)
{
if (!is_string($action) && !is_callable($action)) {
throw new \LogicException(sprintf('Route action given "%s" is invalid. String or Callable expected.', gettype($action)));
}
$this->action = $action;
return $this;
} | php | public function setAction($action)
{
if (!is_string($action) && !is_callable($action)) {
throw new \LogicException(sprintf('Route action given "%s" is invalid. String or Callable expected.', gettype($action)));
}
$this->action = $action;
return $this;
} | [
"public",
"function",
"setAction",
"(",
"$",
"action",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"action",
")",
"&&",
"!",
"is_callable",
"(",
"$",
"action",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"sprintf",
"(",
"'Route act... | Set action callback
@param string|\callable $action
@return Route
@throws \LogicException | [
"Set",
"action",
"callback"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Server/Route.php#L144-L152 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.