id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
193,400
enebe-nb/phergie-irc-plugin-react-autorejoin
src/Plugin.php
Plugin.joinOnMatch
public function joinOnMatch($nickname, UserEventInterface $event, EventQueueInterface $queue) { if ($nickname == $event->getConnection()->getNickname() && ($index = array_search($event->getSource(), $this->channels)) !== false) { $queue->ircJoin($this->channels[$index], ...
php
public function joinOnMatch($nickname, UserEventInterface $event, EventQueueInterface $queue) { if ($nickname == $event->getConnection()->getNickname() && ($index = array_search($event->getSource(), $this->channels)) !== false) { $queue->ircJoin($this->channels[$index], ...
[ "public", "function", "joinOnMatch", "(", "$", "nickname", ",", "UserEventInterface", "$", "event", ",", "EventQueueInterface", "$", "queue", ")", "{", "if", "(", "$", "nickname", "==", "$", "event", "->", "getConnection", "(", ")", "->", "getNickname", "(",...
Joins a channel if nickname and channel matches the own nickname and a channel in 'channels' configuration respectively. @param string $nickname @param \Phergie\Irc\Event\UserEventInterface $event @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
[ "Joins", "a", "channel", "if", "nickname", "and", "channel", "matches", "the", "own", "nickname", "and", "a", "channel", "in", "channels", "configuration", "respectively", "." ]
75b540ef8bf12b18efb653de538c76f0b40508dd
https://github.com/enebe-nb/phergie-irc-plugin-react-autorejoin/blob/75b540ef8bf12b18efb653de538c76f0b40508dd/src/Plugin.php#L87-L94
193,401
enebe-nb/phergie-irc-plugin-react-autorejoin
src/Plugin.php
Plugin.onPartChannels
public function onPartChannels(UserEventInterface $event, EventQueueInterface $queue) { $this->joinOnMatch($event->getNick(), $event, $queue); }
php
public function onPartChannels(UserEventInterface $event, EventQueueInterface $queue) { $this->joinOnMatch($event->getNick(), $event, $queue); }
[ "public", "function", "onPartChannels", "(", "UserEventInterface", "$", "event", ",", "EventQueueInterface", "$", "queue", ")", "{", "$", "this", "->", "joinOnMatch", "(", "$", "event", "->", "getNick", "(", ")", ",", "$", "event", ",", "$", "queue", ")", ...
Listen for part channel events. @param \Phergie\Irc\Event\UserEventInterface $event @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
[ "Listen", "for", "part", "channel", "events", "." ]
75b540ef8bf12b18efb653de538c76f0b40508dd
https://github.com/enebe-nb/phergie-irc-plugin-react-autorejoin/blob/75b540ef8bf12b18efb653de538c76f0b40508dd/src/Plugin.php#L102-L105
193,402
enebe-nb/phergie-irc-plugin-react-autorejoin
src/Plugin.php
Plugin.onKickChannels
public function onKickChannels(UserEventInterface $event, EventQueueInterface $queue) { $this->joinOnMatch($event->getParams()['user'], $event, $queue); }
php
public function onKickChannels(UserEventInterface $event, EventQueueInterface $queue) { $this->joinOnMatch($event->getParams()['user'], $event, $queue); }
[ "public", "function", "onKickChannels", "(", "UserEventInterface", "$", "event", ",", "EventQueueInterface", "$", "queue", ")", "{", "$", "this", "->", "joinOnMatch", "(", "$", "event", "->", "getParams", "(", ")", "[", "'user'", "]", ",", "$", "event", ",...
Listen for kick channel events. @param \Phergie\Irc\Event\UserEventInterface $event @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
[ "Listen", "for", "kick", "channel", "events", "." ]
75b540ef8bf12b18efb653de538c76f0b40508dd
https://github.com/enebe-nb/phergie-irc-plugin-react-autorejoin/blob/75b540ef8bf12b18efb653de538c76f0b40508dd/src/Plugin.php#L113-L116
193,403
SlabPHP/database
src/Providers/MySQL/Provider.php
Provider.query
public function query($queryString, $suggestedClass = NULL) { if (!empty($this->log)) { $this->log->debug("Performing SQL: " . $queryString . '...', 'DATABASE'); } $result = $this->mysqli->query($queryString); if (!empty($this->mysqli->error)) { throw new \S...
php
public function query($queryString, $suggestedClass = NULL) { if (!empty($this->log)) { $this->log->debug("Performing SQL: " . $queryString . '...', 'DATABASE'); } $result = $this->mysqli->query($queryString); if (!empty($this->mysqli->error)) { throw new \S...
[ "public", "function", "query", "(", "$", "queryString", ",", "$", "suggestedClass", "=", "NULL", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "log", ")", ")", "{", "$", "this", "->", "log", "->", "debug", "(", "\"Performing SQL: \"", "....
Perform a standard query @param string $queryString @param string $suggestedClass @throws \Slab\Database\Exceptions\Query @return \Slab\Database\Providers\BaseResponse
[ "Perform", "a", "standard", "query" ]
d77c38f2260429c6e054633eb0daf3f755c988a9
https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Providers/MySQL/Provider.php#L56-L94
193,404
SlabPHP/database
src/Providers/MySQL/Provider.php
Provider.buildInsertQuery
public function buildInsertQuery($table, $data) { $sql = "INSERT INTO " . $this->quoteSpecialName($table) . " "; if (!empty($data['ON DUPLICATE'])) { $onDuplicate = $data['ON DUPLICATE']; unset($data['ON DUPLICATE']); } $keys = $values = ''; foreach...
php
public function buildInsertQuery($table, $data) { $sql = "INSERT INTO " . $this->quoteSpecialName($table) . " "; if (!empty($data['ON DUPLICATE'])) { $onDuplicate = $data['ON DUPLICATE']; unset($data['ON DUPLICATE']); } $keys = $values = ''; foreach...
[ "public", "function", "buildInsertQuery", "(", "$", "table", ",", "$", "data", ")", "{", "$", "sql", "=", "\"INSERT INTO \"", ".", "$", "this", "->", "quoteSpecialName", "(", "$", "table", ")", ".", "\" \"", ";", "if", "(", "!", "empty", "(", "$", "d...
Perform an insert query @param string $table @param string[] $data @return integer|boolean
[ "Perform", "an", "insert", "query" ]
d77c38f2260429c6e054633eb0daf3f755c988a9
https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Providers/MySQL/Provider.php#L126-L157
193,405
SlabPHP/database
src/Providers/MySQL/Provider.php
Provider.quoteSpecialName
protected function quoteSpecialName($name) { //If user already back ticked, return the original string if ($name[0] == '`' && $name[mb_strlen($name) - 1] == '`') return $name; //Back tick string $name = '`' . $name . '`'; //Check if its a qualified table name, if so escape ...
php
protected function quoteSpecialName($name) { //If user already back ticked, return the original string if ($name[0] == '`' && $name[mb_strlen($name) - 1] == '`') return $name; //Back tick string $name = '`' . $name . '`'; //Check if its a qualified table name, if so escape ...
[ "protected", "function", "quoteSpecialName", "(", "$", "name", ")", "{", "//If user already back ticked, return the original string", "if", "(", "$", "name", "[", "0", "]", "==", "'`'", "&&", "$", "name", "[", "mb_strlen", "(", "$", "name", ")", "-", "1", "]...
MySQL style special naming backticks quotes @param string $name @return string
[ "MySQL", "style", "special", "naming", "backticks", "quotes" ]
d77c38f2260429c6e054633eb0daf3f755c988a9
https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Providers/MySQL/Provider.php#L181-L193
193,406
SlabPHP/database
src/Providers/MySQL/Provider.php
Provider.buildUpdateQuery
public function buildUpdateQuery($table, $data, $where, $limit) { $sql = "UPDATE " . $this->quoteSpecialName($table) . " SET "; $values = ''; foreach ($data as $key => $value) { if (!empty($values)) $values .= ', '; $values .= $this->quoteSpecialName($key) . ' = ' ....
php
public function buildUpdateQuery($table, $data, $where, $limit) { $sql = "UPDATE " . $this->quoteSpecialName($table) . " SET "; $values = ''; foreach ($data as $key => $value) { if (!empty($values)) $values .= ', '; $values .= $this->quoteSpecialName($key) . ' = ' ....
[ "public", "function", "buildUpdateQuery", "(", "$", "table", ",", "$", "data", ",", "$", "where", ",", "$", "limit", ")", "{", "$", "sql", "=", "\"UPDATE \"", ".", "$", "this", "->", "quoteSpecialName", "(", "$", "table", ")", ".", "\" SET \"", ";", ...
Update a table @param string $table @param array $data @param string $whereValue @param integer $limit @return string
[ "Update", "a", "table" ]
d77c38f2260429c6e054633eb0daf3f755c988a9
https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Providers/MySQL/Provider.php#L205-L225
193,407
SlabPHP/database
src/Providers/MySQL/Provider.php
Provider.wheel
public function wheel($table, $column, $value, $separator = '_', $maxTries = 10) { $tempValue = $value; for ($i = 2; $i <= $maxTries; ++$i) { $result = $this->query("select count(*) as cnt from " . $this->quoteSpecialName($table) . " where " . $this->quoteSpecialName($column) . " = '" ....
php
public function wheel($table, $column, $value, $separator = '_', $maxTries = 10) { $tempValue = $value; for ($i = 2; $i <= $maxTries; ++$i) { $result = $this->query("select count(*) as cnt from " . $this->quoteSpecialName($table) . " where " . $this->quoteSpecialName($column) . " = '" ....
[ "public", "function", "wheel", "(", "$", "table", ",", "$", "column", ",", "$", "value", ",", "$", "separator", "=", "'_'", ",", "$", "maxTries", "=", "10", ")", "{", "$", "tempValue", "=", "$", "value", ";", "for", "(", "$", "i", "=", "2", ";"...
"Wheel" a string value in the database @param $table @param $column @param $value @param string $separator @param int $maxTries @return string @throws \Slab\Database\Exceptions\Query
[ "Wheel", "a", "string", "value", "in", "the", "database" ]
d77c38f2260429c6e054633eb0daf3f755c988a9
https://github.com/SlabPHP/database/blob/d77c38f2260429c6e054633eb0daf3f755c988a9/src/Providers/MySQL/Provider.php#L291-L307
193,408
agentmedia/phine-core
src/Core/Logic/Config/SettingsProxy.php
SettingsProxy.CreateSettings
private function CreateSettings() { $this->settings = new Settings(); $this->settings->SetLogLifetime(90); $this->settings->SetChangeRequestLifetime(30); $this->settings->SetSmtpSecurity((string)Enums\SmtpSecurity::None()); $admin = $this->FirstAdmin(); if ($admin) ...
php
private function CreateSettings() { $this->settings = new Settings(); $this->settings->SetLogLifetime(90); $this->settings->SetChangeRequestLifetime(30); $this->settings->SetSmtpSecurity((string)Enums\SmtpSecurity::None()); $admin = $this->FirstAdmin(); if ($admin) ...
[ "private", "function", "CreateSettings", "(", ")", "{", "$", "this", "->", "settings", "=", "new", "Settings", "(", ")", ";", "$", "this", "->", "settings", "->", "SetLogLifetime", "(", "90", ")", ";", "$", "this", "->", "settings", "->", "SetChangeReque...
Creates the settings initally
[ "Creates", "the", "settings", "initally" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Config/SettingsProxy.php#L60-L76
193,409
agentmedia/phine-core
src/Core/Logic/Config/SettingsProxy.php
SettingsProxy.FirstAdmin
private function FirstAdmin() { $sql = Access::SqlBuilder(); $tblUser = User::Schema()->Table(); $where = $sql->Equals($tblUser->Field('IsAdmin'), $sql->Value(true)); $orderBy = $sql->OrderList($sql->OrderAsc($tblUser->Field('ID'))); return User::Schema()->First($where, $orde...
php
private function FirstAdmin() { $sql = Access::SqlBuilder(); $tblUser = User::Schema()->Table(); $where = $sql->Equals($tblUser->Field('IsAdmin'), $sql->Value(true)); $orderBy = $sql->OrderList($sql->OrderAsc($tblUser->Field('ID'))); return User::Schema()->First($where, $orde...
[ "private", "function", "FirstAdmin", "(", ")", "{", "$", "sql", "=", "Access", "::", "SqlBuilder", "(", ")", ";", "$", "tblUser", "=", "User", "::", "Schema", "(", ")", "->", "Table", "(", ")", ";", "$", "where", "=", "$", "sql", "->", "Equals", ...
Gets the first user that is an admin @return User The admin user, if present
[ "Gets", "the", "first", "user", "that", "is", "an", "admin" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Config/SettingsProxy.php#L82-L89
193,410
Innmind/Compose
src/ContainerBuilder/Cache.php
Cache.onChange
public static function onChange(PathInterface $cache, Loader $load = null): self { $self = new self($cache, $load); $self->debug = true; return $self; }
php
public static function onChange(PathInterface $cache, Loader $load = null): self { $self = new self($cache, $load); $self->debug = true; return $self; }
[ "public", "static", "function", "onChange", "(", "PathInterface", "$", "cache", ",", "Loader", "$", "load", "=", "null", ")", ":", "self", "{", "$", "self", "=", "new", "self", "(", "$", "cache", ",", "$", "load", ")", ";", "$", "self", "->", "debu...
The cached container will be recompiled if the definition file has changed since the last compilation
[ "The", "cached", "container", "will", "be", "recompiled", "if", "the", "definition", "file", "has", "changed", "since", "the", "last", "compilation" ]
1a833d7ba2f6248e9c472c00cd7aca041c1a2ba9
https://github.com/Innmind/Compose/blob/1a833d7ba2f6248e9c472c00cd7aca041c1a2ba9/src/ContainerBuilder/Cache.php#L39-L45
193,411
Sectorr/Core
Sectorr/Core/App.php
App.boot
public function boot() { session_start(); $this->registerWhoops(); $route = (empty($_REQUEST['_']) ? '/' : htmlspecialchars($_REQUEST['_'])); require_once(PATH . '/app/routes.php'); return Route::execute($route); }
php
public function boot() { session_start(); $this->registerWhoops(); $route = (empty($_REQUEST['_']) ? '/' : htmlspecialchars($_REQUEST['_'])); require_once(PATH . '/app/routes.php'); return Route::execute($route); }
[ "public", "function", "boot", "(", ")", "{", "session_start", "(", ")", ";", "$", "this", "->", "registerWhoops", "(", ")", ";", "$", "route", "=", "(", "empty", "(", "$", "_REQUEST", "[", "'_'", "]", ")", "?", "'/'", ":", "htmlspecialchars", "(", ...
Boot Sectorr application.
[ "Boot", "Sectorr", "application", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/App.php#L20-L30
193,412
Sectorr/Core
Sectorr/Core/App.php
App.registerWhoops
protected function registerWhoops() { $whoops = new \Whoops\Run; $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler); $whoops->register(); }
php
protected function registerWhoops() { $whoops = new \Whoops\Run; $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler); $whoops->register(); }
[ "protected", "function", "registerWhoops", "(", ")", "{", "$", "whoops", "=", "new", "\\", "Whoops", "\\", "Run", ";", "$", "whoops", "->", "pushHandler", "(", "new", "\\", "Whoops", "\\", "Handler", "\\", "PrettyPageHandler", ")", ";", "$", "whoops", "-...
Register Whoops error handler.
[ "Register", "Whoops", "error", "handler", "." ]
31df852dc6cc61642b0b87d9f0ae56c8e7da5a27
https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/App.php#L35-L40
193,413
staticka/staticka
src/Filter/HtmlMinifier.php
HtmlMinifier.childbearing
protected function childbearing(\DOMNode $node) { if ($node->hasChildNodes()) { foreach ($node->childNodes as $child) { if ($child->nodeType === XML_ELEMENT_NODE) { return true; } } } ...
php
protected function childbearing(\DOMNode $node) { if ($node->hasChildNodes()) { foreach ($node->childNodes as $child) { if ($child->nodeType === XML_ELEMENT_NODE) { return true; } } } ...
[ "protected", "function", "childbearing", "(", "\\", "DOMNode", "$", "node", ")", "{", "if", "(", "$", "node", "->", "hasChildNodes", "(", ")", ")", "{", "foreach", "(", "$", "node", "->", "childNodes", "as", "$", "child", ")", "{", "if", "(", "$", ...
Checks if a specified node has children. @param \DOMNode $node @return boolean
[ "Checks", "if", "a", "specified", "node", "has", "children", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Filter/HtmlMinifier.php#L52-L66
193,414
staticka/staticka
src/Filter/HtmlMinifier.php
HtmlMinifier.minify
protected function minify($html) { $html = str_replace('<?xml encoding="UTF-8">', '', $html); $html = trim(preg_replace('/\s+/', ' ', $html)); $html = str_replace('> <', '><', $html); return str_replace(array(' />', '/>'), '>', $html); }
php
protected function minify($html) { $html = str_replace('<?xml encoding="UTF-8">', '', $html); $html = trim(preg_replace('/\s+/', ' ', $html)); $html = str_replace('> <', '><', $html); return str_replace(array(' />', '/>'), '>', $html); }
[ "protected", "function", "minify", "(", "$", "html", ")", "{", "$", "html", "=", "str_replace", "(", "'<?xml encoding=\"UTF-8\">'", ",", "''", ",", "$", "html", ")", ";", "$", "html", "=", "trim", "(", "preg_replace", "(", "'/\\s+/'", ",", "' '", ",", ...
Minifies the specified HTML. @param string $html @return string
[ "Minifies", "the", "specified", "HTML", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Filter/HtmlMinifier.php#L74-L83
193,415
staticka/staticka
src/Filter/HtmlMinifier.php
HtmlMinifier.remove
protected function remove(\DOMNodeList $elements) { $encoded = array('textarea', 'code'); foreach ($elements as $element) { if ($this->childbearing($element)) { continue; } $output = (string) $element->nodeValue; ...
php
protected function remove(\DOMNodeList $elements) { $encoded = array('textarea', 'code'); foreach ($elements as $element) { if ($this->childbearing($element)) { continue; } $output = (string) $element->nodeValue; ...
[ "protected", "function", "remove", "(", "\\", "DOMNodeList", "$", "elements", ")", "{", "$", "encoded", "=", "array", "(", "'textarea'", ",", "'code'", ")", ";", "foreach", "(", "$", "elements", "as", "$", "element", ")", "{", "if", "(", "$", "this", ...
Removes the content of single elements. @param \DOMNodeList $elements @return void
[ "Removes", "the", "content", "of", "single", "elements", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Filter/HtmlMinifier.php#L91-L115
193,416
staticka/staticka
src/Filter/HtmlMinifier.php
HtmlMinifier.restore
protected function restore($html) { foreach ($this->data as $index => $item) { $key = (string) '$' . $index . '$'; $html = str_replace($key, $item, $html); } return (string) $html; }
php
protected function restore($html) { foreach ($this->data as $index => $item) { $key = (string) '$' . $index . '$'; $html = str_replace($key, $item, $html); } return (string) $html; }
[ "protected", "function", "restore", "(", "$", "html", ")", "{", "foreach", "(", "$", "this", "->", "data", "as", "$", "index", "=>", "$", "item", ")", "{", "$", "key", "=", "(", "string", ")", "'$'", ".", "$", "index", ".", "'$'", ";", "$", "ht...
Restores the data into the minified HTML. @param string $html @return string
[ "Restores", "the", "data", "into", "the", "minified", "HTML", "." ]
6e3b814c391ed03b0bd409803e11579bae677ce4
https://github.com/staticka/staticka/blob/6e3b814c391ed03b0bd409803e11579bae677ce4/src/Filter/HtmlMinifier.php#L123-L133
193,417
chalasr/RCHCapistranoBundle
Command/Deploy/RunCommand.php
RunCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $rootDir = $this->getRootDir(); $stagingName = $input->getOption('staging-name'); $stagingPath = $this->getCapistranoDir().'/deploy/'; $staging = sprintf('%s%s.rb', $stagingPath, $stagingName); $out...
php
protected function execute(InputInterface $input, OutputInterface $output) { $rootDir = $this->getRootDir(); $stagingName = $input->getOption('staging-name'); $stagingPath = $this->getCapistranoDir().'/deploy/'; $staging = sprintf('%s%s.rb', $stagingPath, $stagingName); $out...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "rootDir", "=", "$", "this", "->", "getRootDir", "(", ")", ";", "$", "stagingName", "=", "$", "input", "->", "getOption", "(", ...
Deploys application. @param InputInterface $input @param OutputInterface $output
[ "Deploys", "application", "." ]
c4a4cbaa2bc05f33bf431fd3afe6cac39947640e
https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Command/Deploy/RunCommand.php#L52-L96
193,418
ciims/ciims-modules-api
controllers/CardController.php
CardController.actionIndex
public function actionIndex() { // Fetch all the dashboard cards for the current user $cards = $this->loadDashboardCards(); $cardData = array(); // Find all the metadata for those cards and load them foreach ($cards->value as $id=>$url) { $metadata = $this->loadCardDetailsModel($id); ...
php
public function actionIndex() { // Fetch all the dashboard cards for the current user $cards = $this->loadDashboardCards(); $cardData = array(); // Find all the metadata for those cards and load them foreach ($cards->value as $id=>$url) { $metadata = $this->loadCardDetailsModel($id); ...
[ "public", "function", "actionIndex", "(", ")", "{", "// Fetch all the dashboard cards for the current user\r", "$", "cards", "=", "$", "this", "->", "loadDashboardCards", "(", ")", ";", "$", "cardData", "=", "array", "(", ")", ";", "// Find all the metadata for those ...
Retrieves all the dashboard cards for the current user
[ "Retrieves", "all", "the", "dashboard", "cards", "for", "the", "current", "user" ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/CardController.php#L22-L39
193,419
ciims/ciims-modules-api
controllers/CardController.php
CardController.actionIndexPost
public function actionIndexPost() { $cards = $this->loadDashboardCards(); $id = Cii::get($_POST, 'id', false); $url = Cii::get($_POST, 'url', false); $data = Cii::get($_POST, 'details', false); if ($id === false || $url === false || $data == false) throw new CHttpException(400, Yii::t('Api.ca...
php
public function actionIndexPost() { $cards = $this->loadDashboardCards(); $id = Cii::get($_POST, 'id', false); $url = Cii::get($_POST, 'url', false); $data = Cii::get($_POST, 'details', false); if ($id === false || $url === false || $data == false) throw new CHttpException(400, Yii::t('Api.ca...
[ "public", "function", "actionIndexPost", "(", ")", "{", "$", "cards", "=", "$", "this", "->", "loadDashboardCards", "(", ")", ";", "$", "id", "=", "Cii", "::", "get", "(", "$", "_POST", ",", "'id'", ",", "false", ")", ";", "$", "url", "=", "Cii", ...
Installs a new card to the dashboard cards, and adds the appropriate settings to the database @return boolean
[ "Installs", "a", "new", "card", "to", "the", "dashboard", "cards", "and", "adds", "the", "appropriate", "settings", "to", "the", "database" ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/CardController.php#L45-L74
193,420
ciims/ciims-modules-api
controllers/CardController.php
CardController.actionIndexDelete
public function actionIndexDelete($id=NULL) { $cards = $this->loadDashboardCards(); $value = $cards->value; if (array_key_exists($id, $value)) unset($value[$id]); $cards->value = CJSON::encode($value); if ($cards->save()) { $newCard = $this->loadCardDetailsModel($id); if ($newC...
php
public function actionIndexDelete($id=NULL) { $cards = $this->loadDashboardCards(); $value = $cards->value; if (array_key_exists($id, $value)) unset($value[$id]); $cards->value = CJSON::encode($value); if ($cards->save()) { $newCard = $this->loadCardDetailsModel($id); if ($newC...
[ "public", "function", "actionIndexDelete", "(", "$", "id", "=", "NULL", ")", "{", "$", "cards", "=", "$", "this", "->", "loadDashboardCards", "(", ")", ";", "$", "value", "=", "$", "cards", "->", "value", ";", "if", "(", "array_key_exists", "(", "$", ...
Deletes a card from the dashboard @param string $id The card ID @return boolean
[ "Deletes", "a", "card", "from", "the", "dashboard" ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/CardController.php#L81-L98
193,421
ciims/ciims-modules-api
controllers/CardController.php
CardController.loadDashboardCards
private function loadDashboardCards() { // Fetch all the dashboard cards for the current user $model = UserMetadata::model()->getPrototype('UserMetadata', array( 'user_id' => $this->user->id, 'key' => 'dashboard_cards' ), array('value' => '{}')); $model->value = ...
php
private function loadDashboardCards() { // Fetch all the dashboard cards for the current user $model = UserMetadata::model()->getPrototype('UserMetadata', array( 'user_id' => $this->user->id, 'key' => 'dashboard_cards' ), array('value' => '{}')); $model->value = ...
[ "private", "function", "loadDashboardCards", "(", ")", "{", "// Fetch all the dashboard cards for the current user\r", "$", "model", "=", "UserMetadata", "::", "model", "(", ")", "->", "getPrototype", "(", "'UserMetadata'", ",", "array", "(", "'user_id'", "=>", "$", ...
Loads all the dashboard cards, in order for this particular user @return UserMetadata
[ "Loads", "all", "the", "dashboard", "cards", "in", "order", "for", "this", "particular", "user" ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/CardController.php#L156-L167
193,422
ciims/ciims-modules-api
controllers/CardController.php
CardController.loadCardDetailsModel
private function loadCardDetailsModel($id=NULL) { if ($id == NULL) throw new CHttpException(400, Yii::t('Api.card', 'Missing card ID')); $model = UserMetadata::model()->getPrototype('UserMetadata', array( 'user_id' => $this->user->id, 'key' => $id.'_card_settings' ...
php
private function loadCardDetailsModel($id=NULL) { if ($id == NULL) throw new CHttpException(400, Yii::t('Api.card', 'Missing card ID')); $model = UserMetadata::model()->getPrototype('UserMetadata', array( 'user_id' => $this->user->id, 'key' => $id.'_card_settings' ...
[ "private", "function", "loadCardDetailsModel", "(", "$", "id", "=", "NULL", ")", "{", "if", "(", "$", "id", "==", "NULL", ")", "throw", "new", "CHttpException", "(", "400", ",", "Yii", "::", "t", "(", "'Api.card'", ",", "'Missing card ID'", ")", ")", "...
Returns a UserMetadata Object for a given card, containing the properties and settings for that card. @param string $id The card ID @return UserMetadata
[ "Returns", "a", "UserMetadata", "Object", "for", "a", "given", "card", "containing", "the", "properties", "and", "settings", "for", "that", "card", "." ]
4351855328da0b112ac27bde7e7e07e212be8689
https://github.com/ciims/ciims-modules-api/blob/4351855328da0b112ac27bde7e7e07e212be8689/controllers/CardController.php#L174-L187
193,423
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.setView
final public function setView(View $view) { $this->view = $view; $this->publicAssetsPath = ROOT . 'public' . DIRECTORY_SEPARATOR . '.assets' . DIRECTORY_SEPARATOR; return $this; }
php
final public function setView(View $view) { $this->view = $view; $this->publicAssetsPath = ROOT . 'public' . DIRECTORY_SEPARATOR . '.assets' . DIRECTORY_SEPARATOR; return $this; }
[ "final", "public", "function", "setView", "(", "View", "$", "view", ")", "{", "$", "this", "->", "view", "=", "$", "view", ";", "$", "this", "->", "publicAssetsPath", "=", "ROOT", ".", "'public'", ".", "DIRECTORY_SEPARATOR", ".", "'.assets'", ".", "DIREC...
Sets the view to render @param View $view @return Renderer
[ "Sets", "the", "view", "to", "render" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L42-L46
193,424
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.module
protected function module($check = null) { $module = Util::camelToHyphen($this->view->getModule()); return $check ? ($check == $module) : $module; }
php
protected function module($check = null) { $module = Util::camelToHyphen($this->view->getModule()); return $check ? ($check == $module) : $module; }
[ "protected", "function", "module", "(", "$", "check", "=", "null", ")", "{", "$", "module", "=", "Util", "::", "camelToHyphen", "(", "$", "this", "->", "view", "->", "getModule", "(", ")", ")", ";", "return", "$", "check", "?", "(", "$", "check", "...
Fetches the current module @param mixed $check Compare the module with this and return boolean if they are the same @return mixed
[ "Fetches", "the", "current", "module" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L62-L65
193,425
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.controller
protected function controller($check = null) { $controller = Util::camelToHyphen($this->view->getController()->getClassName()); return $check ? ($check == $controller) : $controller; }
php
protected function controller($check = null) { $controller = Util::camelToHyphen($this->view->getController()->getClassName()); return $check ? ($check == $controller) : $controller; }
[ "protected", "function", "controller", "(", "$", "check", "=", "null", ")", "{", "$", "controller", "=", "Util", "::", "camelToHyphen", "(", "$", "this", "->", "view", "->", "getController", "(", ")", "->", "getClassName", "(", ")", ")", ";", "return", ...
Fetches the current controller @param mixed $check Compare the controller with this and return boolean if they are the same @return mixed
[ "Fetches", "the", "current", "controller" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L73-L76
193,426
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.params
protected function params($check = null) { $params = $this->view->getParams(); if ($check) { if (is_array($check)) { $inter = array_intersect($check, $params); return (count($inter) === count($check)); } else { return in...
php
protected function params($check = null) { $params = $this->view->getParams(); if ($check) { if (is_array($check)) { $inter = array_intersect($check, $params); return (count($inter) === count($check)); } else { return in...
[ "protected", "function", "params", "(", "$", "check", "=", "null", ")", "{", "$", "params", "=", "$", "this", "->", "view", "->", "getParams", "(", ")", ";", "if", "(", "$", "check", ")", "{", "if", "(", "is_array", "(", "$", "check", ")", ")", ...
Fetches the parameters set to the current action @param mixed $check Compare the parameters with this and return boolean. If array, return TRUE if all values are in parameters. If not array, return TRUE if exists in parameters @return mixed
[ "Fetches", "the", "parameters", "set", "to", "the", "current", "action" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L96-L108
193,427
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.loadLayout
final public function loadLayout($layoutName, array $variables = array(), $fromTheme = false) { $dsLayout = $this->getLayoutPath($layoutName, $fromTheme); if (!$dsLayout) return ''; foreach ($variables as $var => $value) { $$var = $value; } include $dsLay...
php
final public function loadLayout($layoutName, array $variables = array(), $fromTheme = false) { $dsLayout = $this->getLayoutPath($layoutName, $fromTheme); if (!$dsLayout) return ''; foreach ($variables as $var => $value) { $$var = $value; } include $dsLay...
[ "final", "public", "function", "loadLayout", "(", "$", "layoutName", ",", "array", "$", "variables", "=", "array", "(", ")", ",", "$", "fromTheme", "=", "false", ")", "{", "$", "dsLayout", "=", "$", "this", "->", "getLayoutPath", "(", "$", "layoutName", ...
Loads a layout @param string $layoutName Without the extension @param array $variables Array of variables to pass into the layout [name => value] with "dsLayout" as an exemption of name @param boolean $fromTheme Indicates whether to get theme layouts or search through modules @return string
[ "Loads", "a", "layout" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L148-L157
193,428
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.getLayoutPath
private function getLayoutPath($layout = null, $fromTheme = false) { $layout = ($layout === null) ? $this->view->getController()->getLayout() : $layout; if (!$layout) return false; if (!$fromTheme && is_readable(MODULES . $this->view->getModule() . DIRECTORY_SEPARATOR . 'View' . ...
php
private function getLayoutPath($layout = null, $fromTheme = false) { $layout = ($layout === null) ? $this->view->getController()->getLayout() : $layout; if (!$layout) return false; if (!$fromTheme && is_readable(MODULES . $this->view->getModule() . DIRECTORY_SEPARATOR . 'View' . ...
[ "private", "function", "getLayoutPath", "(", "$", "layout", "=", "null", ",", "$", "fromTheme", "=", "false", ")", "{", "$", "layout", "=", "(", "$", "layout", "===", "null", ")", "?", "$", "this", "->", "view", "->", "getController", "(", ")", "->",...
Fetches the layout path @param string|null $layout @return boolean @throws Exception
[ "Fetches", "the", "layout", "path" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L165-L183
193,429
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.render
final public function render($content = null) { if ($content === null) { foreach ($this->view->getVariables() as $var => $val) { $$var = $val; } $viewFile = $this->view->getViewFile(); if (!is_readable(MODULES . $viewFile[0] . DIRECTORY_SEPARATOR ...
php
final public function render($content = null) { if ($content === null) { foreach ($this->view->getVariables() as $var => $val) { $$var = $val; } $viewFile = $this->view->getViewFile(); if (!is_readable(MODULES . $viewFile[0] . DIRECTORY_SEPARATOR ...
[ "final", "public", "function", "render", "(", "$", "content", "=", "null", ")", "{", "if", "(", "$", "content", "===", "null", ")", "{", "foreach", "(", "$", "this", "->", "view", "->", "getVariables", "(", ")", "as", "$", "var", "=>", "$", "val", ...
Renders the action content to the browser @param string $content The error message if any @throws Exception
[ "Renders", "the", "action", "content", "to", "the", "browser" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L198-L259
193,430
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.updateAssets
private function updateAssets($file) { $modulesAssets = MODULES . $this->view->getModule() . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR; $themeAssets = THEMES . engineGet('config', 'defaults', 'theme') . DIRECTORY_SEPARATOR . 'asse...
php
private function updateAssets($file) { $modulesAssets = MODULES . $this->view->getModule() . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR; $themeAssets = THEMES . engineGet('config', 'defaults', 'theme') . DIRECTORY_SEPARATOR . 'asse...
[ "private", "function", "updateAssets", "(", "$", "file", ")", "{", "$", "modulesAssets", "=", "MODULES", ".", "$", "this", "->", "view", "->", "getModule", "(", ")", ".", "DIRECTORY_SEPARATOR", ".", "'View'", ".", "DIRECTORY_SEPARATOR", ".", "'assets'", ".",...
updates the cached asset files @todo don't overwrite existing assets unless they are changed (both original && copied)
[ "updates", "the", "cached", "asset", "files" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L265-L300
193,431
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.getFile
private function getFile($file, $fromTheme) { $this->updateAssets($file); if (!$fromTheme && is_readable($this->publicAssetsPath . $this->view->getModule() . DIRECTORY_SEPARATOR . $file)) { return $this->parseFile($this->view->getModule() . DIRECTORY_SEPARATOR . $file); } el...
php
private function getFile($file, $fromTheme) { $this->updateAssets($file); if (!$fromTheme && is_readable($this->publicAssetsPath . $this->view->getModule() . DIRECTORY_SEPARATOR . $file)) { return $this->parseFile($this->view->getModule() . DIRECTORY_SEPARATOR . $file); } el...
[ "private", "function", "getFile", "(", "$", "file", ",", "$", "fromTheme", ")", "{", "$", "this", "->", "updateAssets", "(", "$", "file", ")", ";", "if", "(", "!", "$", "fromTheme", "&&", "is_readable", "(", "$", "this", "->", "publicAssetsPath", ".", ...
Fetches the path to file @param string $file @param boolean $fromTheme Indicates whether to get file from theme assets and not modules' assets @todo Look for a way to use files directly without copying them to the public folder to guide against script injections and what-have-yous @return string
[ "Fetches", "the", "path", "to", "file" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L319-L331
193,432
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.loadCss
final protected function loadCss($css, $fromTheme = false, $once = false) { if ($once && !$this->canLoadAsset($css, 'css')) return null; return '<link rel="stylesheet" type="text/css" href="' . $this->getFile($css . '.css', $fromTheme) . '" />' . "\n"; }
php
final protected function loadCss($css, $fromTheme = false, $once = false) { if ($once && !$this->canLoadAsset($css, 'css')) return null; return '<link rel="stylesheet" type="text/css" href="' . $this->getFile($css . '.css', $fromTheme) . '" />' . "\n"; }
[ "final", "protected", "function", "loadCss", "(", "$", "css", ",", "$", "fromTheme", "=", "false", ",", "$", "once", "=", "false", ")", "{", "if", "(", "$", "once", "&&", "!", "$", "this", "->", "canLoadAsset", "(", "$", "css", ",", "'css'", ")", ...
Loads a style sheet file @param string $css Filename without the extension with base as ./assets @param boolean $fromTheme Indicates whether to load the stylesheet from the theme or current module @param boolean $once Indicates whether to load the stylesheet only once @return string
[ "Loads", "a", "style", "sheet", "file" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L350-L354
193,433
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.loadJs
final protected function loadJs($src, $fromTheme = false, $once = false) { if ($once && !$this->canLoadAsset($src, 'js')) return null; return '<script type="text/javascript" src="' . $this->getFile($src . '.js', $fromTheme) . '"></script>' . "\n"; }
php
final protected function loadJs($src, $fromTheme = false, $once = false) { if ($once && !$this->canLoadAsset($src, 'js')) return null; return '<script type="text/javascript" src="' . $this->getFile($src . '.js', $fromTheme) . '"></script>' . "\n"; }
[ "final", "protected", "function", "loadJs", "(", "$", "src", ",", "$", "fromTheme", "=", "false", ",", "$", "once", "=", "false", ")", "{", "if", "(", "$", "once", "&&", "!", "$", "this", "->", "canLoadAsset", "(", "$", "src", ",", "'js'", ")", "...
Loads a javascript file @param string $src Filename without the extension with base as ./assets @param boolean $fromTheme Indicates whether to load the javascript from the theme or current module @param boolean $once Indicates whether to load the stylesheet only once @return string|null
[ "Loads", "a", "javascript", "file" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L363-L367
193,434
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.loadIcon
final protected function loadIcon($src, $fromTheme = false, $once = true) { if ($once && !$this->canLoadAsset($src, 'icon')) return null; return '<link rel="shortcut icon" href="' . $this->getFile($src, $fromTheme) . '"/>' . "\n"; }
php
final protected function loadIcon($src, $fromTheme = false, $once = true) { if ($once && !$this->canLoadAsset($src, 'icon')) return null; return '<link rel="shortcut icon" href="' . $this->getFile($src, $fromTheme) . '"/>' . "\n"; }
[ "final", "protected", "function", "loadIcon", "(", "$", "src", ",", "$", "fromTheme", "=", "false", ",", "$", "once", "=", "true", ")", "{", "if", "(", "$", "once", "&&", "!", "$", "this", "->", "canLoadAsset", "(", "$", "src", ",", "'icon'", ")", ...
Loads the icon for the page @param string $src Filename with extension and base as ./assets in theme or module @param boolean $fromTheme Indicates whether to load the icon from the theme or current module @param boolean $once Indicates whether to load the stylesheet only once @return string
[ "Loads", "the", "icon", "for", "the", "page" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L376-L380
193,435
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.canLoadAsset
final protected function canLoadAsset($file, $type) { $filename = basename($file); if (in_array($filename, $this->loadedAssets[$type])) return false; $this->loadedAssets[$type][] = $filename; return true; }
php
final protected function canLoadAsset($file, $type) { $filename = basename($file); if (in_array($filename, $this->loadedAssets[$type])) return false; $this->loadedAssets[$type][] = $filename; return true; }
[ "final", "protected", "function", "canLoadAsset", "(", "$", "file", ",", "$", "type", ")", "{", "$", "filename", "=", "basename", "(", "$", "file", ")", ";", "if", "(", "in_array", "(", "$", "filename", ",", "$", "this", "->", "loadedAssets", "[", "$...
Checks if the asset has not been loaded before @param string $file @param stirng $type css|js|icon|misc|update @return boolean
[ "Checks", "if", "the", "asset", "has", "not", "been", "loaded", "before" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L401-L408
193,436
ezra-obiwale/dSCore
src/View/Renderer.php
Renderer.url
final public function url($module, $controller = null, $action = null, array $params = array(), $hash = null) { return $this->view->url($module, $controller, $action, $params, $hash); }
php
final public function url($module, $controller = null, $action = null, array $params = array(), $hash = null) { return $this->view->url($module, $controller, $action, $params, $hash); }
[ "final", "public", "function", "url", "(", "$", "module", ",", "$", "controller", "=", "null", ",", "$", "action", "=", "null", ",", "array", "$", "params", "=", "array", "(", ")", ",", "$", "hash", "=", "null", ")", "{", "return", "$", "this", "...
Fetches the url path the a resource @param string|null $module @param string|null $controller @param string|null $action @param array $params @param string $hash @return string
[ "Fetches", "the", "url", "path", "the", "a", "resource" ]
dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d
https://github.com/ezra-obiwale/dSCore/blob/dd51246e0dc2c64d4d44de7992d7ff1b5165ab2d/src/View/Renderer.php#L429-L431
193,437
Nekland/BaseApi
lib/Nekland/BaseApi/Http/Request.php
Request.getId
public function getId() { return base64_encode($this->path . implode('', $this->parameters) . implode('', $this->body) . $this->method); }
php
public function getId() { return base64_encode($this->path . implode('', $this->parameters) . implode('', $this->body) . $this->method); }
[ "public", "function", "getId", "(", ")", "{", "return", "base64_encode", "(", "$", "this", "->", "path", ".", "implode", "(", "''", ",", "$", "this", "->", "parameters", ")", ".", "implode", "(", "''", ",", "$", "this", "->", "body", ")", ".", "$",...
Return an id unique for this request with identical parameters @return string
[ "Return", "an", "id", "unique", "for", "this", "request", "with", "identical", "parameters" ]
c96051b36d6982abf2a8b1f1ec16351bcae2455e
https://github.com/Nekland/BaseApi/blob/c96051b36d6982abf2a8b1f1ec16351bcae2455e/lib/Nekland/BaseApi/Http/Request.php#L234-L237
193,438
OxfordInfoLabs/kinikit-core
src/Exception/SerialisableException.php
SerialisableException.returnWebServiceSerialisableData
public function returnWebServiceSerialisableData(){ $serialisableMap = $this->__getSerialisablePropertyMap(); unset($serialisableMap["trace"]); unset($serialisableMap["file"]); unset($serialisableMap["line"]); unset($serialisableMap["traceAsString"]); unset($serialisabl...
php
public function returnWebServiceSerialisableData(){ $serialisableMap = $this->__getSerialisablePropertyMap(); unset($serialisableMap["trace"]); unset($serialisableMap["file"]); unset($serialisableMap["line"]); unset($serialisableMap["traceAsString"]); unset($serialisabl...
[ "public", "function", "returnWebServiceSerialisableData", "(", ")", "{", "$", "serialisableMap", "=", "$", "this", "->", "__getSerialisablePropertyMap", "(", ")", ";", "unset", "(", "$", "serialisableMap", "[", "\"trace\"", "]", ")", ";", "unset", "(", "$", "s...
Return web service serialisable data @return array
[ "Return", "web", "service", "serialisable", "data" ]
edc1b2e6ffabd595c4c7d322279b3dd1e59ef359
https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Exception/SerialisableException.php#L73-L88
193,439
black-lamp/yii2-multi-lang
MultiLangUrlManager.php
MultiLangUrlManager.redirectToLanguage
protected function redirectToLanguage($language) { $result = parent::parseRequest($this->_request); if ($result === false) { throw new NotFoundHttpException(Yii::t('yii', 'Page not found.')); } list ($route, $params) = $result; if($language){ $params[$...
php
protected function redirectToLanguage($language) { $result = parent::parseRequest($this->_request); if ($result === false) { throw new NotFoundHttpException(Yii::t('yii', 'Page not found.')); } list ($route, $params) = $result; if($language){ $params[$...
[ "protected", "function", "redirectToLanguage", "(", "$", "language", ")", "{", "$", "result", "=", "parent", "::", "parseRequest", "(", "$", "this", "->", "_request", ")", ";", "if", "(", "$", "result", "===", "false", ")", "{", "throw", "new", "NotFound...
Redirect to the current URL with given language code applied @param string $language the language code to add. Can also be empty to not add any language code.
[ "Redirect", "to", "the", "current", "URL", "with", "given", "language", "code", "applied" ]
764992aba56a723bb4782cf7ed5b3bdc0c65ef44
https://github.com/black-lamp/yii2-multi-lang/blob/764992aba56a723bb4782cf7ed5b3bdc0c65ef44/MultiLangUrlManager.php#L270-L296
193,440
Vectrex/vxPHP
src/User/RoleHierarchy.php
RoleHierarchy.getSubRoles
public function getSubRoles(Role $role) { $parentName = $role->getRoleName(); $subRoles = []; if(array_key_exists($role->getRoleName(), $this->mappedRoleNames)) { foreach($this->mappedRoleNames[$parentName] as $subRoleName) { $subRoles[] = new Role($subRoleName); } } return $subRole...
php
public function getSubRoles(Role $role) { $parentName = $role->getRoleName(); $subRoles = []; if(array_key_exists($role->getRoleName(), $this->mappedRoleNames)) { foreach($this->mappedRoleNames[$parentName] as $subRoleName) { $subRoles[] = new Role($subRoleName); } } return $subRole...
[ "public", "function", "getSubRoles", "(", "Role", "$", "role", ")", "{", "$", "parentName", "=", "$", "role", "->", "getRoleName", "(", ")", ";", "$", "subRoles", "=", "[", "]", ";", "if", "(", "array_key_exists", "(", "$", "role", "->", "getRoleName",...
get all possible sub roles of a role @param $role the parent role @return array
[ "get", "all", "possible", "sub", "roles", "of", "a", "role" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/User/RoleHierarchy.php#L64-L79
193,441
Vectrex/vxPHP
src/User/RoleHierarchy.php
RoleHierarchy.buildRoleMap
private function buildRoleMap() { $this->mappedRoleNames = []; foreach ($this->hierarchy as $parent => $roles) { $roles = array_map('strtolower', $roles); $this->mappedRoleNames[$parent] = $roles; $additionalRoles = $roles; $foundParent = []; // check for every role, whether there are other rol...
php
private function buildRoleMap() { $this->mappedRoleNames = []; foreach ($this->hierarchy as $parent => $roles) { $roles = array_map('strtolower', $roles); $this->mappedRoleNames[$parent] = $roles; $additionalRoles = $roles; $foundParent = []; // check for every role, whether there are other rol...
[ "private", "function", "buildRoleMap", "(", ")", "{", "$", "this", "->", "mappedRoleNames", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "hierarchy", "as", "$", "parent", "=>", "$", "roles", ")", "{", "$", "roles", "=", "array_map", "(", "'...
build the map which maps all sub-roles on any level to any of their parent roles @param array $hierarchy
[ "build", "the", "map", "which", "maps", "all", "sub", "-", "roles", "on", "any", "level", "to", "any", "of", "their", "parent", "roles" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/User/RoleHierarchy.php#L86-L125
193,442
Dhii/iterator-abstract
src/TrackingIteratorTrait.php
TrackingIteratorTrait._reset
protected function _reset() { $tracker = $this->_getTracker(); $this->_resetTracker($tracker); $iteration = $this->_createIterationFromTracker($tracker); return $iteration; }
php
protected function _reset() { $tracker = $this->_getTracker(); $this->_resetTracker($tracker); $iteration = $this->_createIterationFromTracker($tracker); return $iteration; }
[ "protected", "function", "_reset", "(", ")", "{", "$", "tracker", "=", "$", "this", "->", "_getTracker", "(", ")", ";", "$", "this", "->", "_resetTracker", "(", "$", "tracker", ")", ";", "$", "iteration", "=", "$", "this", "->", "_createIterationFromTrac...
Resets the loop and calculates the first iteration. @since [*next-version*] @throws RootException If problem resetting. @return IterationInterface The iteration that represents the new state.
[ "Resets", "the", "loop", "and", "calculates", "the", "first", "iteration", "." ]
576484183865575ffc2a0d586132741329626fb8
https://github.com/Dhii/iterator-abstract/blob/576484183865575ffc2a0d586132741329626fb8/src/TrackingIteratorTrait.php#L23-L30
193,443
Dhii/iterator-abstract
src/TrackingIteratorTrait.php
TrackingIteratorTrait._loop
protected function _loop() { $tracker = $this->_getTracker(); $this->_advanceTracker($tracker); $iteration = $this->_createIterationFromTracker($tracker); return $iteration; }
php
protected function _loop() { $tracker = $this->_getTracker(); $this->_advanceTracker($tracker); $iteration = $this->_createIterationFromTracker($tracker); return $iteration; }
[ "protected", "function", "_loop", "(", ")", "{", "$", "tracker", "=", "$", "this", "->", "_getTracker", "(", ")", ";", "$", "this", "->", "_advanceTracker", "(", "$", "tracker", ")", ";", "$", "iteration", "=", "$", "this", "->", "_createIterationFromTra...
Advances the loop and calculates the next iteration. @since [*next-version*] @throws RootException If problem looping. @return IterationInterface The iteration that represents the new state.
[ "Advances", "the", "loop", "and", "calculates", "the", "next", "iteration", "." ]
576484183865575ffc2a0d586132741329626fb8
https://github.com/Dhii/iterator-abstract/blob/576484183865575ffc2a0d586132741329626fb8/src/TrackingIteratorTrait.php#L41-L48
193,444
shgysk8zer0/core_api
traits/headers.php
Headers._readHeaders
final protected static function _readHeaders() { if (empty(static::$_request_headers)) { $headers = function_exists('getallheaders') ? getallheaders() : []; $keys = array_keys($headers); array_walk($keys, [__CLASS__, '_cleanHeader']); static::$_request_headers = array_combine($keys, array_values($headers...
php
final protected static function _readHeaders() { if (empty(static::$_request_headers)) { $headers = function_exists('getallheaders') ? getallheaders() : []; $keys = array_keys($headers); array_walk($keys, [__CLASS__, '_cleanHeader']); static::$_request_headers = array_combine($keys, array_values($headers...
[ "final", "protected", "static", "function", "_readHeaders", "(", ")", "{", "if", "(", "empty", "(", "static", "::", "$", "_request_headers", ")", ")", "{", "$", "headers", "=", "function_exists", "(", "'getallheaders'", ")", "?", "getallheaders", "(", ")", ...
Protected method to get the headers array, cleaned for usage with magic methods @param void @return array Headers array
[ "Protected", "method", "to", "get", "the", "headers", "array", "cleaned", "for", "usage", "with", "magic", "methods" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/headers.php#L36-L45
193,445
romm/configuration_object
Classes/ConfigurationObjectMapper.php
ConfigurationObjectMapper.doMapping
protected function doMapping($source, $targetType, PropertyMappingConfigurationInterface $configuration, &$currentPropertyPath) { if ($source === null) { return null; } $typeConverter = $this->getTypeConverter($source, $targetType, $configuration); $targetType = ltrim($t...
php
protected function doMapping($source, $targetType, PropertyMappingConfigurationInterface $configuration, &$currentPropertyPath) { if ($source === null) { return null; } $typeConverter = $this->getTypeConverter($source, $targetType, $configuration); $targetType = ltrim($t...
[ "protected", "function", "doMapping", "(", "$", "source", ",", "$", "targetType", ",", "PropertyMappingConfigurationInterface", "$", "configuration", ",", "&", "$", "currentPropertyPath", ")", "{", "if", "(", "$", "source", "===", "null", ")", "{", "return", "...
Will recursively fill all the properties of the configuration object. @inheritdoc
[ "Will", "recursively", "fill", "all", "the", "properties", "of", "the", "configuration", "object", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/ConfigurationObjectMapper.php#L107-L152
193,446
romm/configuration_object
Classes/ConfigurationObjectMapper.php
ConfigurationObjectMapper.convertChildProperties
protected function convertChildProperties(array $source, $targetType, TypeConverterInterface $typeConverter, PropertyMappingConfigurationInterface $configuration, array &$currentPropertyPath) { $convertedChildProperties = []; $properties = $source; // If the target is a class, we get its pr...
php
protected function convertChildProperties(array $source, $targetType, TypeConverterInterface $typeConverter, PropertyMappingConfigurationInterface $configuration, array &$currentPropertyPath) { $convertedChildProperties = []; $properties = $source; // If the target is a class, we get its pr...
[ "protected", "function", "convertChildProperties", "(", "array", "$", "source", ",", "$", "targetType", ",", "TypeConverterInterface", "$", "typeConverter", ",", "PropertyMappingConfigurationInterface", "$", "configuration", ",", "array", "&", "$", "currentPropertyPath", ...
Will convert all the properties of the given source, depending on the target type. @param array $source @param string $targetType @param TypeConverterInterface $typeConverter @param PropertyMappingConfigurationInterface $configuration @param...
[ "Will", "convert", "all", "the", "properties", "of", "the", "given", "source", "depending", "on", "the", "target", "type", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/ConfigurationObjectMapper.php#L165-L195
193,447
romm/configuration_object
Classes/ConfigurationObjectMapper.php
ConfigurationObjectMapper.handleDataPreProcessor
protected function handleDataPreProcessor($source, $targetType, $currentPropertyPath) { if ($this->serviceFactory->has(ServiceInterface::SERVICE_DATA_PRE_PROCESSOR)) { /** @var DataPreProcessorService $dataProcessorService */ $dataProcessorService = $this->serviceFactory->get(Service...
php
protected function handleDataPreProcessor($source, $targetType, $currentPropertyPath) { if ($this->serviceFactory->has(ServiceInterface::SERVICE_DATA_PRE_PROCESSOR)) { /** @var DataPreProcessorService $dataProcessorService */ $dataProcessorService = $this->serviceFactory->get(Service...
[ "protected", "function", "handleDataPreProcessor", "(", "$", "source", ",", "$", "targetType", ",", "$", "currentPropertyPath", ")", "{", "if", "(", "$", "this", "->", "serviceFactory", "->", "has", "(", "ServiceInterface", "::", "SERVICE_DATA_PRE_PROCESSOR", ")",...
Will check if the target type is a class, then call functions which will check the interfaces of the class. @param mixed $source @param mixed $targetType @param array $currentPropertyPath @return array
[ "Will", "check", "if", "the", "target", "type", "is", "a", "class", "then", "call", "functions", "which", "will", "check", "the", "interfaces", "of", "the", "class", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/ConfigurationObjectMapper.php#L260-L276
193,448
romm/configuration_object
Classes/ConfigurationObjectMapper.php
ConfigurationObjectMapper.getTypeConverter
protected function getTypeConverter($source, $targetType, $configuration) { $compositeType = $this->parseCompositeType($targetType); if (in_array($compositeType, ['\\ArrayObject', 'array'])) { $typeConverter = $this->objectManager->get(ArrayConverter::class); } else { ...
php
protected function getTypeConverter($source, $targetType, $configuration) { $compositeType = $this->parseCompositeType($targetType); if (in_array($compositeType, ['\\ArrayObject', 'array'])) { $typeConverter = $this->objectManager->get(ArrayConverter::class); } else { ...
[ "protected", "function", "getTypeConverter", "(", "$", "source", ",", "$", "targetType", ",", "$", "configuration", ")", "{", "$", "compositeType", "=", "$", "this", "->", "parseCompositeType", "(", "$", "targetType", ")", ";", "if", "(", "in_array", "(", ...
This function will fetch the type converter which will convert the source to the requested target type. @param mixed $source @param mixed $targetType @param mixed $configuration @return TypeConverterInterface @throws TypeConverterException
[ "This", "function", "will", "fetch", "the", "type", "converter", "which", "will", "convert", "the", "source", "to", "the", "requested", "target", "type", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/ConfigurationObjectMapper.php#L288-L309
193,449
romm/configuration_object
Classes/ConfigurationObjectMapper.php
ConfigurationObjectMapper.getProperties
protected function getProperties($targetType) { $properties = ReflectionService::get()->getClassReflection($targetType)->getProperties(); $propertiesKeys = array_map( function (PropertyReflection $propertyReflection) { return $propertyReflection->getName(); },...
php
protected function getProperties($targetType) { $properties = ReflectionService::get()->getClassReflection($targetType)->getProperties(); $propertiesKeys = array_map( function (PropertyReflection $propertyReflection) { return $propertyReflection->getName(); },...
[ "protected", "function", "getProperties", "(", "$", "targetType", ")", "{", "$", "properties", "=", "ReflectionService", "::", "get", "(", ")", "->", "getClassReflection", "(", "$", "targetType", ")", "->", "getProperties", "(", ")", ";", "$", "propertiesKeys"...
Internal function that fetches the properties of a class. @param $targetType @return array
[ "Internal", "function", "that", "fetches", "the", "properties", "of", "a", "class", "." ]
d3a40903386c2e0766bd8279337fe6da45cf5ce3
https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/ConfigurationObjectMapper.php#L330-L341
193,450
squareproton/Bond
src/Bond/EntityManager.php
EntityManager.register
public function register( $entityClass, $repositoryClass ) { $entityName = \Bond\get_unqualified_class($entityClass); if( isset($this->names[$entityName]) ) { throw new EntityAlreadyRegisteredException( $entityClass, $repositoryClass, $this ); } $this->names[$entityNam...
php
public function register( $entityClass, $repositoryClass ) { $entityName = \Bond\get_unqualified_class($entityClass); if( isset($this->names[$entityName]) ) { throw new EntityAlreadyRegisteredException( $entityClass, $repositoryClass, $this ); } $this->names[$entityNam...
[ "public", "function", "register", "(", "$", "entityClass", ",", "$", "repositoryClass", ")", "{", "$", "entityName", "=", "\\", "Bond", "\\", "get_unqualified_class", "(", "$", "entityClass", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "names", ...
Register a entity. @param String Fully qualified class name of Entity @param String Fully qualified class name of Repository
[ "Register", "a", "entity", "." ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/EntityManager.php#L91-L103
193,451
atk14/Files
src/files.php
Files.MkdirForFile
function MkdirForFile($filename,&$error = null,&$error_str = null){ $directory = preg_replace('/[^\/]+$/','',$filename); if(!strlen($directory)){ $error = true; $error_str = "can't determine directory name"; return; } return self::Mkdir($directory,$error,$error_str); }
php
function MkdirForFile($filename,&$error = null,&$error_str = null){ $directory = preg_replace('/[^\/]+$/','',$filename); if(!strlen($directory)){ $error = true; $error_str = "can't determine directory name"; return; } return self::Mkdir($directory,$error,$error_str); }
[ "function", "MkdirForFile", "(", "$", "filename", ",", "&", "$", "error", "=", "null", ",", "&", "$", "error_str", "=", "null", ")", "{", "$", "directory", "=", "preg_replace", "(", "'/[^\\/]+$/'", ",", "''", ",", "$", "filename", ")", ";", "if", "("...
Created a directory for the given filename. ``` Files::MkdirForFile("/path/to/a/file.dat"); ```
[ "Created", "a", "directory", "for", "the", "given", "filename", "." ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L92-L100
193,452
atk14/Files
src/files.php
Files.CopyFile
static function CopyFile($from_file,$to_file,&$error = null,&$error_str = null){ $bytes = 0; $error = false; $error_str = ""; settype($from_file,"string"); settype($to_file,"string"); $in = fopen($from_file,"r"); if(!$in){ $error = true; $error_str = "can't open input file for reading"; retur...
php
static function CopyFile($from_file,$to_file,&$error = null,&$error_str = null){ $bytes = 0; $error = false; $error_str = ""; settype($from_file,"string"); settype($to_file,"string"); $in = fopen($from_file,"r"); if(!$in){ $error = true; $error_str = "can't open input file for reading"; retur...
[ "static", "function", "CopyFile", "(", "$", "from_file", ",", "$", "to_file", ",", "&", "$", "error", "=", "null", ",", "&", "$", "error_str", "=", "null", ")", "{", "$", "bytes", "=", "0", ";", "$", "error", "=", "false", ";", "$", "error_str", ...
Creates a copy of a file. When the target file does not exist, it is created with permissions 0666. @param string $from_file Source file @param string $to_file Target file @param boolean &$error Error flag @param string &$error_str Error message @return int Number of copied bytes
[ "Creates", "a", "copy", "of", "a", "file", "." ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L114-L164
193,453
atk14/Files
src/files.php
Files.AppendToFile
static function AppendToFile($file,$content,&$error = null,&$error_str = null){ return Files::WriteToFile($file,$content,$error,$error_str,array("file_open_mode" => "a")); }
php
static function AppendToFile($file,$content,&$error = null,&$error_str = null){ return Files::WriteToFile($file,$content,$error,$error_str,array("file_open_mode" => "a")); }
[ "static", "function", "AppendToFile", "(", "$", "file", ",", "$", "content", ",", "&", "$", "error", "=", "null", ",", "&", "$", "error_str", "=", "null", ")", "{", "return", "Files", "::", "WriteToFile", "(", "$", "file", ",", "$", "content", ",", ...
Appends content to the given file. Opens a file in append mode and appends content to the end of it. @param string $file name of the file to append the $content to @param string $content @param boolean &$error flag indicating that something went wrong @param string &$error_str message describing the error @return int...
[ "Appends", "content", "to", "the", "given", "file", "." ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L246-L248
193,454
atk14/Files
src/files.php
Files.IsUploadedFile
static function IsUploadedFile($filename){ settype($filename,"string"); if(!file_exists($filename)){ return false; } if(is_dir($filename)){ return false; } if(!is_uploaded_file($filename)){ return false; } if(fileowner($filename)!=posix_getuid() && !fileowner($filename)){ return false; ...
php
static function IsUploadedFile($filename){ settype($filename,"string"); if(!file_exists($filename)){ return false; } if(is_dir($filename)){ return false; } if(!is_uploaded_file($filename)){ return false; } if(fileowner($filename)!=posix_getuid() && !fileowner($filename)){ return false; ...
[ "static", "function", "IsUploadedFile", "(", "$", "filename", ")", "{", "settype", "(", "$", "filename", ",", "\"string\"", ")", ";", "if", "(", "!", "file_exists", "(", "$", "filename", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_dir", ...
Checks if a file was uploaded via HTTP POST request. @param string $filename Name of a file @return bool true => file was securely uploaded; false => file was not uploaded @see is_uploaded_file
[ "Checks", "if", "a", "file", "was", "uploaded", "via", "HTTP", "POST", "request", "." ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L258-L278
193,455
atk14/Files
src/files.php
Files.MoveFile
static function MoveFile($from_file,$to_file,&$error = null,&$error_str = null){ $error = false; $error_str = ""; settype($from_file,"string"); settype($to_file,"string"); if(is_dir($to_file) && file_exists($from_file) && !is_dir($from_file)){ // copying a file to an existing directory preg_match('/([...
php
static function MoveFile($from_file,$to_file,&$error = null,&$error_str = null){ $error = false; $error_str = ""; settype($from_file,"string"); settype($to_file,"string"); if(is_dir($to_file) && file_exists($from_file) && !is_dir($from_file)){ // copying a file to an existing directory preg_match('/([...
[ "static", "function", "MoveFile", "(", "$", "from_file", ",", "$", "to_file", ",", "&", "$", "error", "=", "null", ",", "&", "$", "error_str", "=", "null", ")", "{", "$", "error", "=", "false", ";", "$", "error_str", "=", "\"\"", ";", "settype", "(...
Moves a file or a directory ``` Files::MoveFile("/path/to/file","/path/to/another/file",$error,$error_str); Files::MoveFile("/path/to/file","/path/to/directory/",$error,$error_str); Files::MoveFile("/path/to/directory/","/path/to/another/directory/",$error,$error_str); ``` @param string $from_file Source file @param ...
[ "Moves", "a", "file", "or", "a", "directory" ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L295-L327
193,456
atk14/Files
src/files.php
Files.Unlink
static function Unlink($file,&$error = null,&$error_str = null){ $error = false; $error_str = ""; if(!file_exists($file)){ return 0; } $stat = unlink($file); if(!$stat){ $error = true; $error_str = "cannot unlink $file"; return 0; } return 1; }
php
static function Unlink($file,&$error = null,&$error_str = null){ $error = false; $error_str = ""; if(!file_exists($file)){ return 0; } $stat = unlink($file); if(!$stat){ $error = true; $error_str = "cannot unlink $file"; return 0; } return 1; }
[ "static", "function", "Unlink", "(", "$", "file", ",", "&", "$", "error", "=", "null", ",", "&", "$", "error_str", "=", "null", ")", "{", "$", "error", "=", "false", ";", "$", "error_str", "=", "\"\"", ";", "if", "(", "!", "file_exists", "(", "$"...
Removes a file from filesystem. @param string $file Name of a file @param boolean &$error Error flag @param string &$error_str Error description @return int Number of deleted files; on success returns 1; otherwise 0
[ "Removes", "a", "file", "from", "filesystem", "." ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L337-L354
193,457
atk14/Files
src/files.php
Files._RecursiveUnlinkDir
static function _RecursiveUnlinkDir($dir,&$error,&$error_str){ settype($dir,"string"); $out = 0; if($error){ return $out; } if($dir==""){ return; } if($dir[strlen($dir)-1]=="/"){ $dir = preg_replace('/\/$/','',$dir); } if($dir==""){ return; } if(!file_exists($dir)){ return 0; } $...
php
static function _RecursiveUnlinkDir($dir,&$error,&$error_str){ settype($dir,"string"); $out = 0; if($error){ return $out; } if($dir==""){ return; } if($dir[strlen($dir)-1]=="/"){ $dir = preg_replace('/\/$/','',$dir); } if($dir==""){ return; } if(!file_exists($dir)){ return 0; } $...
[ "static", "function", "_RecursiveUnlinkDir", "(", "$", "dir", ",", "&", "$", "error", ",", "&", "$", "error_str", ")", "{", "settype", "(", "$", "dir", ",", "\"string\"", ")", ";", "$", "out", "=", "0", ";", "if", "(", "$", "error", ")", "{", "re...
Internal method making main part of RecursiveUnlinkDir call @param string $dir Directory name @param boolean &$error Error flag @param string &$error_str Error description @return int pocet smazanych souboru a adresaru @ignore @internal We should consider making this method private
[ "Internal", "method", "making", "main", "part", "of", "RecursiveUnlinkDir", "call" ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L384-L441
193,458
atk14/Files
src/files.php
Files.GetFileContent
static function GetFileContent($filename,&$error = null,&$error_str = null){ $error = false; $error_str = ""; $out = ""; settype($filename,"string"); if(!is_file($filename)){ $error = true; $error_str = "$filename is not a file"; return null; } $filesize = filesize($filename); if($files...
php
static function GetFileContent($filename,&$error = null,&$error_str = null){ $error = false; $error_str = ""; $out = ""; settype($filename,"string"); if(!is_file($filename)){ $error = true; $error_str = "$filename is not a file"; return null; } $filesize = filesize($filename); if($files...
[ "static", "function", "GetFileContent", "(", "$", "filename", ",", "&", "$", "error", "=", "null", ",", "&", "$", "error_str", "=", "null", ")", "{", "$", "error", "=", "false", ";", "$", "error_str", "=", "\"\"", ";", "$", "out", "=", "\"\"", ";",...
Reads content of a file. @param string $filename Name of a file @param boolean &$error Error flag @param string &$error_str Error description @return string Content of a file
[ "Reads", "content", "of", "a", "file", "." ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L451-L478
193,459
atk14/Files
src/files.php
Files.IsReadableAndWritable
static function IsReadableAndWritable($filename,&$error = null,&$error_str = null){ $error = false; $error_str = ""; settype($filename,"string"); if(!file_exists($filename)){ $error = true; $error_str = "file does't exist"; return 0; } $_UID_ = posix_getuid(); $_FILE_OWNER = fileowner($filenam...
php
static function IsReadableAndWritable($filename,&$error = null,&$error_str = null){ $error = false; $error_str = ""; settype($filename,"string"); if(!file_exists($filename)){ $error = true; $error_str = "file does't exist"; return 0; } $_UID_ = posix_getuid(); $_FILE_OWNER = fileowner($filenam...
[ "static", "function", "IsReadableAndWritable", "(", "$", "filename", ",", "&", "$", "error", "=", "null", ",", "&", "$", "error_str", "=", "null", ")", "{", "$", "error", "=", "false", ";", "$", "error_str", "=", "\"\"", ";", "settype", "(", "$", "fi...
Checks if a file is both readable and writable. @param string $filename Name of a file @param boolean &$error Error flag @param string &$error_str Error description @return int 1 - is readable and writable; 0 - is not
[ "Checks", "if", "a", "file", "is", "both", "readable", "and", "writable", "." ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L488-L510
193,460
atk14/Files
src/files.php
Files.GetImageSize
static function GetImageSize($image_content,&$error = null,&$error_str = null){ $temp = defined("TEMP") ? TEMP : "/tmp"; $filename = $temp."/get_image_filename_".posix_getpid(); if(!Files::WriteToFile($filename,$image_content,$error,$error_str)){ return null; } $out = getimagesize($filename); Files::Unlink($f...
php
static function GetImageSize($image_content,&$error = null,&$error_str = null){ $temp = defined("TEMP") ? TEMP : "/tmp"; $filename = $temp."/get_image_filename_".posix_getpid(); if(!Files::WriteToFile($filename,$image_content,$error,$error_str)){ return null; } $out = getimagesize($filename); Files::Unlink($f...
[ "static", "function", "GetImageSize", "(", "$", "image_content", ",", "&", "$", "error", "=", "null", ",", "&", "$", "error_str", "=", "null", ")", "{", "$", "temp", "=", "defined", "(", "\"TEMP\"", ")", "?", "TEMP", ":", "\"/tmp\"", ";", "$", "filen...
Determines width and height of an image in parameter. Example ``` list($width,$height) = Files::GetImageSize($image_content,$err,$err_str); ``` @param string $image_content Binary image data @param boolean $error Error flag @param string $error_str Error description @return array Image dimensions
[ "Determines", "width", "and", "height", "of", "an", "image", "in", "parameter", "." ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L526-L534
193,461
atk14/Files
src/files.php
Files.WriteToTemp
static function WriteToTemp($content, &$error = null, &$error_str = null){ $temp_filename = Files::GetTempFilename(); $out = Files::WriteToFile($temp_filename,$content,$error,$error_str); if(!$error){ return $temp_filename; } }
php
static function WriteToTemp($content, &$error = null, &$error_str = null){ $temp_filename = Files::GetTempFilename(); $out = Files::WriteToFile($temp_filename,$content,$error,$error_str); if(!$error){ return $temp_filename; } }
[ "static", "function", "WriteToTemp", "(", "$", "content", ",", "&", "$", "error", "=", "null", ",", "&", "$", "error_str", "=", "null", ")", "{", "$", "temp_filename", "=", "Files", "::", "GetTempFilename", "(", ")", ";", "$", "out", "=", "Files", ":...
Write a content to a temporary file. Example ``` $tmp_filename = Files::WriteToTemp($hot_content); ``` ... do some work with $tmp_filename ``` Files::Unlink($tmp_filename); ``` @param string $content content to write to the temporary file @param boolean &$error flag indicating a problem when calling this method @par...
[ "Write", "a", "content", "to", "a", "temporary", "file", "." ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L554-L561
193,462
atk14/Files
src/files.php
Files.GetTempDir
static function GetTempDir(){ $temp_dir = (defined("TEMP") && strlen("TEMP")) ? (string)TEMP : sys_get_temp_dir(); if(!strlen($temp_dir)){ $temp_dir = "/tmp"; } return $temp_dir; }
php
static function GetTempDir(){ $temp_dir = (defined("TEMP") && strlen("TEMP")) ? (string)TEMP : sys_get_temp_dir(); if(!strlen($temp_dir)){ $temp_dir = "/tmp"; } return $temp_dir; }
[ "static", "function", "GetTempDir", "(", ")", "{", "$", "temp_dir", "=", "(", "defined", "(", "\"TEMP\"", ")", "&&", "strlen", "(", "\"TEMP\"", ")", ")", "?", "(", "string", ")", "TEMP", ":", "sys_get_temp_dir", "(", ")", ";", "if", "(", "!", "strlen...
Returns the temporary directory ``` $tmp_dir = Files::GetTempDir(); // e.g. "/tmp" ``` It is NOT ensured whether returned is ending with "/" or not. @return string
[ "Returns", "the", "temporary", "directory" ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L574-L580
193,463
atk14/Files
src/files.php
Files.DetermineFileType
static function DetermineFileType($filename, $options = array(), &$preferred_suffix = null){ $options += array( "original_filename" => null, ); if(!file_exists($filename) || is_dir($filename)){ return null; } if(function_exists("mime_content_type")){ $mime_type = mime_content_type($filename); ...
php
static function DetermineFileType($filename, $options = array(), &$preferred_suffix = null){ $options += array( "original_filename" => null, ); if(!file_exists($filename) || is_dir($filename)){ return null; } if(function_exists("mime_content_type")){ $mime_type = mime_content_type($filename); ...
[ "static", "function", "DetermineFileType", "(", "$", "filename", ",", "$", "options", "=", "array", "(", ")", ",", "&", "$", "preferred_suffix", "=", "null", ")", "{", "$", "options", "+=", "array", "(", "\"original_filename\"", "=>", "null", ",", ")", "...
Determines the mime type of the file. !! Note that it actualy runs the shell command file. If it is unable to run the command, 'application/octet-string' is returned. $mime_type = Files::DetermineFileType($_FILES['userfile']['tmp_name'],array( "original_filename" => $_FILES['userfile']['name']) // like "strawber.jpeg...
[ "Determines", "the", "mime", "type", "of", "the", "file", "." ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L611-L676
193,464
atk14/Files
src/files.php
Files.FindFiles
static function FindFiles($directory,$options = array()){ $options += array( "pattern" => null, // '/^.*\.(log|err)$/' "invert_pattern" => null, // '/^\./' - do not find files starting with dot "min_mtime" => null, // time() - 2 * 60 * 60 "max_mtime" => null, // time() - 60 * 60 "maxdepth" => null // ...
php
static function FindFiles($directory,$options = array()){ $options += array( "pattern" => null, // '/^.*\.(log|err)$/' "invert_pattern" => null, // '/^\./' - do not find files starting with dot "min_mtime" => null, // time() - 2 * 60 * 60 "max_mtime" => null, // time() - 60 * 60 "maxdepth" => null // ...
[ "static", "function", "FindFiles", "(", "$", "directory", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "+=", "array", "(", "\"pattern\"", "=>", "null", ",", "// '/^.*\\.(log|err)$/'", "\"invert_pattern\"", "=>", "null", ",", "// '/^...
Find files in the given directory according to a regular pattern and other criteria TODO: Currently only regular files are being found just in the given directory $files = Files::FindFiles('./log/',array( 'pattern' => '/^.*\.(log|err)$/' )); // array('./log/application.log', './log/application.err') @return string[]
[ "Find", "files", "in", "the", "given", "directory", "according", "to", "a", "regular", "pattern", "and", "other", "criteria" ]
87b43a297fce92f294c8b0bac53958a58ed11687
https://github.com/atk14/Files/blob/87b43a297fce92f294c8b0bac53958a58ed11687/src/files.php#L690-L762
193,465
theopera/framework
src/Component/WebApplication/RouteEndpoint.php
RouteEndpoint.isCallable
public function isCallable() : bool { return is_callable( [ $this->namespace . $this->getController(true), $this->getAction(true) ] ); }
php
public function isCallable() : bool { return is_callable( [ $this->namespace . $this->getController(true), $this->getAction(true) ] ); }
[ "public", "function", "isCallable", "(", ")", ":", "bool", "{", "return", "is_callable", "(", "[", "$", "this", "->", "namespace", ".", "$", "this", "->", "getController", "(", "true", ")", ",", "$", "this", "->", "getAction", "(", "true", ")", "]", ...
Is this route callable? @return bool
[ "Is", "this", "route", "callable?" ]
fa6165d3891a310faa580c81dee49a63c150c711
https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/WebApplication/RouteEndpoint.php#L94-L102
193,466
PenoaksDev/Milky-Framework
src/Milky/Database/Query/JoinClause.php
JoinClause.orWhere
public function orWhere($first, $operator = null, $second = null) { return $this->on($first, $operator, $second, 'or', true); }
php
public function orWhere($first, $operator = null, $second = null) { return $this->on($first, $operator, $second, 'or', true); }
[ "public", "function", "orWhere", "(", "$", "first", ",", "$", "operator", "=", "null", ",", "$", "second", "=", "null", ")", "{", "return", "$", "this", "->", "on", "(", "$", "first", ",", "$", "operator", ",", "$", "second", ",", "'or'", ",", "t...
Add an "or on where" clause to the join. @param \Closure|string $first @param string|null $operator @param string|null $second @return JoinClause
[ "Add", "an", "or", "on", "where", "clause", "to", "the", "join", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Database/Query/JoinClause.php#L130-L133
193,467
railken/amethyst-authentication
src/Concerns/Auth/User.php
User.findForPassport
public function findForPassport($identifier) { return (new static())->newQuery()->orWhere(function ($q) use ($identifier) { return $q->orWhere('email', $identifier)->orWhere('name', $identifier); })->where('enabled', 1)->first(); }
php
public function findForPassport($identifier) { return (new static())->newQuery()->orWhere(function ($q) use ($identifier) { return $q->orWhere('email', $identifier)->orWhere('name', $identifier); })->where('enabled', 1)->first(); }
[ "public", "function", "findForPassport", "(", "$", "identifier", ")", "{", "return", "(", "new", "static", "(", ")", ")", "->", "newQuery", "(", ")", "->", "orWhere", "(", "function", "(", "$", "q", ")", "use", "(", "$", "identifier", ")", "{", "retu...
Retrieve user for passport oauth. @param string $identifier @return User
[ "Retrieve", "user", "for", "passport", "oauth", "." ]
59f28ddffa41a5f7fae4d5504eacf7c664e54b46
https://github.com/railken/amethyst-authentication/blob/59f28ddffa41a5f7fae4d5504eacf7c664e54b46/src/Concerns/Auth/User.php#L24-L29
193,468
BespokeSupport/Mime
src/FileMimesGenerator.php
FileMimesGenerator.fetch
public static function fetch($file) { $url = 'http://www.freeformatter.com/mime-types-list.html'; // no need to download again if csv present if (file_exists($file)) { return; } $filePointerCsv = fopen($file, 'wb'); $fileHtml = \dirname(__FILE__, 2) . '/...
php
public static function fetch($file) { $url = 'http://www.freeformatter.com/mime-types-list.html'; // no need to download again if csv present if (file_exists($file)) { return; } $filePointerCsv = fopen($file, 'wb'); $fileHtml = \dirname(__FILE__, 2) . '/...
[ "public", "static", "function", "fetch", "(", "$", "file", ")", "{", "$", "url", "=", "'http://www.freeformatter.com/mime-types-list.html'", ";", "// no need to download again if csv present", "if", "(", "file_exists", "(", "$", "file", ")", ")", "{", "return", ";",...
Convert HTML page to CSV then create Mime listings. @param $file
[ "Convert", "HTML", "page", "to", "CSV", "then", "create", "Mime", "listings", "." ]
2886bed1eaaa882edc08b096bd7ca9b39744c48f
https://github.com/BespokeSupport/Mime/blob/2886bed1eaaa882edc08b096bd7ca9b39744c48f/src/FileMimesGenerator.php#L46-L105
193,469
BespokeSupport/Mime
src/FileMimesGenerator.php
FileMimesGenerator.generate
public static function generate($file) { $filePointer = fopen($file, 'rb'); $names = ''; $extensions = ''; $header = true; while (($row = fgetcsv($filePointer))) { if ($header) { $header = false; continue; } ...
php
public static function generate($file) { $filePointer = fopen($file, 'rb'); $names = ''; $extensions = ''; $header = true; while (($row = fgetcsv($filePointer))) { if ($header) { $header = false; continue; } ...
[ "public", "static", "function", "generate", "(", "$", "file", ")", "{", "$", "filePointer", "=", "fopen", "(", "$", "file", ",", "'rb'", ")", ";", "$", "names", "=", "''", ";", "$", "extensions", "=", "''", ";", "$", "header", "=", "true", ";", "...
Generate FileMimes class. @param $file
[ "Generate", "FileMimes", "class", "." ]
2886bed1eaaa882edc08b096bd7ca9b39744c48f
https://github.com/BespokeSupport/Mime/blob/2886bed1eaaa882edc08b096bd7ca9b39744c48f/src/FileMimesGenerator.php#L112-L146
193,470
cogentParadigm/behat-starbug-extension
src/Context/StarbugContext.php
StarbugContext.createEntity
public function createEntity($entity, TableNode $fields) { $this->models->get($entity)->store($fields->getRowsHash()); }
php
public function createEntity($entity, TableNode $fields) { $this->models->get($entity)->store($fields->getRowsHash()); }
[ "public", "function", "createEntity", "(", "$", "entity", ",", "TableNode", "$", "fields", ")", "{", "$", "this", "->", "models", "->", "get", "(", "$", "entity", ")", "->", "store", "(", "$", "fields", "->", "getRowsHash", "(", ")", ")", ";", "}" ]
Creates an entity with specified fields @Given there is a/an :entity entity with:
[ "Creates", "an", "entity", "with", "specified", "fields" ]
76da5d943773857ad2388a7cccb6632176b452a9
https://github.com/cogentParadigm/behat-starbug-extension/blob/76da5d943773857ad2388a7cccb6632176b452a9/src/Context/StarbugContext.php#L129-L131
193,471
cogentParadigm/behat-starbug-extension
src/Context/StarbugContext.php
StarbugContext.applyFixtures
public function applyFixtures(TableNode $fixtures) { $fixtures = $fixtures->getColumn(0); $dataSet = new CompositeDataSet(); foreach ($fixtures as $fixture) { $dataSet->addDataSet($this->fixtures->createMySQLXMLDataSet($fixture)); } $this->fixtures->applyDataSet($dataSet); }
php
public function applyFixtures(TableNode $fixtures) { $fixtures = $fixtures->getColumn(0); $dataSet = new CompositeDataSet(); foreach ($fixtures as $fixture) { $dataSet->addDataSet($this->fixtures->createMySQLXMLDataSet($fixture)); } $this->fixtures->applyDataSet($dataSet); }
[ "public", "function", "applyFixtures", "(", "TableNode", "$", "fixtures", ")", "{", "$", "fixtures", "=", "$", "fixtures", "->", "getColumn", "(", "0", ")", ";", "$", "dataSet", "=", "new", "CompositeDataSet", "(", ")", ";", "foreach", "(", "$", "fixture...
Populates a fixture into the database. @Given I have the fixtures:
[ "Populates", "a", "fixture", "into", "the", "database", "." ]
76da5d943773857ad2388a7cccb6632176b452a9
https://github.com/cogentParadigm/behat-starbug-extension/blob/76da5d943773857ad2388a7cccb6632176b452a9/src/Context/StarbugContext.php#L147-L154
193,472
Raphhh/trex-parser
src/ClassAnalyzer.php
ClassAnalyzer.getClassReflections
public function getClassReflections($code) { $result = []; foreach ($this->getClassNames($code) as $className) { $result[$className] = new \ReflectionClass($className); } return $result; }
php
public function getClassReflections($code) { $result = []; foreach ($this->getClassNames($code) as $className) { $result[$className] = new \ReflectionClass($className); } return $result; }
[ "public", "function", "getClassReflections", "(", "$", "code", ")", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getClassNames", "(", "$", "code", ")", "as", "$", "className", ")", "{", "$", "result", "[", "$", "classNa...
returns the classes form an included code. @param string $code @return \ReflectionClass[]
[ "returns", "the", "classes", "form", "an", "included", "code", "." ]
32a10af443b10b1ac57baef0f593ad71e924b51b
https://github.com/Raphhh/trex-parser/blob/32a10af443b10b1ac57baef0f593ad71e924b51b/src/ClassAnalyzer.php#L31-L38
193,473
wb-crowdfusion/crowdfusion
system/core/classes/mvc/controllers/NodeCmsController.php
NodeCmsController.undelete
protected function undelete() { if($this->saveButtonPushed()) { $nodeRef = $this->buildCmsNodeRef(); $node = $nodeRef->generateNode(); $location = 'load'; $this->Events->trigger('NodeCmsController.undelete'.'.'.$location, ...
php
protected function undelete() { if($this->saveButtonPushed()) { $nodeRef = $this->buildCmsNodeRef(); $node = $nodeRef->generateNode(); $location = 'load'; $this->Events->trigger('NodeCmsController.undelete'.'.'.$location, ...
[ "protected", "function", "undelete", "(", ")", "{", "if", "(", "$", "this", "->", "saveButtonPushed", "(", ")", ")", "{", "$", "nodeRef", "=", "$", "this", "->", "buildCmsNodeRef", "(", ")", ";", "$", "node", "=", "$", "nodeRef", "->", "generateNode", ...
Provides 'undelete' functionality for Nodes @return View
[ "Provides", "undelete", "functionality", "for", "Nodes" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/controllers/NodeCmsController.php#L688-L734
193,474
wb-crowdfusion/crowdfusion
system/core/classes/mvc/controllers/NodeCmsController.php
NodeCmsController.single
protected function single() { // check permissions // $this->checkSinglePermission(); $nq = new NodeQuery(); $nq->setLimit(1); // $this->buildFilters($nq); $this->passthruTemplateVariable($nq, 'Elements.in'); $this->passthruTemplateVariable($nq, 'Sites.in');...
php
protected function single() { // check permissions // $this->checkSinglePermission(); $nq = new NodeQuery(); $nq->setLimit(1); // $this->buildFilters($nq); $this->passthruTemplateVariable($nq, 'Elements.in'); $this->passthruTemplateVariable($nq, 'Sites.in');...
[ "protected", "function", "single", "(", ")", "{", "// check permissions", "// $this->checkSinglePermission();", "$", "nq", "=", "new", "NodeQuery", "(", ")", ";", "$", "nq", "->", "setLimit", "(", "1", ")", ";", "// $this->buildFilters($nq);", "$", "this", ...
Datasource for returning a single Node @return DTO Contains the matching node (as an array) or is empty
[ "Datasource", "for", "returning", "a", "single", "Node" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/controllers/NodeCmsController.php#L747-L817
193,475
wb-crowdfusion/crowdfusion
system/core/classes/mvc/controllers/NodeCmsController.php
NodeCmsController.items
protected function items() { // check permissions // $siteIDs = $this->checkItemsPermission(); $dto = new NodeQuery(); $this->buildLimitOffset($dto); $this->passthruTemplateVariable($dto, 'Elements.in'); $this->passthruTemplateVariable($dto, 'Sites.in'); //$...
php
protected function items() { // check permissions // $siteIDs = $this->checkItemsPermission(); $dto = new NodeQuery(); $this->buildLimitOffset($dto); $this->passthruTemplateVariable($dto, 'Elements.in'); $this->passthruTemplateVariable($dto, 'Sites.in'); //$...
[ "protected", "function", "items", "(", ")", "{", "// check permissions", "// $siteIDs = $this->checkItemsPermission();", "$", "dto", "=", "new", "NodeQuery", "(", ")", ";", "$", "this", "->", "buildLimitOffset", "(", "$", "dto", ")", ";", "$", "this", "->", "p...
Datasource for returning all matching Nodes @return DTO contains all matching nodes (As array)
[ "Datasource", "for", "returning", "all", "matching", "Nodes" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/controllers/NodeCmsController.php#L824-L891
193,476
wb-crowdfusion/crowdfusion
system/core/classes/mvc/controllers/NodeCmsController.php
NodeCmsController.buildCmsNodeRef
protected function buildCmsNodeRef($slugKey = 'OriginalSlug') { if (empty($this->params['Element'])) throw new Exception('Element parameter is required'); $nodeElement = $this->ElementService->getBySlug($this->params['Element']); if (!is_null($slugKey) && $this->Request->getPar...
php
protected function buildCmsNodeRef($slugKey = 'OriginalSlug') { if (empty($this->params['Element'])) throw new Exception('Element parameter is required'); $nodeElement = $this->ElementService->getBySlug($this->params['Element']); if (!is_null($slugKey) && $this->Request->getPar...
[ "protected", "function", "buildCmsNodeRef", "(", "$", "slugKey", "=", "'OriginalSlug'", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "params", "[", "'Element'", "]", ")", ")", "throw", "new", "Exception", "(", "'Element parameter is required'", ")", ...
Given a slug, builds a nodeRef @param string $slugKey The slug to use @return NodeRef
[ "Given", "a", "slug", "builds", "a", "nodeRef" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/mvc/controllers/NodeCmsController.php#L908-L925
193,477
lasallecms/lasallecms-l5-lasallecmsapi-pkg
src/Models/Post.php
Post.date
public function date($date=null) { if(is_null($date)) { $date = $this->created_at; } return String::date($date); }
php
public function date($date=null) { if(is_null($date)) { $date = $this->created_at; } return String::date($date); }
[ "public", "function", "date", "(", "$", "date", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "date", ")", ")", "{", "$", "date", "=", "$", "this", "->", "created_at", ";", "}", "return", "String", "::", "date", "(", "$", "date", ")", ...
Get the date the post was created. @param \Carbon|null $date @return string
[ "Get", "the", "date", "the", "post", "was", "created", "." ]
05083be19645d52be86d8ba4f322773db348a11d
https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/Models/Post.php#L619-L625
193,478
squareproton/Bond
src/Bond/Normality/Notify.php
Notify.parse
public function parse( QuoteInterface $quoting ) { $outputSql = ""; foreach( $this->relations as $relation ) { $columns = array(); foreach( $relation->getPrimaryKeys() as $column ) { $columns[$column->get('name')] = $column->getType()->getTypeQuery(); ...
php
public function parse( QuoteInterface $quoting ) { $outputSql = ""; foreach( $this->relations as $relation ) { $columns = array(); foreach( $relation->getPrimaryKeys() as $column ) { $columns[$column->get('name')] = $column->getType()->getTypeQuery(); ...
[ "public", "function", "parse", "(", "QuoteInterface", "$", "quoting", ")", "{", "$", "outputSql", "=", "\"\"", ";", "foreach", "(", "$", "this", "->", "relations", "as", "$", "relation", ")", "{", "$", "columns", "=", "array", "(", ")", ";", "foreach",...
Generate and execute sql which will attach notification triggers to relations @inheritDoc
[ "Generate", "and", "execute", "sql", "which", "will", "attach", "notification", "triggers", "to", "relations" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Notify.php#L78-L110
193,479
squareproton/Bond
src/Bond/Normality/Notify.php
Notify.donovan
public function donovan( QuoteInterface $quoting, $prefix, $columns ) { $sql = array(); foreach( $columns as $column => $type ) { $sql[] = sprintf( 'donovan(%s%s)', $prefix, $quoting->quoteIdent( $column ) ); } r...
php
public function donovan( QuoteInterface $quoting, $prefix, $columns ) { $sql = array(); foreach( $columns as $column => $type ) { $sql[] = sprintf( 'donovan(%s%s)', $prefix, $quoting->quoteIdent( $column ) ); } r...
[ "public", "function", "donovan", "(", "QuoteInterface", "$", "quoting", ",", "$", "prefix", ",", "$", "columns", ")", "{", "$", "sql", "=", "array", "(", ")", ";", "foreach", "(", "$", "columns", "as", "$", "column", "=>", "$", "type", ")", "{", "$...
Produce a sql statement which resolves to a string but is a valid json @return string Sql which evaluates to JSON
[ "Produce", "a", "sql", "statement", "which", "resolves", "to", "a", "string", "but", "is", "a", "valid", "json" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Notify.php#L217-L231
193,480
squareproton/Bond
src/Bond/Normality/Notify.php
Notify.catalogRefresh
private function catalogRefresh() { Relation::r()->preload(); Attribute::r()->preload(); Type::r()->preload(); Index::r()->preload(); }
php
private function catalogRefresh() { Relation::r()->preload(); Attribute::r()->preload(); Type::r()->preload(); Index::r()->preload(); }
[ "private", "function", "catalogRefresh", "(", ")", "{", "Relation", "::", "r", "(", ")", "->", "preload", "(", ")", ";", "Attribute", "::", "r", "(", ")", "->", "preload", "(", ")", ";", "Type", "::", "r", "(", ")", "->", "preload", "(", ")", ";"...
Refresh the catalog
[ "Refresh", "the", "catalog" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Notify.php#L236-L242
193,481
AnonymPHP/Anonym-Route
Controller.php
Controller.validate
public function validate(Request $request, array $rules = [], array $filters = []) { $all = $request->all(); return $request->getValidation()->make($all, $rules, $filters); }
php
public function validate(Request $request, array $rules = [], array $filters = []) { $all = $request->all(); return $request->getValidation()->make($all, $rules, $filters); }
[ "public", "function", "validate", "(", "Request", "$", "request", ",", "array", "$", "rules", "=", "[", "]", ",", "array", "$", "filters", "=", "[", "]", ")", "{", "$", "all", "=", "$", "request", "->", "all", "(", ")", ";", "return", "$", "reque...
validate the form @param Request $request @param array $rules @param array $filters
[ "validate", "the", "form" ]
bb7f8004fbbd2998af8b0061f404f026f11466ab
https://github.com/AnonymPHP/Anonym-Route/blob/bb7f8004fbbd2998af8b0061f404f026f11466ab/Controller.php#L62-L67
193,482
wb-crowdfusion/crowdfusion
system/core/classes/libraries/encryption/Encryption.php
Encryption.encrypt
public function encrypt($value, $iv = null) { if(empty($value)) return false; include_once PATH_SYSTEM . '/vendors/phpseclib0/Crypt/Rijndael.php'; include_once PATH_SYSTEM . '/vendors/phpseclib0/Crypt/AES.php'; $this->Crypt = new Crypt_AES(); $this->Cryp...
php
public function encrypt($value, $iv = null) { if(empty($value)) return false; include_once PATH_SYSTEM . '/vendors/phpseclib0/Crypt/Rijndael.php'; include_once PATH_SYSTEM . '/vendors/phpseclib0/Crypt/AES.php'; $this->Crypt = new Crypt_AES(); $this->Cryp...
[ "public", "function", "encrypt", "(", "$", "value", ",", "$", "iv", "=", "null", ")", "{", "if", "(", "empty", "(", "$", "value", ")", ")", "return", "false", ";", "include_once", "PATH_SYSTEM", ".", "'/vendors/phpseclib0/Crypt/Rijndael.php'", ";", "include_...
Encrypts the given value using the included phpseclib AES implementation @param string $value The value to encrypt @param string $iv (optional) the initialization vector @return string the encrypted version of $value
[ "Encrypts", "the", "given", "value", "using", "the", "included", "phpseclib", "AES", "implementation" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/encryption/Encryption.php#L130-L143
193,483
wb-crowdfusion/crowdfusion
system/core/classes/libraries/encryption/Encryption.php
Encryption.decryptSecureCookie
public function decryptSecureCookie($value) { $cookieValues = explode('|', $value, 4); if ((count($cookieValues) === 4) && ($cookieValues[1] == 0 || $cookieValues[1] >= time())) { $userid = $cookieValues[0]; $expire = $cookieValues[1]; $encrValue = $cookieValues[2...
php
public function decryptSecureCookie($value) { $cookieValues = explode('|', $value, 4); if ((count($cookieValues) === 4) && ($cookieValues[1] == 0 || $cookieValues[1] >= time())) { $userid = $cookieValues[0]; $expire = $cookieValues[1]; $encrValue = $cookieValues[2...
[ "public", "function", "decryptSecureCookie", "(", "$", "value", ")", "{", "$", "cookieValues", "=", "explode", "(", "'|'", ",", "$", "value", ",", "4", ")", ";", "if", "(", "(", "count", "(", "$", "cookieValues", ")", "===", "4", ")", "&&", "(", "$...
Retrieve a secured cookie value @param string $value The secured value @return string the value stored in the secured cookie or false if unsuccessful
[ "Retrieve", "a", "secured", "cookie", "value" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/encryption/Encryption.php#L152-L172
193,484
wb-crowdfusion/crowdfusion
system/core/classes/libraries/encryption/Encryption.php
Encryption.encryptSecureCookie
public function encryptSecureCookie($value, $expire, $userid = null) { $expire = (strcmp(strtolower($expire), 'never') === 0 ? time() + 60 * 60 * 24 * 6000 : $expire); if (is_null($userid)) $userid = (string)$this->RequestContext->getUserRef(); $key = hash_hmac('sha1', $userid....
php
public function encryptSecureCookie($value, $expire, $userid = null) { $expire = (strcmp(strtolower($expire), 'never') === 0 ? time() + 60 * 60 * 24 * 6000 : $expire); if (is_null($userid)) $userid = (string)$this->RequestContext->getUserRef(); $key = hash_hmac('sha1', $userid....
[ "public", "function", "encryptSecureCookie", "(", "$", "value", ",", "$", "expire", ",", "$", "userid", "=", "null", ")", "{", "$", "expire", "=", "(", "strcmp", "(", "strtolower", "(", "$", "expire", ")", ",", "'never'", ")", "===", "0", "?", "time"...
Secure a cookie value The initial value is transformed with this protocol : secureValue = username|expire|base64((value)k,expire)|HMAC(user|expire|value,k) where k = HMAC(user|expire, sk) and sk is server's secret key (value)k,md5(expire) is the result an cryptographic function (ex: AES256) on "value" with key k and ...
[ "Secure", "a", "cookie", "value" ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/encryption/Encryption.php#L190-L207
193,485
jenskooij/cloudcontrol
src/components/cms/CmsRouting.php
CmsRouting.doRouting
abstract public function __construct(Request $request, $relativeCmsUri, CmsComponent $cmsComponent); /** * @param Request $request * @param string $relativeCmsUri * @param CmsComponent $cmsComponent * @throws \Exception */ protected function doRouting($request, $relativeCmsUri, $cmsCom...
php
abstract public function __construct(Request $request, $relativeCmsUri, CmsComponent $cmsComponent); /** * @param Request $request * @param string $relativeCmsUri * @param CmsComponent $cmsComponent * @throws \Exception */ protected function doRouting($request, $relativeCmsUri, $cmsCom...
[ "abstract", "public", "function", "__construct", "(", "Request", "$", "request", ",", "$", "relativeCmsUri", ",", "CmsComponent", "$", "cmsComponent", ")", ";", "/**\n * @param Request $request\n * @param string $relativeCmsUri\n * @param CmsComponent $cmsComponent\n ...
CmsRouting constructor. @param Request $request @param string $relativeCmsUri @param CmsComponent $cmsComponent
[ "CmsRouting", "constructor", "." ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/components/cms/CmsRouting.php#L34-L40
193,486
ebidtech/ebt-validator
src/EBT/Validator/Model/Validator/Validator.php
Validator.isRequiredIntegerRange
public static function isRequiredIntegerRange($value, $min, $max) { return is_int($value) && $min <= $value && $max >= $value; }
php
public static function isRequiredIntegerRange($value, $min, $max) { return is_int($value) && $min <= $value && $max >= $value; }
[ "public", "static", "function", "isRequiredIntegerRange", "(", "$", "value", ",", "$", "min", ",", "$", "max", ")", "{", "return", "is_int", "(", "$", "value", ")", "&&", "$", "min", "<=", "$", "value", "&&", "$", "max", ">=", "$", "value", ";", "}...
Required value is integer in range. @param mixed $value Value. @param int $min Lower limit. @param int $max Upper limit. @return bool
[ "Required", "value", "is", "integer", "in", "range", "." ]
4f826ee3298f87eb19a8d5b2c7f998da351e5104
https://github.com/ebidtech/ebt-validator/blob/4f826ee3298f87eb19a8d5b2c7f998da351e5104/src/EBT/Validator/Model/Validator/Validator.php#L65-L68
193,487
ebidtech/ebt-validator
src/EBT/Validator/Model/Validator/Validator.php
Validator.isOptionalIntegerRange
public static function isOptionalIntegerRange($value, $min, $max) { /* No additional validations when the value is null. */ if (null === $value) { return true; } return self::isRequiredIntegerRange($value, $min, $max); }
php
public static function isOptionalIntegerRange($value, $min, $max) { /* No additional validations when the value is null. */ if (null === $value) { return true; } return self::isRequiredIntegerRange($value, $min, $max); }
[ "public", "static", "function", "isOptionalIntegerRange", "(", "$", "value", ",", "$", "min", ",", "$", "max", ")", "{", "/* No additional validations when the value is null. */", "if", "(", "null", "===", "$", "value", ")", "{", "return", "true", ";", "}", "r...
Optional value is integer in range. @param mixed $value Value. @param int $min Lower limit. @param int $max Upper limit. @return bool
[ "Optional", "value", "is", "integer", "in", "range", "." ]
4f826ee3298f87eb19a8d5b2c7f998da351e5104
https://github.com/ebidtech/ebt-validator/blob/4f826ee3298f87eb19a8d5b2c7f998da351e5104/src/EBT/Validator/Model/Validator/Validator.php#L133-L142
193,488
ebidtech/ebt-validator
src/EBT/Validator/Model/Validator/Validator.php
Validator.isRequiredFloatRange
public static function isRequiredFloatRange($value, $min, $max) { return is_float($value) && $min <= $value && $max >= $value; }
php
public static function isRequiredFloatRange($value, $min, $max) { return is_float($value) && $min <= $value && $max >= $value; }
[ "public", "static", "function", "isRequiredFloatRange", "(", "$", "value", ",", "$", "min", ",", "$", "max", ")", "{", "return", "is_float", "(", "$", "value", ")", "&&", "$", "min", "<=", "$", "value", "&&", "$", "max", ">=", "$", "value", ";", "}...
Required value is float in range. @param mixed $value Value. @param int $min Lower limit. @param int $max Upper limit. @return bool
[ "Required", "value", "is", "float", "in", "range", "." ]
4f826ee3298f87eb19a8d5b2c7f998da351e5104
https://github.com/ebidtech/ebt-validator/blob/4f826ee3298f87eb19a8d5b2c7f998da351e5104/src/EBT/Validator/Model/Validator/Validator.php#L193-L196
193,489
ebidtech/ebt-validator
src/EBT/Validator/Model/Validator/Validator.php
Validator.isOptionalFloatRange
public static function isOptionalFloatRange($value, $min, $max) { /* No additional validations when the value is null. */ if (null === $value) { return true; } return self::isRequiredFloatRange($value, $min, $max); }
php
public static function isOptionalFloatRange($value, $min, $max) { /* No additional validations when the value is null. */ if (null === $value) { return true; } return self::isRequiredFloatRange($value, $min, $max); }
[ "public", "static", "function", "isOptionalFloatRange", "(", "$", "value", ",", "$", "min", ",", "$", "max", ")", "{", "/* No additional validations when the value is null. */", "if", "(", "null", "===", "$", "value", ")", "{", "return", "true", ";", "}", "ret...
Optional value is float in range. @param mixed $value Value. @param int $min Lower limit. @param int $max Upper limit. @return bool
[ "Optional", "value", "is", "float", "in", "range", "." ]
4f826ee3298f87eb19a8d5b2c7f998da351e5104
https://github.com/ebidtech/ebt-validator/blob/4f826ee3298f87eb19a8d5b2c7f998da351e5104/src/EBT/Validator/Model/Validator/Validator.php#L261-L270
193,490
ebidtech/ebt-validator
src/EBT/Validator/Model/Validator/Validator.php
Validator.isOptionalNumberRange
public static function isOptionalNumberRange($value, $min, $max) { /* No additional validations when the value is null. */ if (null === $value) { return true; } return self::isRequiredNumberRange($value, $min, $max); }
php
public static function isOptionalNumberRange($value, $min, $max) { /* No additional validations when the value is null. */ if (null === $value) { return true; } return self::isRequiredNumberRange($value, $min, $max); }
[ "public", "static", "function", "isOptionalNumberRange", "(", "$", "value", ",", "$", "min", ",", "$", "max", ")", "{", "/* No additional validations when the value is null. */", "if", "(", "null", "===", "$", "value", ")", "{", "return", "true", ";", "}", "re...
Optional value is number in range. @param mixed $value Value. @param int $min Lower limit. @param int $max Upper limit. @return bool
[ "Optional", "value", "is", "number", "in", "range", "." ]
4f826ee3298f87eb19a8d5b2c7f998da351e5104
https://github.com/ebidtech/ebt-validator/blob/4f826ee3298f87eb19a8d5b2c7f998da351e5104/src/EBT/Validator/Model/Validator/Validator.php#L389-L398
193,491
ebidtech/ebt-validator
src/EBT/Validator/Model/Validator/Validator.php
Validator.isRequiredNumericRange
public static function isRequiredNumericRange($value, $min, $max) { return is_numeric($value) && $min <= $value && $max >= $value; }
php
public static function isRequiredNumericRange($value, $min, $max) { return is_numeric($value) && $min <= $value && $max >= $value; }
[ "public", "static", "function", "isRequiredNumericRange", "(", "$", "value", ",", "$", "min", ",", "$", "max", ")", "{", "return", "is_numeric", "(", "$", "value", ")", "&&", "$", "min", "<=", "$", "value", "&&", "$", "max", ">=", "$", "value", ";", ...
Required value is numeric in range. @param mixed $value Value. @param int $min Lower limit. @param int $max Upper limit. @return bool
[ "Required", "value", "is", "numeric", "in", "range", "." ]
4f826ee3298f87eb19a8d5b2c7f998da351e5104
https://github.com/ebidtech/ebt-validator/blob/4f826ee3298f87eb19a8d5b2c7f998da351e5104/src/EBT/Validator/Model/Validator/Validator.php#L449-L452
193,492
ebidtech/ebt-validator
src/EBT/Validator/Model/Validator/Validator.php
Validator.isOptionalNumericRange
public static function isOptionalNumericRange($value, $min, $max) { /* No additional validations when the value is null. */ if (null === $value) { return true; } return self::isRequiredNumericRange($value, $min, $max); }
php
public static function isOptionalNumericRange($value, $min, $max) { /* No additional validations when the value is null. */ if (null === $value) { return true; } return self::isRequiredNumericRange($value, $min, $max); }
[ "public", "static", "function", "isOptionalNumericRange", "(", "$", "value", ",", "$", "min", ",", "$", "max", ")", "{", "/* No additional validations when the value is null. */", "if", "(", "null", "===", "$", "value", ")", "{", "return", "true", ";", "}", "r...
Optional value is numeric in range. @param mixed $value Value. @param int $min Lower limit. @param int $max Upper limit. @return bool
[ "Optional", "value", "is", "numeric", "in", "range", "." ]
4f826ee3298f87eb19a8d5b2c7f998da351e5104
https://github.com/ebidtech/ebt-validator/blob/4f826ee3298f87eb19a8d5b2c7f998da351e5104/src/EBT/Validator/Model/Validator/Validator.php#L517-L526
193,493
ebidtech/ebt-validator
src/EBT/Validator/Model/Validator/Validator.php
Validator.isOptionalExistingKey
public static function isOptionalExistingKey($key, array $values) { /* No additional validations when the value is null. */ if (null === $key) { return true; } return self::isRequiredExistingKey($key, $values); }
php
public static function isOptionalExistingKey($key, array $values) { /* No additional validations when the value is null. */ if (null === $key) { return true; } return self::isRequiredExistingKey($key, $values); }
[ "public", "static", "function", "isOptionalExistingKey", "(", "$", "key", ",", "array", "$", "values", ")", "{", "/* No additional validations when the value is null. */", "if", "(", "null", "===", "$", "key", ")", "{", "return", "true", ";", "}", "return", "sel...
Optional key exists. @param string $key Key to check. @param array $values Array in which to search. @return bool
[ "Optional", "key", "exists", "." ]
4f826ee3298f87eb19a8d5b2c7f998da351e5104
https://github.com/ebidtech/ebt-validator/blob/4f826ee3298f87eb19a8d5b2c7f998da351e5104/src/EBT/Validator/Model/Validator/Validator.php#L848-L857
193,494
congraphcms/core
Repositories/DataTransferObject.php
DataTransferObject.setParams
public function setParams($key, $value = null) { if(is_array($key)) { $this->params = array_merge_recursive($this->params, $key); return $this; } $this->params[$key] = $value; return $this; }
php
public function setParams($key, $value = null) { if(is_array($key)) { $this->params = array_merge_recursive($this->params, $key); return $this; } $this->params[$key] = $value; return $this; }
[ "public", "function", "setParams", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "key", ")", ")", "{", "$", "this", "->", "params", "=", "array_merge_recursive", "(", "$", "this", "->", "params", ",", "...
Set parameter data @param string|array $key @param mixed $value
[ "Set", "parameter", "data" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L158-L169
193,495
congraphcms/core
Repositories/DataTransferObject.php
DataTransferObject.hasRelation
protected function hasRelation($key, $value, $relations) { if(is_numeric($relations)) { if($relations > 0) { return true; } return false; } foreach ($relations as $prop) { if($prop == 'assets') { if( $key === 'fields' || (! $this->resolved($value) && is_object($value) && property_exists...
php
protected function hasRelation($key, $value, $relations) { if(is_numeric($relations)) { if($relations > 0) { return true; } return false; } foreach ($relations as $prop) { if($prop == 'assets') { if( $key === 'fields' || (! $this->resolved($value) && is_object($value) && property_exists...
[ "protected", "function", "hasRelation", "(", "$", "key", ",", "$", "value", ",", "$", "relations", ")", "{", "if", "(", "is_numeric", "(", "$", "relations", ")", ")", "{", "if", "(", "$", "relations", ">", "0", ")", "{", "return", "true", ";", "}",...
Check if relation exists @param string $key @param mixed $value @param array $relations @return boolean
[ "Check", "if", "relation", "exists" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L355-L392
193,496
congraphcms/core
Repositories/DataTransferObject.php
DataTransferObject.getNestedRelations
protected function getNestedRelations($key, $relations) { if(is_numeric($relations)) { if($key == 'fields') { return $relations; } if($relations - 1 > 0) { return $relations - 1; } return []; } $nestedRelations = []; foreach ($relations as $prop) { if($prop === 'assets') { ...
php
protected function getNestedRelations($key, $relations) { if(is_numeric($relations)) { if($key == 'fields') { return $relations; } if($relations - 1 > 0) { return $relations - 1; } return []; } $nestedRelations = []; foreach ($relations as $prop) { if($prop === 'assets') { ...
[ "protected", "function", "getNestedRelations", "(", "$", "key", ",", "$", "relations", ")", "{", "if", "(", "is_numeric", "(", "$", "relations", ")", ")", "{", "if", "(", "$", "key", "==", "'fields'", ")", "{", "return", "$", "relations", ";", "}", "...
Get nested relations for field @param string $prop @param array $relations @return boolean
[ "Get", "nested", "relations", "for", "field" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L402-L435
193,497
congraphcms/core
Repositories/DataTransferObject.php
DataTransferObject.loadQueue
protected function loadQueue() { $loadQueue = self::$loadQueue; foreach ($loadQueue as $type => $queries) { foreach ($queries as $query) { $ids = []; foreach ($query['ids'] as $id) { if( Trunk::has([$id, $query['relations']], $type) ) { $object = Trunk::get([$id, $query['relati...
php
protected function loadQueue() { $loadQueue = self::$loadQueue; foreach ($loadQueue as $type => $queries) { foreach ($queries as $query) { $ids = []; foreach ($query['ids'] as $id) { if( Trunk::has([$id, $query['relations']], $type) ) { $object = Trunk::get([$id, $query['relati...
[ "protected", "function", "loadQueue", "(", ")", "{", "$", "loadQueue", "=", "self", "::", "$", "loadQueue", ";", "foreach", "(", "$", "loadQueue", "as", "$", "type", "=>", "$", "queries", ")", "{", "foreach", "(", "$", "queries", "as", "$", "query", ...
Load objects from queue @return void
[ "Load", "objects", "from", "queue" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L442-L482
193,498
congraphcms/core
Repositories/DataTransferObject.php
DataTransferObject.addIncludes
public function addIncludes($includes) { if($includes instanceof Model) { $this->addItemToInclude($includes); } else { foreach ($includes as $item) { $this->addItemToInclude($item); } } if($includes instanceof DataTransferObject) { $this->addIncludes($includes->getIncludes()); }...
php
public function addIncludes($includes) { if($includes instanceof Model) { $this->addItemToInclude($includes); } else { foreach ($includes as $item) { $this->addItemToInclude($item); } } if($includes instanceof DataTransferObject) { $this->addIncludes($includes->getIncludes()); }...
[ "public", "function", "addIncludes", "(", "$", "includes", ")", "{", "if", "(", "$", "includes", "instanceof", "Model", ")", "{", "$", "this", "->", "addItemToInclude", "(", "$", "includes", ")", ";", "}", "else", "{", "foreach", "(", "$", "includes", ...
Add items to include @param mixed $includes @return void
[ "Add", "items", "to", "include" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L491-L517
193,499
congraphcms/core
Repositories/DataTransferObject.php
DataTransferObject.offsetSet
public function offsetSet($offset, $value) { if (is_null($offset)) { if( ! $this->isCollection) { throw new Exception('You need to specify a valid key for model.'); } $this->data[] = $value; } else { if($this->isCollection) { $this->data[$offset] = $value; return; } $t...
php
public function offsetSet($offset, $value) { if (is_null($offset)) { if( ! $this->isCollection) { throw new Exception('You need to specify a valid key for model.'); } $this->data[] = $value; } else { if($this->isCollection) { $this->data[$offset] = $value; return; } $t...
[ "public", "function", "offsetSet", "(", "$", "offset", ",", "$", "value", ")", "{", "if", "(", "is_null", "(", "$", "offset", ")", ")", "{", "if", "(", "!", "$", "this", "->", "isCollection", ")", "{", "throw", "new", "Exception", "(", "'You need to ...
Set data at specific offset @param string $offset @param string $value @return mixed
[ "Set", "data", "at", "specific", "offset" ]
d017d3951b446fb2ac93b8fcee120549bb125b17
https://github.com/congraphcms/core/blob/d017d3951b446fb2ac93b8fcee120549bb125b17/Repositories/DataTransferObject.php#L557-L578