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
partition
stringclasses
1 value
agentmedia/phine-core
src/Core/Logic/Logging/LogEvaluator.php
LogEvaluator.LastContentLog
static function LastContentLog(Content $content) { $tblLogContent = LogContent::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); $joinCond = $sql->Equals($tblL...
php
static function LastContentLog(Content $content) { $tblLogContent = LogContent::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); $joinCond = $sql->Equals($tblL...
[ "static", "function", "LastContentLog", "(", "Content", "$", "content", ")", "{", "$", "tblLogContent", "=", "LogContent", "::", "Schema", "(", ")", "->", "Table", "(", ")", ";", "$", "tblLogItem", "=", "LogItem", "::", "Schema", "(", ")", "->", "Table",...
The last log item that is directly related to the content @param Content $content The content @return LogItem Returns the log item
[ "The", "last", "log", "item", "that", "is", "directly", "related", "to", "the", "content" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L185-L194
train
agentmedia/phine-core
src/Core/Logic/Logging/LogEvaluator.php
LogEvaluator.LastLayoutLog
static function LastLayoutLog(Layout $layout) { $tblLogLayout = LogLayout::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); $joinCond = $sql->Equals($tblLogLay...
php
static function LastLayoutLog(Layout $layout) { $tblLogLayout = LogLayout::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); $joinCond = $sql->Equals($tblLogLay...
[ "static", "function", "LastLayoutLog", "(", "Layout", "$", "layout", ")", "{", "$", "tblLogLayout", "=", "LogLayout", "::", "Schema", "(", ")", "->", "Table", "(", ")", ";", "$", "tblLogItem", "=", "LogItem", "::", "Schema", "(", ")", "->", "Table", "(...
The last log item that is directly related to the layout @param Layout $layout The layout @return LogItem Returns the log item
[ "The", "last", "log", "item", "that", "is", "directly", "related", "to", "the", "layout" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L201-L210
train
agentmedia/phine-core
src/Core/Logic/Logging/LogEvaluator.php
LogEvaluator.LastAreaLog
static function LastAreaLog(Area $area) { $tblLogArea = LogArea::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); $joinCond = $sql->Equals($tblLogArea->Field('...
php
static function LastAreaLog(Area $area) { $tblLogArea = LogArea::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); $joinCond = $sql->Equals($tblLogArea->Field('...
[ "static", "function", "LastAreaLog", "(", "Area", "$", "area", ")", "{", "$", "tblLogArea", "=", "LogArea", "::", "Schema", "(", ")", "->", "Table", "(", ")", ";", "$", "tblLogItem", "=", "LogItem", "::", "Schema", "(", ")", "->", "Table", "(", ")", ...
The last log item that is directly related to the area @param Area $area The area @return LogItem Returns the log item
[ "The", "last", "log", "item", "that", "is", "directly", "related", "to", "the", "area" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L217-L226
train
agentmedia/phine-core
src/Core/Logic/Logging/LogEvaluator.php
LogEvaluator.LastContainerLog
static function LastContainerLog(Container $container) { $tblLogContainer = LogContainer::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); $joinCond = $sql->Eq...
php
static function LastContainerLog(Container $container) { $tblLogContainer = LogContainer::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); $joinCond = $sql->Eq...
[ "static", "function", "LastContainerLog", "(", "Container", "$", "container", ")", "{", "$", "tblLogContainer", "=", "LogContainer", "::", "Schema", "(", ")", "->", "Table", "(", ")", ";", "$", "tblLogItem", "=", "LogItem", "::", "Schema", "(", ")", "->", ...
The last log item that is directly related to the container @param Container $container The container @return LogItem Returns the log item
[ "The", "last", "log", "item", "that", "is", "directly", "related", "to", "the", "container" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L233-L242
train
agentmedia/phine-core
src/Core/Logic/Logging/LogEvaluator.php
LogEvaluator.LastTemplateLog
static function LastTemplateLog($moduleType, $template) { $tblLogTemplate = \App\Phine\Database\Core\LogTemplate::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); ...
php
static function LastTemplateLog($moduleType, $template) { $tblLogTemplate = \App\Phine\Database\Core\LogTemplate::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); ...
[ "static", "function", "LastTemplateLog", "(", "$", "moduleType", ",", "$", "template", ")", "{", "$", "tblLogTemplate", "=", "\\", "App", "\\", "Phine", "\\", "Database", "\\", "Core", "\\", "LogTemplate", "::", "Schema", "(", ")", "->", "Table", "(", ")...
The last log item that is directly related to the template @param Content $content The content @return LogItem Returns the log item
[ "The", "last", "log", "item", "that", "is", "directly", "related", "to", "the", "template" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Logging/LogEvaluator.php#L249-L259
train
makinacorpus/drupal-ulink
src/EntityLinkGenerator.php
EntityLinkGenerator.getDrupalEntityPath
private function getDrupalEntityPath($type, $entity) { $uri = entity_uri($type, $entity); if (!$uri) { throw new \InvalidArgumentException(sprintf("%s: entity type is not supported yet")); } return $uri['path']; }
php
private function getDrupalEntityPath($type, $entity) { $uri = entity_uri($type, $entity); if (!$uri) { throw new \InvalidArgumentException(sprintf("%s: entity type is not supported yet")); } return $uri['path']; }
[ "private", "function", "getDrupalEntityPath", "(", "$", "type", ",", "$", "entity", ")", "{", "$", "uri", "=", "entity_uri", "(", "$", "type", ",", "$", "entity", ")", ";", "if", "(", "!", "$", "uri", ")", "{", "throw", "new", "\\", "InvalidArgumentE...
Uses drupal 7 API to generate the entity URL @param string $type @param mixed $entity @return string
[ "Uses", "drupal", "7", "API", "to", "generate", "the", "entity", "URL" ]
4e1e54b979d72934a6fc0242aae3f12abebf41d0
https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L84-L93
train
makinacorpus/drupal-ulink
src/EntityLinkGenerator.php
EntityLinkGenerator.getEntityPath
public function getEntityPath($type, $id) { // Allow other modules to interact $event = new EntityGetPathEvent($type, $id); $this->eventDispatcher->dispatch(EntityGetPathEvent::EVENT_GET_PATH, $event); if ($path = $event->getPath()) { return $path; } // I...
php
public function getEntityPath($type, $id) { // Allow other modules to interact $event = new EntityGetPathEvent($type, $id); $this->eventDispatcher->dispatch(EntityGetPathEvent::EVENT_GET_PATH, $event); if ($path = $event->getPath()) { return $path; } // I...
[ "public", "function", "getEntityPath", "(", "$", "type", ",", "$", "id", ")", "{", "// Allow other modules to interact", "$", "event", "=", "new", "EntityGetPathEvent", "(", "$", "type", ",", "$", "id", ")", ";", "$", "this", "->", "eventDispatcher", "->", ...
Get entity internal path @param string $type Entity type @param int|string $id Entity identifier @return string The Drupal internal path
[ "Get", "entity", "internal", "path" ]
4e1e54b979d72934a6fc0242aae3f12abebf41d0
https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L106-L136
train
makinacorpus/drupal-ulink
src/EntityLinkGenerator.php
EntityLinkGenerator.getEntityPathFromURI
public function getEntityPathFromURI($uri) { if ($parts = $this->decomposeURI($uri)) { return $this->getEntityPath($parts['type'], $parts['id']); } throw new \InvalidArgumentException(sprintf("%s: invalid entity URI scheme or malformed URI", $uri)); }
php
public function getEntityPathFromURI($uri) { if ($parts = $this->decomposeURI($uri)) { return $this->getEntityPath($parts['type'], $parts['id']); } throw new \InvalidArgumentException(sprintf("%s: invalid entity URI scheme or malformed URI", $uri)); }
[ "public", "function", "getEntityPathFromURI", "(", "$", "uri", ")", "{", "if", "(", "$", "parts", "=", "$", "this", "->", "decomposeURI", "(", "$", "uri", ")", ")", "{", "return", "$", "this", "->", "getEntityPath", "(", "$", "parts", "[", "'type'", ...
Get entity internal path from internal URI @param string $uri Must match one of the supported schemes @throws \InvalidArgumentException
[ "Get", "entity", "internal", "path", "from", "internal", "URI" ]
4e1e54b979d72934a6fc0242aae3f12abebf41d0
https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L146-L153
train
makinacorpus/drupal-ulink
src/EntityLinkGenerator.php
EntityLinkGenerator.decomposeURI
public function decomposeURI($uri, &$type = null) { $elements = []; if (!self::URIIsCandidate($uri)) { return $elements; } foreach ($this->getURIPatterns() as $name => $pattern) { if (preg_match($pattern, $uri, $matches)) { $type = $name; ...
php
public function decomposeURI($uri, &$type = null) { $elements = []; if (!self::URIIsCandidate($uri)) { return $elements; } foreach ($this->getURIPatterns() as $name => $pattern) { if (preg_match($pattern, $uri, $matches)) { $type = $name; ...
[ "public", "function", "decomposeURI", "(", "$", "uri", ",", "&", "$", "type", "=", "null", ")", "{", "$", "elements", "=", "[", "]", ";", "if", "(", "!", "self", "::", "URIIsCandidate", "(", "$", "uri", ")", ")", "{", "return", "$", "elements", "...
Extract entity type and id from the given URI. @param string $uri @param string $type The type of the URI will be passed on to you through this argument. @return string[]
[ "Extract", "entity", "type", "and", "id", "from", "the", "given", "URI", "." ]
4e1e54b979d72934a6fc0242aae3f12abebf41d0
https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L164-L184
train
makinacorpus/drupal-ulink
src/EntityLinkGenerator.php
EntityLinkGenerator.formatURI
public function formatURI($type, $id, $uriType = self::SCHEME_TYPE) { switch ($uriType) { case self::SCHEME_TYPE: return 'entity://' . $type . '/' . $id; case self::STACHE_TYPE: return '{{' . $type . '/' . $id . '}}'; } throw new \Inval...
php
public function formatURI($type, $id, $uriType = self::SCHEME_TYPE) { switch ($uriType) { case self::SCHEME_TYPE: return 'entity://' . $type . '/' . $id; case self::STACHE_TYPE: return '{{' . $type . '/' . $id . '}}'; } throw new \Inval...
[ "public", "function", "formatURI", "(", "$", "type", ",", "$", "id", ",", "$", "uriType", "=", "self", "::", "SCHEME_TYPE", ")", "{", "switch", "(", "$", "uriType", ")", "{", "case", "self", "::", "SCHEME_TYPE", ":", "return", "'entity://'", ".", "$", ...
Format an URI. @param string Entity type @param integer Entity identifier @param string Type of the URI @return string
[ "Format", "an", "URI", "." ]
4e1e54b979d72934a6fc0242aae3f12abebf41d0
https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L195-L204
train
makinacorpus/drupal-ulink
src/EntityLinkGenerator.php
EntityLinkGenerator.replaceAllInText
public function replaceAllInText($text) { $uriInfo = []; // Collects all µlink URIs present in the text and stores them // in an array keyed by their offset. foreach ($this->getURIPatterns() as $pattern) { $matches = []; if (preg_match_all($pattern, $text, $...
php
public function replaceAllInText($text) { $uriInfo = []; // Collects all µlink URIs present in the text and stores them // in an array keyed by their offset. foreach ($this->getURIPatterns() as $pattern) { $matches = []; if (preg_match_all($pattern, $text, $...
[ "public", "function", "replaceAllInText", "(", "$", "text", ")", "{", "$", "uriInfo", "=", "[", "]", ";", "// Collects all µlink URIs present in the text and stores them", "// in an array keyed by their offset.", "foreach", "(", "$", "this", "->", "getURIPatterns", "(", ...
Replace all occurences of entity URIs in text by the generated URLs. @param string $text @return string
[ "Replace", "all", "occurences", "of", "entity", "URIs", "in", "text", "by", "the", "generated", "URLs", "." ]
4e1e54b979d72934a6fc0242aae3f12abebf41d0
https://github.com/makinacorpus/drupal-ulink/blob/4e1e54b979d72934a6fc0242aae3f12abebf41d0/src/EntityLinkGenerator.php#L213-L268
train
PenoaksDev/Milky-Framework
src/Milky/Annotations/FileCacheReader.php
FileCacheReader.saveCacheFile
private function saveCacheFile($path, $data) { if (!is_writable($this->dir)) { throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support ...
php
private function saveCacheFile($path, $data) { if (!is_writable($this->dir)) { throw new \InvalidArgumentException(sprintf('The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support ...
[ "private", "function", "saveCacheFile", "(", "$", "path", ",", "$", "data", ")", "{", "if", "(", "!", "is_writable", "(", "$", "this", "->", "dir", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "sprintf", "(", "'The directory \"%s\"...
Saves the cache file. @param string $path @param mixed $data @return void
[ "Saves", "the", "cache", "file", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Annotations/FileCacheReader.php#L186-L210
train
Revys/revy
src/App/RevyBase.php
RevyBase.getLanguage
public static function getLanguage() { if (! self::$language) { self::$language = Language::findByCode(App::getLocale()); } if (! self::$language) { abort(404, 'Language could not be found'); } return self::$language; }
php
public static function getLanguage() { if (! self::$language) { self::$language = Language::findByCode(App::getLocale()); } if (! self::$language) { abort(404, 'Language could not be found'); } return self::$language; }
[ "public", "static", "function", "getLanguage", "(", ")", "{", "if", "(", "!", "self", "::", "$", "language", ")", "{", "self", "::", "$", "language", "=", "Language", "::", "findByCode", "(", "App", "::", "getLocale", "(", ")", ")", ";", "}", "if", ...
Get application Language instance @return Language
[ "Get", "application", "Language", "instance" ]
b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1
https://github.com/Revys/revy/blob/b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1/src/App/RevyBase.php#L28-L39
train
Revys/revy
src/App/RevyBase.php
RevyBase.setLanguage
public static function setLanguage($language) { if (! ($language instanceof Language)) { $language = Language::findByCode($language); } if (! $language) { return false; } App::setLocale($language->code); request()->setDefaultLocale...
php
public static function setLanguage($language) { if (! ($language instanceof Language)) { $language = Language::findByCode($language); } if (! $language) { return false; } App::setLocale($language->code); request()->setDefaultLocale...
[ "public", "static", "function", "setLanguage", "(", "$", "language", ")", "{", "if", "(", "!", "(", "$", "language", "instanceof", "Language", ")", ")", "{", "$", "language", "=", "Language", "::", "findByCode", "(", "$", "language", ")", ";", "}", "if...
Set application Language instance @return Language
[ "Set", "application", "Language", "instance" ]
b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1
https://github.com/Revys/revy/blob/b2c13f5f7e88eec2681b4ec8a0385e18c28fbfd1/src/App/RevyBase.php#L45-L60
train
ciims/ciims-modules-dashboard
controllers/SettingsController.php
SettingsController.actionTheme
public function actionTheme() { $theme = Cii::getConfig('theme', 'default'); if (!file_exists(Yii::getPathOfAlias('base.themes.' . $theme) . DS . 'Theme.php')) throw new CHttpException(400, Yii::t('Dashboard.main', 'The requested theme type is not set. Please set a theme before attempting to change theme sett...
php
public function actionTheme() { $theme = Cii::getConfig('theme', 'default'); if (!file_exists(Yii::getPathOfAlias('base.themes.' . $theme) . DS . 'Theme.php')) throw new CHttpException(400, Yii::t('Dashboard.main', 'The requested theme type is not set. Please set a theme before attempting to change theme sett...
[ "public", "function", "actionTheme", "(", ")", "{", "$", "theme", "=", "Cii", "::", "getConfig", "(", "'theme'", ",", "'default'", ")", ";", "if", "(", "!", "file_exists", "(", "Yii", "::", "getPathOfAlias", "(", "'base.themes.'", ".", "$", "theme", ")",...
Provides control for Theme management @param string $type The type we want to display
[ "Provides", "control", "for", "Theme", "management" ]
94b89239e9ee34ac3b9c398e8d1ba67a08c68c11
https://github.com/ciims/ciims-modules-dashboard/blob/94b89239e9ee34ac3b9c398e8d1ba67a08c68c11/controllers/SettingsController.php#L86-L104
train
atk14/ApiDataFetcher
src/api_data_fetcher.php
ApiDataFetcher.get
function get($action,$params = array(),$options = array()){ $options["method"] = "GET"; return $this->_doRequest($action,$params,$options); }
php
function get($action,$params = array(),$options = array()){ $options["method"] = "GET"; return $this->_doRequest($action,$params,$options); }
[ "function", "get", "(", "$", "action", ",", "$", "params", "=", "array", "(", ")", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "[", "\"method\"", "]", "=", "\"GET\"", ";", "return", "$", "this", "->", "_doRequest", "(", ...
Performs HTTP GET call $api_data_fetcher->get("articles/detail",array("id" => 123)); $api_data_fetcher->get("articles/index",array("offset" => 10)); $api_data_fetcher->get("articles",array("offset" => 10)); // stejne jako "articles/index" $api_data_fetcher->get("articles/index",array("offset" => 10),array("cache" =>...
[ "Performs", "HTTP", "GET", "call" ]
6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde
https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L141-L144
train
atk14/ApiDataFetcher
src/api_data_fetcher.php
ApiDataFetcher.post
function post($action,$params = array(),$options = array()){ $options["method"] = "POST"; return $this->_doRequest($action,$params,$options); }
php
function post($action,$params = array(),$options = array()){ $options["method"] = "POST"; return $this->_doRequest($action,$params,$options); }
[ "function", "post", "(", "$", "action", ",", "$", "params", "=", "array", "(", ")", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "[", "\"method\"", "]", "=", "\"POST\"", ";", "return", "$", "this", "->", "_doRequest", "(",...
Performs HTTP POST call $api_data_fetcher->post("articles/create_new",array( "title" => "Very Nice Article" ));
[ "Performs", "HTTP", "POST", "call" ]
6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde
https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L153-L156
train
atk14/ApiDataFetcher
src/api_data_fetcher.php
ApiDataFetcher.put
function put($action,$params = array(),$options = array()){ $options["method"] = "PUT"; return $this->_doRequest($action,$params,$options); }
php
function put($action,$params = array(),$options = array()){ $options["method"] = "PUT"; return $this->_doRequest($action,$params,$options); }
[ "function", "put", "(", "$", "action", ",", "$", "params", "=", "array", "(", ")", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "[", "\"method\"", "]", "=", "\"PUT\"", ";", "return", "$", "this", "->", "_doRequest", "(", ...
Performs HTTP PUT call
[ "Performs", "HTTP", "PUT", "call" ]
6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde
https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L161-L164
train
atk14/ApiDataFetcher
src/api_data_fetcher.php
ApiDataFetcher.delete
function delete($action,$params = array(),$options = array()){ $options["method"] = "DELETE"; return $this->_doRequest($action,$params,$options); }
php
function delete($action,$params = array(),$options = array()){ $options["method"] = "DELETE"; return $this->_doRequest($action,$params,$options); }
[ "function", "delete", "(", "$", "action", ",", "$", "params", "=", "array", "(", ")", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "[", "\"method\"", "]", "=", "\"DELETE\"", ";", "return", "$", "this", "->", "_doRequest", ...
Performs HTTP DELETE call
[ "Performs", "HTTP", "DELETE", "call" ]
6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde
https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L169-L172
train
atk14/ApiDataFetcher
src/api_data_fetcher.php
ApiDataFetcher.postFile
function postFile($action,$file,$params = array(),$options = array()){ if(is_string($file)){ $file = array("path" => $file); } $file += array( "path" => "", // "/path/to/file/photo.jpg" "postname" => null, // "image" "name" => null, // "photo.jpg" "mime_type" => null, // "image/jpeg" ); if(!$...
php
function postFile($action,$file,$params = array(),$options = array()){ if(is_string($file)){ $file = array("path" => $file); } $file += array( "path" => "", // "/path/to/file/photo.jpg" "postname" => null, // "image" "name" => null, // "photo.jpg" "mime_type" => null, // "image/jpeg" ); if(!$...
[ "function", "postFile", "(", "$", "action", ",", "$", "file", ",", "$", "params", "=", "array", "(", ")", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "is_string", "(", "$", "file", ")", ")", "{", "$", "file", "=", "array",...
Sends a single file into the specific action $api_data_fetcher->postFile("images/create_new","/path/to/file.jpg"); $api_data_fetcher->postFile( "images/create_new", // action name array("path" => "/path/to/file.jpg", "name" => "earth.jpg", "mime_type" => "image/jpeg"), // file defi...
[ "Sends", "a", "single", "file", "into", "the", "specific", "action" ]
6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde
https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L187-L211
train
atk14/ApiDataFetcher
src/api_data_fetcher.php
ApiDataFetcher.postRawData
function postRawData($action,$content,$params = array(),$options = array()){ $options += array( "mime_type" => "application/data" ); $options["method"] = "POST"; $options["raw_post_data"] = $content; return $this->_doRequest($action,$params,$options); }
php
function postRawData($action,$content,$params = array(),$options = array()){ $options += array( "mime_type" => "application/data" ); $options["method"] = "POST"; $options["raw_post_data"] = $content; return $this->_doRequest($action,$params,$options); }
[ "function", "postRawData", "(", "$", "action", ",", "$", "content", ",", "$", "params", "=", "array", "(", ")", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "options", "+=", "array", "(", "\"mime_type\"", "=>", "\"application/data\"", ")...
Sends raw data to the specific action $raw_data = json_encode($data); $api_data_fetcher->postRawData("articles/edit",$raw_data,array("id" => 123),array("mime_type" => "application/json"));
[ "Sends", "raw", "data", "to", "the", "specific", "action" ]
6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde
https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L219-L228
train
atk14/ApiDataFetcher
src/api_data_fetcher.php
ApiDataFetcher.postJson
function postJson($action,$json,$options = array()){ if(!is_string($json)){ $json = json_encode($json); } $options += array( "mime_type" => "application/json", "params" => array(), ); $params = $options["params"]; unset($options["params"]); return $this->postRawData($action,$json,$params,$options...
php
function postJson($action,$json,$options = array()){ if(!is_string($json)){ $json = json_encode($json); } $options += array( "mime_type" => "application/json", "params" => array(), ); $params = $options["params"]; unset($options["params"]); return $this->postRawData($action,$json,$params,$options...
[ "function", "postJson", "(", "$", "action", ",", "$", "json", ",", "$", "options", "=", "array", "(", ")", ")", "{", "if", "(", "!", "is_string", "(", "$", "json", ")", ")", "{", "$", "json", "=", "json_encode", "(", "$", "json", ")", ";", "}",...
Sends JSON to the specific action $api_data_fetcher->postJson('action','{"a":"b","c":"d"}'); // array will be automatically encoded into a JSON $api_data_fetcher->postJson('action',["a" => "b", "c" => "d"]); // URL params can be a part of the action $api_data_fetcher->postJson('action/?url_param=value',["a" => "b", ...
[ "Sends", "JSON", "to", "the", "specific", "action" ]
6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde
https://github.com/atk14/ApiDataFetcher/blob/6ccc6c819f8c4c2e1ab33cf4bf105ae18cb3acde/src/api_data_fetcher.php#L243-L254
train
ScaraMVC/Framework
src/Scara/Config/Configuration.php
Configuration.get
public function get($key, $configFile = '') { $config = $this->load((empty($configFile)) ? $this->_configFile : $configFile); return $this->sift($config, explode('.', $key)); }
php
public function get($key, $configFile = '') { $config = $this->load((empty($configFile)) ? $this->_configFile : $configFile); return $this->sift($config, explode('.', $key)); }
[ "public", "function", "get", "(", "$", "key", ",", "$", "configFile", "=", "''", ")", "{", "$", "config", "=", "$", "this", "->", "load", "(", "(", "empty", "(", "$", "configFile", ")", ")", "?", "$", "this", "->", "_configFile", ":", "$", "confi...
Gets the config value. @param string $key - The config item's key @param string $configFile - Optional if you want to load a specific config file @return mixed
[ "Gets", "the", "config", "value", "." ]
199b08b45fadf5dae14ac4732af03b36e15bbef2
https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Config/Configuration.php#L39-L44
train
ScaraMVC/Framework
src/Scara/Config/Configuration.php
Configuration.load
private function load($file, $dir = '') { $path = config_path().'/'.$dir; $handle = opendir($path); $ignore = ['.', '..']; while ($f = readdir($handle)) { if (!in_array($f, $ignore)) { if (is_dir($path.$f)) { if (file_exists($path.$f.'/...
php
private function load($file, $dir = '') { $path = config_path().'/'.$dir; $handle = opendir($path); $ignore = ['.', '..']; while ($f = readdir($handle)) { if (!in_array($f, $ignore)) { if (is_dir($path.$f)) { if (file_exists($path.$f.'/...
[ "private", "function", "load", "(", "$", "file", ",", "$", "dir", "=", "''", ")", "{", "$", "path", "=", "config_path", "(", ")", ".", "'/'", ".", "$", "dir", ";", "$", "handle", "=", "opendir", "(", "$", "path", ")", ";", "$", "ignore", "=", ...
Loads a configuration script. @param string $file - The name of the config file to load @param string $dir - The sub directory to load into @return mixed
[ "Loads", "a", "configuration", "script", "." ]
199b08b45fadf5dae14ac4732af03b36e15bbef2
https://github.com/ScaraMVC/Framework/blob/199b08b45fadf5dae14ac4732af03b36e15bbef2/src/Scara/Config/Configuration.php#L54-L76
train
Polosa/shade-framework-core
app/ControllerDispatcher.php
ControllerDispatcher.bindService
public function bindService($controllerName, $methodName, $argumentName, $serviceName) { $this->bindings[$controllerName][$methodName][$argumentName] = $serviceName; return $this; }
php
public function bindService($controllerName, $methodName, $argumentName, $serviceName) { $this->bindings[$controllerName][$methodName][$argumentName] = $serviceName; return $this; }
[ "public", "function", "bindService", "(", "$", "controllerName", ",", "$", "methodName", ",", "$", "argumentName", ",", "$", "serviceName", ")", "{", "$", "this", "->", "bindings", "[", "$", "controllerName", "]", "[", "$", "methodName", "]", "[", "$", "...
Bind Service to method argument @param string $controllerName Controller class name @param string $methodName Method name @param string $argumentName Argument name @param string $serviceName Registered Service name @return ControllerDispatcher
[ "Bind", "Service", "to", "method", "argument" ]
d735d3e8e0616fb9cf4ffc25b8425762ed07940f
https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/ControllerDispatcher.php#L172-L176
train
Polosa/shade-framework-core
app/ControllerDispatcher.php
ControllerDispatcher.setArgumentValue
public function setArgumentValue($controllerName, $methodName, $argumentName, $value) { $this->argumentBindings[$controllerName][$methodName][$argumentName] = $value; return $this; }
php
public function setArgumentValue($controllerName, $methodName, $argumentName, $value) { $this->argumentBindings[$controllerName][$methodName][$argumentName] = $value; return $this; }
[ "public", "function", "setArgumentValue", "(", "$", "controllerName", ",", "$", "methodName", ",", "$", "argumentName", ",", "$", "value", ")", "{", "$", "this", "->", "argumentBindings", "[", "$", "controllerName", "]", "[", "$", "methodName", "]", "[", "...
Set value of method argument @param string $controllerName Controller class name @param string $methodName Method name @param string $argumentName Argument name @param string $value Value @return ControllerDispatcher
[ "Set", "value", "of", "method", "argument" ]
d735d3e8e0616fb9cf4ffc25b8425762ed07940f
https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/ControllerDispatcher.php#L188-L192
train
Polosa/shade-framework-core
app/ControllerDispatcher.php
ControllerDispatcher.getMethodArguments
protected function getMethodArguments($controllerClass, $methodName) { $actionArguments = array(); $reflectionAction = new \ReflectionMethod($controllerClass, $methodName); $actionParametersReflections = $reflectionAction->getParameters(); foreach ($actionParametersReflections as $a...
php
protected function getMethodArguments($controllerClass, $methodName) { $actionArguments = array(); $reflectionAction = new \ReflectionMethod($controllerClass, $methodName); $actionParametersReflections = $reflectionAction->getParameters(); foreach ($actionParametersReflections as $a...
[ "protected", "function", "getMethodArguments", "(", "$", "controllerClass", ",", "$", "methodName", ")", "{", "$", "actionArguments", "=", "array", "(", ")", ";", "$", "reflectionAction", "=", "new", "\\", "ReflectionMethod", "(", "$", "controllerClass", ",", ...
Get arguments of Controller's Action or constructor @param string $controllerClass Controller class name @param string $methodName Method name @throws Exception @return array
[ "Get", "arguments", "of", "Controller", "s", "Action", "or", "constructor" ]
d735d3e8e0616fb9cf4ffc25b8425762ed07940f
https://github.com/Polosa/shade-framework-core/blob/d735d3e8e0616fb9cf4ffc25b8425762ed07940f/app/ControllerDispatcher.php#L222-L248
train
eltrino/PHPUnit_MockAnnotations
src/Eltrino/PHPUnit/MockAnnotations/MockPropertyAnnotationProcessor.php
MockPropertyAnnotationProcessor.process
public function process(\ReflectionProperty $property, TestCase $test) { /** @var \ReflectionProperty $property */ $propertyDocComment = $property->getDocComment(); if (preg_match(self::REGEX_MOCK, $propertyDocComment, $matches)) { $isPrivate = $property->isPrivate(); ...
php
public function process(\ReflectionProperty $property, TestCase $test) { /** @var \ReflectionProperty $property */ $propertyDocComment = $property->getDocComment(); if (preg_match(self::REGEX_MOCK, $propertyDocComment, $matches)) { $isPrivate = $property->isPrivate(); ...
[ "public", "function", "process", "(", "\\", "ReflectionProperty", "$", "property", ",", "TestCase", "$", "test", ")", "{", "/** @var \\ReflectionProperty $property */", "$", "propertyDocComment", "=", "$", "property", "->", "getDocComment", "(", ")", ";", "if", "(...
Property processing Generate and assign mock object to property if it has @Mock annoitation @param \ReflectionProperty $property @param TestCase $test @return void
[ "Property", "processing", "Generate", "and", "assign", "mock", "object", "to", "property", "if", "it", "has" ]
1a06ed59ea0702359848fc01e958f4f92abb503a
https://github.com/eltrino/PHPUnit_MockAnnotations/blob/1a06ed59ea0702359848fc01e958f4f92abb503a/src/Eltrino/PHPUnit/MockAnnotations/MockPropertyAnnotationProcessor.php#L28-L43
train
ARCANESOFT/Media
src/Seeds/PermissionsTableSeeder.php
PermissionsTableSeeder.getMediasPermissions
private function getMediasPermissions() { return [ [ 'name' => 'Medias - List all medias', 'description' => 'Allow to list all the medias.', 'slug' => MediasPolicy::PERMISSION_LIST, ], [ 'name' ...
php
private function getMediasPermissions() { return [ [ 'name' => 'Medias - List all medias', 'description' => 'Allow to list all the medias.', 'slug' => MediasPolicy::PERMISSION_LIST, ], [ 'name' ...
[ "private", "function", "getMediasPermissions", "(", ")", "{", "return", "[", "[", "'name'", "=>", "'Medias - List all medias'", ",", "'description'", "=>", "'Allow to list all the medias.'", ",", "'slug'", "=>", "MediasPolicy", "::", "PERMISSION_LIST", ",", "]", ",", ...
Get the Medias permissions. @return array
[ "Get", "the", "Medias", "permissions", "." ]
e98aad52f94e6587fcbf79c56f7bf7072929bfc9
https://github.com/ARCANESOFT/Media/blob/e98aad52f94e6587fcbf79c56f7bf7072929bfc9/src/Seeds/PermissionsTableSeeder.php#L48-L77
train
donatj/mddom
src/AbstractElement.php
AbstractElement.exportMarkdown
public function exportMarkdown( $fragmentLevel = 0 ) { $output = ""; if( $this instanceof BlockElementInterface || $this->getPreviousSibling() instanceof BlockElementInterface ) { $output .= "\n\n"; } $output .= ltrim($this->generateMarkdown($fragmentLevel), "\n"); return $output; }
php
public function exportMarkdown( $fragmentLevel = 0 ) { $output = ""; if( $this instanceof BlockElementInterface || $this->getPreviousSibling() instanceof BlockElementInterface ) { $output .= "\n\n"; } $output .= ltrim($this->generateMarkdown($fragmentLevel), "\n"); return $output; }
[ "public", "function", "exportMarkdown", "(", "$", "fragmentLevel", "=", "0", ")", "{", "$", "output", "=", "\"\"", ";", "if", "(", "$", "this", "instanceof", "BlockElementInterface", "||", "$", "this", "->", "getPreviousSibling", "(", ")", "instanceof", "Blo...
Convert the DOM to Markdown @param int $fragmentLevel Private use - recursion depth counter @return string Markdown
[ "Convert", "the", "DOM", "to", "Markdown" ]
c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d
https://github.com/donatj/mddom/blob/c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d/src/AbstractElement.php#L17-L26
train
hiqdev/minii-console
src/Application.php
Application.handleRequest
public function handleRequest($request) { list ($route, $params) = $request->resolve(); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getRespo...
php
public function handleRequest($request) { list ($route, $params) = $request->resolve(); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getRespo...
[ "public", "function", "handleRequest", "(", "$", "request", ")", "{", "list", "(", "$", "route", ",", "$", "params", ")", "=", "$", "request", "->", "resolve", "(", ")", ";", "$", "this", "->", "requestedRoute", "=", "$", "route", ";", "$", "result",...
Handles the specified request. @param Request $request the request to be handled @return Response the resulting response
[ "Handles", "the", "specified", "request", "." ]
1da3c1a3b53588265c35330fc161b07665ab14d9
https://github.com/hiqdev/minii-console/blob/1da3c1a3b53588265c35330fc161b07665ab14d9/src/Application.php#L139-L152
train
kambalabs/KmbPuppet
src/KmbPuppet/Service/Group.php
Group.getAllByNode
public function getAllByNode(PuppetDbModel\NodeInterface $node) { $environment = $this->environmentService->getByNode($node); $revision = $environment->getCurrentRevision(); $groups[$environment->getNormalizedName()] = $revision->getGroupsMatchingHostname($node->getName()); while ($e...
php
public function getAllByNode(PuppetDbModel\NodeInterface $node) { $environment = $this->environmentService->getByNode($node); $revision = $environment->getCurrentRevision(); $groups[$environment->getNormalizedName()] = $revision->getGroupsMatchingHostname($node->getName()); while ($e...
[ "public", "function", "getAllByNode", "(", "PuppetDbModel", "\\", "NodeInterface", "$", "node", ")", "{", "$", "environment", "=", "$", "this", "->", "environmentService", "->", "getByNode", "(", "$", "node", ")", ";", "$", "revision", "=", "$", "environment...
Get all groups assigned to specified node group by environment name. @param PuppetDbModel\NodeInterface $node @return \KmbDomain\Model\GroupInterface[]
[ "Get", "all", "groups", "assigned", "to", "specified", "node", "group", "by", "environment", "name", "." ]
b97a0d2077085df4933c6b3cda9e41468bf7ffca
https://github.com/kambalabs/KmbPuppet/blob/b97a0d2077085df4933c6b3cda9e41468bf7ffca/src/KmbPuppet/Service/Group.php#L36-L47
train
squareproton/Bond
src/Bond/Di/ContainerFromAnnotations.php
ContainerFromAnnotations.getResources
private function getResources() { $resources = []; foreach( $this->getClassAnnotations() as $annotation ) { // is this a resource if( 0 === strpos($annotation, "resource") ) { $resources[] = explode(' ', $annotation)[1]; } } ret...
php
private function getResources() { $resources = []; foreach( $this->getClassAnnotations() as $annotation ) { // is this a resource if( 0 === strpos($annotation, "resource") ) { $resources[] = explode(' ', $annotation)[1]; } } ret...
[ "private", "function", "getResources", "(", ")", "{", "$", "resources", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getClassAnnotations", "(", ")", "as", "$", "annotation", ")", "{", "// is this a resource", "if", "(", "0", "===", "strpos", "...
list of files to load as configuration. should be set to empty list if none needed
[ "list", "of", "files", "to", "load", "as", "configuration", ".", "should", "be", "set", "to", "empty", "list", "if", "none", "needed" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Di/ContainerFromAnnotations.php#L57-L72
train
jenskooij/cloudcontrol
src/storage/storage/ImagesStorage.php
ImagesStorage.deleteImageByName
public function deleteImageByName($filename) { $destinationPath = $this->getDestinationPath(); $images = $this->getImages(); foreach ($images as $key => $image) { if ($image->file == $filename) { foreach ($image->set as $imageSetFilename) { $...
php
public function deleteImageByName($filename) { $destinationPath = $this->getDestinationPath(); $images = $this->getImages(); foreach ($images as $key => $image) { if ($image->file == $filename) { foreach ($image->set as $imageSetFilename) { $...
[ "public", "function", "deleteImageByName", "(", "$", "filename", ")", "{", "$", "destinationPath", "=", "$", "this", "->", "getDestinationPath", "(", ")", ";", "$", "images", "=", "$", "this", "->", "getImages", "(", ")", ";", "foreach", "(", "$", "image...
Delete image by name @param $filename
[ "Delete", "image", "by", "name" ]
76e5d9ac8f9c50d06d39a995d13cc03742536548
https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/storage/ImagesStorage.php#L81-L101
train
miknatr/grace-dbal
lib/Grace/DBAL/ConnectionAbstract/ConnectionAbstract.php
ConnectionAbstract.generateNewId
public function generateNewId($table) { if (!isset($this->idCounterByTable[$table])) { $this->idCounterByTable[$table] = $this->getSQLBuilder()->select($table)->field('id')->orderDesc('id')->limit(0, 1)->fetchResult(); } for ($i = 0; $i < 50; $i++) { $this->idCounter...
php
public function generateNewId($table) { if (!isset($this->idCounterByTable[$table])) { $this->idCounterByTable[$table] = $this->getSQLBuilder()->select($table)->field('id')->orderDesc('id')->limit(0, 1)->fetchResult(); } for ($i = 0; $i < 50; $i++) { $this->idCounter...
[ "public", "function", "generateNewId", "(", "$", "table", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "idCounterByTable", "[", "$", "table", "]", ")", ")", "{", "$", "this", "->", "idCounterByTable", "[", "$", "table", "]", "=", "$", ...
Generate new id for insert @param string $table @throws \OutOfBoundsException @return mixed
[ "Generate", "new", "id", "for", "insert" ]
b05e03040568631dc6c77477c0eaed6e60db4ba2
https://github.com/miknatr/grace-dbal/blob/b05e03040568631dc6c77477c0eaed6e60db4ba2/lib/Grace/DBAL/ConnectionAbstract/ConnectionAbstract.php#L338-L361
train
itcreator/custom-cmf
Module/User/src/Cmf/User/Controller/UserController.php
UserController.readAction
public function readAction() { $result = parent::readAction(); if (!is_array($result)) { return $result; } $em = $this->getEntityManager(); $status = $this->getFieldsConfig()->getConfigItem('status'); $statuses = $status['dataSource']->getData(); ...
php
public function readAction() { $result = parent::readAction(); if (!is_array($result)) { return $result; } $em = $this->getEntityManager(); $status = $this->getFieldsConfig()->getConfigItem('status'); $statuses = $status['dataSource']->getData(); ...
[ "public", "function", "readAction", "(", ")", "{", "$", "result", "=", "parent", "::", "readAction", "(", ")", ";", "if", "(", "!", "is_array", "(", "$", "result", ")", ")", "{", "return", "$", "result", ";", "}", "$", "em", "=", "$", "this", "->...
View user page @return array|Forward
[ "View", "user", "page" ]
42fc0535dfa0f641856f06673f6ab596b2020c40
https://github.com/itcreator/custom-cmf/blob/42fc0535dfa0f641856f06673f6ab596b2020c40/Module/User/src/Cmf/User/Controller/UserController.php#L61-L76
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.usePreviewTables
public function usePreviewTables($bEnabled) { if (!empty($bEnabled)) { $this->isPreviewMode = true; $this->table = NAILS_DB_PREFIX . 'blog_post_preview'; $this->tableAlias = 'bp'; $this->tableCat = NAILS_DB_PREFIX . 'blog_post_preview_category'; ...
php
public function usePreviewTables($bEnabled) { if (!empty($bEnabled)) { $this->isPreviewMode = true; $this->table = NAILS_DB_PREFIX . 'blog_post_preview'; $this->tableAlias = 'bp'; $this->tableCat = NAILS_DB_PREFIX . 'blog_post_preview_category'; ...
[ "public", "function", "usePreviewTables", "(", "$", "bEnabled", ")", "{", "if", "(", "!", "empty", "(", "$", "bEnabled", ")", ")", "{", "$", "this", "->", "isPreviewMode", "=", "true", ";", "$", "this", "->", "table", "=", "NAILS_DB_PREFIX", ".", "'blo...
Sets the table names to use, either the normal tables, or the preview tables. @param boolean $bEnabled Whether to use the preview tables or not @return void
[ "Sets", "the", "table", "names", "to", "use", "either", "the", "normal", "tables", "or", "the", "preview", "tables", "." ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L57-L91
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.validateSlug
private function validateSlug($sSlug, $sTitle, $iId = null) { /** * Slugs don't matter in preview mode */ if ($this->isPreviewMode) { return 'slug'; } // -------------------------------------------------------------------------- /** * ...
php
private function validateSlug($sSlug, $sTitle, $iId = null) { /** * Slugs don't matter in preview mode */ if ($this->isPreviewMode) { return 'slug'; } // -------------------------------------------------------------------------- /** * ...
[ "private", "function", "validateSlug", "(", "$", "sSlug", ",", "$", "sTitle", ",", "$", "iId", "=", "null", ")", "{", "/**\n * Slugs don't matter in preview mode\n */", "if", "(", "$", "this", "->", "isPreviewMode", ")", "{", "return", "'slug'", ...
Validates a slug, if supplied, generates one from the title, if not @param string $sSlug The slug to test @param string $sTitle The title to generate a slug from if no slug available @param integer $siId The ID of the post to ignore from a comparison, if any @return string
[ "Validates", "a", "slug", "if", "supplied", "generates", "one", "from", "the", "title", "if", "not" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L568-L611
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.getById
public function getById($id, $data = null) { $data = $this->includeEverything($data); return parent::getById($id, $data); }
php
public function getById($id, $data = null) { $data = $this->includeEverything($data); return parent::getById($id, $data); }
[ "public", "function", "getById", "(", "$", "id", ",", "$", "data", "=", "null", ")", "{", "$", "data", "=", "$", "this", "->", "includeEverything", "(", "$", "data", ")", ";", "return", "parent", "::", "getById", "(", "$", "id", ",", "$", "data", ...
Fetch a pst by it's ID @param int $id The ID of the object to fetch @param mixed $data Any data to pass to getCountCommon() @return stdClass
[ "Fetch", "a", "pst", "by", "it", "s", "ID" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L775-L779
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.getBySlug
public function getBySlug($id, $data = null) { $data = $this->includeEverything($data); return parent::getBySlug($id, $data); }
php
public function getBySlug($id, $data = null) { $data = $this->includeEverything($data); return parent::getBySlug($id, $data); }
[ "public", "function", "getBySlug", "(", "$", "id", ",", "$", "data", "=", "null", ")", "{", "$", "data", "=", "$", "this", "->", "includeEverything", "(", "$", "data", ")", ";", "return", "parent", "::", "getBySlug", "(", "$", "id", ",", "$", "data...
Fetch a post by it's slug @param int $slug The slug of the object to fetch @param mixed $data Any data to pass to getCountCommon() @return stdClass
[ "Fetch", "a", "post", "by", "it", "s", "slug" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L791-L795
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.getCountCommon
protected function getCountCommon($data = []) { $oDb = Factory::service('Database'); $oDb->select( [ $this->tableAlias . '.id', $this->tableAlias . '.blog_id', 'b.label blog_label', $this->tableAlias . '.slug', ...
php
protected function getCountCommon($data = []) { $oDb = Factory::service('Database'); $oDb->select( [ $this->tableAlias . '.id', $this->tableAlias . '.blog_id', 'b.label blog_label', $this->tableAlias . '.slug', ...
[ "protected", "function", "getCountCommon", "(", "$", "data", "=", "[", "]", ")", "{", "$", "oDb", "=", "Factory", "::", "service", "(", "'Database'", ")", ";", "$", "oDb", "->", "select", "(", "[", "$", "this", "->", "tableAlias", ".", "'.id'", ",", ...
Applies common conditionals This method applies the conditionals which are common across the get_*() methods and the count() method. @param array $data Data passed from the calling method @return void
[ "Applies", "common", "conditionals" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L830-L909
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.includeEverything
protected function includeEverything($data) { if (is_null($data)) { $data = []; } if (!isset($data['include_body'])) { $data['include_body'] = true; } if (!isset($data['include_categories'])) { $data['include_categories'] = true; ...
php
protected function includeEverything($data) { if (is_null($data)) { $data = []; } if (!isset($data['include_body'])) { $data['include_body'] = true; } if (!isset($data['include_categories'])) { $data['include_categories'] = true; ...
[ "protected", "function", "includeEverything", "(", "$", "data", ")", "{", "if", "(", "is_null", "(", "$", "data", ")", ")", "{", "$", "data", "=", "[", "]", ";", "}", "if", "(", "!", "isset", "(", "$", "data", "[", "'include_body'", "]", ")", ")"...
Sets the data array to include everything This method is called by the getBy*() methods and, if not already set, will alter the $data array so that all the include_* parameters are set. @param string $data Data passed from the calling method @return void
[ "Sets", "the", "data", "array", "to", "include", "everything" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L923-L963
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.getWithCategory
public function getWithCategory($categoryIdSlug, $page = null, $perPage = null, $data = null, $includeDeleted = false) { $oDb = Factory::service('Database'); // Join the $this->tableCat table so we can WHERE on it. $oDb->join( $this->tableCat . ' ' . $this->tableCatPrefix, ...
php
public function getWithCategory($categoryIdSlug, $page = null, $perPage = null, $data = null, $includeDeleted = false) { $oDb = Factory::service('Database'); // Join the $this->tableCat table so we can WHERE on it. $oDb->join( $this->tableCat . ' ' . $this->tableCatPrefix, ...
[ "public", "function", "getWithCategory", "(", "$", "categoryIdSlug", ",", "$", "page", "=", "null", ",", "$", "perPage", "=", "null", ",", "$", "data", "=", "null", ",", "$", "includeDeleted", "=", "false", ")", "{", "$", "oDb", "=", "Factory", "::", ...
Gets posts which are in a particular category @param mixed $categoryIdSlug The category's ID or slug @param int $page The page to render @param int $perPage The number of posts per page @param array $data Data to pass to getCountCommon() @param boolean $includeDeleted Whethe...
[ "Gets", "posts", "which", "are", "in", "a", "particular", "category" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1028-L1060
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.countWithCategory
public function countWithCategory($categoryIdSlug, $data = null, $includeDeleted = false) { $oDb = Factory::service('Database'); // Join the $this->tableCat table so we can WHERE on it. $oDb->join( $this->tableCat . ' ' . $this->tableCatPrefix, $this->tableCatPrefix...
php
public function countWithCategory($categoryIdSlug, $data = null, $includeDeleted = false) { $oDb = Factory::service('Database'); // Join the $this->tableCat table so we can WHERE on it. $oDb->join( $this->tableCat . ' ' . $this->tableCatPrefix, $this->tableCatPrefix...
[ "public", "function", "countWithCategory", "(", "$", "categoryIdSlug", ",", "$", "data", "=", "null", ",", "$", "includeDeleted", "=", "false", ")", "{", "$", "oDb", "=", "Factory", "::", "service", "(", "'Database'", ")", ";", "// Join the $this->tableCat ta...
Count the number of posts in a particular category @param mixed $categoryIdSlug The category's ID or slug @param array $data Data to pass to getCountCommon() @param boolean $includeDeleted Whether to include deleted posts in the result @return int
[ "Count", "the", "number", "of", "posts", "in", "a", "particular", "category" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1073-L1099
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.getWithTag
public function getWithTag($tagIdSlug, $page = null, $perPage = null, $data = null, $includeDeleted = false) { $oDb = Factory::service('Database'); // Join the $this->tableTag table so we can WHERE on it. $oDb->join( $this->tableTag . ' ' . $this->tableTagPrefix, $t...
php
public function getWithTag($tagIdSlug, $page = null, $perPage = null, $data = null, $includeDeleted = false) { $oDb = Factory::service('Database'); // Join the $this->tableTag table so we can WHERE on it. $oDb->join( $this->tableTag . ' ' . $this->tableTagPrefix, $t...
[ "public", "function", "getWithTag", "(", "$", "tagIdSlug", ",", "$", "page", "=", "null", ",", "$", "perPage", "=", "null", ",", "$", "data", "=", "null", ",", "$", "includeDeleted", "=", "false", ")", "{", "$", "oDb", "=", "Factory", "::", "service"...
Gets posts which are in a particular tag @param mixed $tagIdSlug The tag's ID or slug @param int $page The page to render @param int $perPage The number of posts per page @param array $data Data to pass to getCountCommon() @param boolean $includeDeleted Whether to inclu...
[ "Gets", "posts", "which", "are", "in", "a", "particular", "tag" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1114-L1142
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.countWithTag
public function countWithTag($tagIdSlug, $data = null, $includeDeleted = false) { $oDb = Factory::service('Database'); // Join the $this->tableTag table so we can WHERE on it. $oDb->join( $this->tableTag . ' ' . $this->tableTagPrefix, $this->tableTagPrefix . '.post_...
php
public function countWithTag($tagIdSlug, $data = null, $includeDeleted = false) { $oDb = Factory::service('Database'); // Join the $this->tableTag table so we can WHERE on it. $oDb->join( $this->tableTag . ' ' . $this->tableTagPrefix, $this->tableTagPrefix . '.post_...
[ "public", "function", "countWithTag", "(", "$", "tagIdSlug", ",", "$", "data", "=", "null", ",", "$", "includeDeleted", "=", "false", ")", "{", "$", "oDb", "=", "Factory", "::", "service", "(", "'Database'", ")", ";", "// Join the $this->tableTag table so we ...
Count the number of posts in a particular tag @param mixed $tagIdSlug The tag's ID or slug @param array $data Data to pass to getCountCommon() @param boolean $includeDeleted Whether to include deleted posts in the result @return int
[ "Count", "the", "number", "of", "posts", "in", "a", "particular", "tag" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1155-L1185
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.getWithAssociation
public function getWithAssociation($associationIndex, $associatedId) { $oConfig = Factory::service('Config'); $oConfig->load('blog/blog'); $associations = $oConfig->item('blog_post_associations'); if (!isset($associations[$associationIndex])) { return []; } ...
php
public function getWithAssociation($associationIndex, $associatedId) { $oConfig = Factory::service('Config'); $oConfig->load('blog/blog'); $associations = $oConfig->item('blog_post_associations'); if (!isset($associations[$associationIndex])) { return []; } ...
[ "public", "function", "getWithAssociation", "(", "$", "associationIndex", ",", "$", "associatedId", ")", "{", "$", "oConfig", "=", "Factory", "::", "service", "(", "'Config'", ")", ";", "$", "oConfig", "->", "load", "(", "'blog/blog'", ")", ";", "$", "asso...
Get posts with a particular association @param int $associationIndex The association's index @param int $associatedId The Id of the item to be associated with @return array
[ "Get", "posts", "with", "a", "particular", "association" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1209-L1238
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.addHit
public function addHit($id, $data = []) { if (!$id) { $this->setError('Post ID is required.'); return false; } // -------------------------------------------------------------------------- $oDate = Factory::factory('DateTime'); $hitDa...
php
public function addHit($id, $data = []) { if (!$id) { $this->setError('Post ID is required.'); return false; } // -------------------------------------------------------------------------- $oDate = Factory::factory('DateTime'); $hitDa...
[ "public", "function", "addHit", "(", "$", "id", ",", "$", "data", "=", "[", "]", ")", "{", "if", "(", "!", "$", "id", ")", "{", "$", "this", "->", "setError", "(", "'Post ID is required.'", ")", ";", "return", "false", ";", "}", "// -----------------...
Add a hit to a post @param int $id The post's ID @param array $data Details about the hit
[ "Add", "a", "hit", "to", "a", "post" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1248-L1298
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.getTypes
public function getTypes() { $oDb = Factory::service('Database'); $oResult = $oDb->query('SHOW COLUMNS FROM `' . $this->table . '` LIKE "type"')->row(); $sTypes = $oResult->Type; $sTypes = preg_replace('/enum\((.*)\)/', '$1', $sTypes); $sTypes = str_replace("'", '', $s...
php
public function getTypes() { $oDb = Factory::service('Database'); $oResult = $oDb->query('SHOW COLUMNS FROM `' . $this->table . '` LIKE "type"')->row(); $sTypes = $oResult->Type; $sTypes = preg_replace('/enum\((.*)\)/', '$1', $sTypes); $sTypes = str_replace("'", '', $s...
[ "public", "function", "getTypes", "(", ")", "{", "$", "oDb", "=", "Factory", "::", "service", "(", "'Database'", ")", ";", "$", "oResult", "=", "$", "oDb", "->", "query", "(", "'SHOW COLUMNS FROM `'", ".", "$", "this", "->", "table", ".", "'` LIKE \"type...
Parses the `type` column and returns an array of potential post types @return array
[ "Parses", "the", "type", "column", "and", "returns", "an", "array", "of", "potential", "post", "types" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1306-L1322
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.formatUrl
public function formatUrl($slug, $blogId) { $this->load->model('blog/blog_model'); return $this->blog_model->getBlogUrl($blogId) . '/' . $slug; }
php
public function formatUrl($slug, $blogId) { $this->load->model('blog/blog_model'); return $this->blog_model->getBlogUrl($blogId) . '/' . $slug; }
[ "public", "function", "formatUrl", "(", "$", "slug", ",", "$", "blogId", ")", "{", "$", "this", "->", "load", "->", "model", "(", "'blog/blog_model'", ")", ";", "return", "$", "this", "->", "blog_model", "->", "getBlogUrl", "(", "$", "blogId", ")", "."...
Format a posts's URL @param string $slug The post's slug @param int $blogId The blog's ID @return string
[ "Format", "a", "posts", "s", "URL" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1334-L1338
train
nails/module-blog
blog/models/blog_post_model.php
NAILS_Blog_post_model.extractYoutubeId
public function extractYoutubeId($sUrl) { preg_match('/^https?\:\/\/www\.youtube\.com\/watch\?v=([a-zA-Z0-9_\-]+)$/', $sUrl, $aMatches); if (!empty($aMatches[1])) { return $aMatches[1]; } else { preg_match('/^https?\:\/\/youtu\.be\/([a-zA-Z0-9_\-]+)$/', $sUrl, $aM...
php
public function extractYoutubeId($sUrl) { preg_match('/^https?\:\/\/www\.youtube\.com\/watch\?v=([a-zA-Z0-9_\-]+)$/', $sUrl, $aMatches); if (!empty($aMatches[1])) { return $aMatches[1]; } else { preg_match('/^https?\:\/\/youtu\.be\/([a-zA-Z0-9_\-]+)$/', $sUrl, $aM...
[ "public", "function", "extractYoutubeId", "(", "$", "sUrl", ")", "{", "preg_match", "(", "'/^https?\\:\\/\\/www\\.youtube\\.com\\/watch\\?v=([a-zA-Z0-9_\\-]+)$/'", ",", "$", "sUrl", ",", "$", "aMatches", ")", ";", "if", "(", "!", "empty", "(", "$", "aMatches", "["...
Extracts the ID from a YouTube URL @param string $sUrl The YouTube URL @return string
[ "Extracts", "the", "ID", "from", "a", "YouTube", "URL" ]
7b369c5209f4343fff7c7e2a22c237d5a95c8c24
https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/models/blog_post_model.php#L1447-L1466
train
erenmustafaozdal/laravel-modules-base
src/Services/MailService.php
MailService.queue
public function queue() { $from = $this->fromEmail; $to = $this->toEmail; $name = $this->toName; $subject = $this->subject; $this->beauty->queue($this->view, $this->datas, function($message) use($from,$to,$name,$subject) { $message->from($from) ...
php
public function queue() { $from = $this->fromEmail; $to = $this->toEmail; $name = $this->toName; $subject = $this->subject; $this->beauty->queue($this->view, $this->datas, function($message) use($from,$to,$name,$subject) { $message->from($from) ...
[ "public", "function", "queue", "(", ")", "{", "$", "from", "=", "$", "this", "->", "fromEmail", ";", "$", "to", "=", "$", "this", "->", "toEmail", ";", "$", "name", "=", "$", "this", "->", "toName", ";", "$", "subject", "=", "$", "this", "->", ...
send queue mail
[ "send", "queue", "mail" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Services/MailService.php#L73-L85
train
erenmustafaozdal/laravel-modules-base
src/Services/MailService.php
MailService.handlerOptions
public function handlerOptions() { $this->fromEmail = config('mail.from.address'); $this->toEmail = config('laravel-modules-base.developer_mail'); $this->toName = config('laravel-modules-base.developer_name'); $this->subject = trans('laravel-modules-base::admin.email.error.subject');...
php
public function handlerOptions() { $this->fromEmail = config('mail.from.address'); $this->toEmail = config('laravel-modules-base.developer_mail'); $this->toName = config('laravel-modules-base.developer_name'); $this->subject = trans('laravel-modules-base::admin.email.error.subject');...
[ "public", "function", "handlerOptions", "(", ")", "{", "$", "this", "->", "fromEmail", "=", "config", "(", "'mail.from.address'", ")", ";", "$", "this", "->", "toEmail", "=", "config", "(", "'laravel-modules-base.developer_mail'", ")", ";", "$", "this", "->", ...
exception handler set options
[ "exception", "handler", "set", "options" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Services/MailService.php#L107-L114
train
Vectrex/vxPHP
src/File/UploadedFile.php
UploadedFile.move
public function move(FilesystemFolder $destination) { if($this->alreadyUploaded) { return parent::move($destination); } $oldpath = $this->folder->getPath() . $this->filename; $filename = self::sanitizeFilename($this->originalName, $destination); $newpath = $destination->getPath() . $filename; // ensur...
php
public function move(FilesystemFolder $destination) { if($this->alreadyUploaded) { return parent::move($destination); } $oldpath = $this->folder->getPath() . $this->filename; $filename = self::sanitizeFilename($this->originalName, $destination); $newpath = $destination->getPath() . $filename; // ensur...
[ "public", "function", "move", "(", "FilesystemFolder", "$", "destination", ")", "{", "if", "(", "$", "this", "->", "alreadyUploaded", ")", "{", "return", "parent", "::", "move", "(", "$", "destination", ")", ";", "}", "$", "oldpath", "=", "$", "this", ...
performs an initial move of an uploaded file from its temporary folder to a destination folder and renames it to the original filename once completed a flag is set and subsequent moves are redirected to the parent method (non-PHPdoc) @see \vxPHP\File\FilesystemFile::move()
[ "performs", "an", "initial", "move", "of", "an", "uploaded", "file", "from", "its", "temporary", "folder", "to", "a", "destination", "folder", "and", "renames", "it", "to", "the", "original", "filename", "once", "completed", "a", "flag", "is", "set", "and", ...
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/UploadedFile.php#L87-L143
train
danielgp/common-lib
source/MySQLiByDanielGPstructures.php
MySQLiByDanielGPstructures.getFieldNameForDisplay
protected function getFieldNameForDisplay($details) { $tableUniqueId = $details['TABLE_SCHEMA'] . '.' . $details['TABLE_NAME']; if ($details['COLUMN_COMMENT'] != '') { return $details['COLUMN_COMMENT']; } elseif (isset($this->advCache['tableStructureLocales'][$tableUniqueId][$det...
php
protected function getFieldNameForDisplay($details) { $tableUniqueId = $details['TABLE_SCHEMA'] . '.' . $details['TABLE_NAME']; if ($details['COLUMN_COMMENT'] != '') { return $details['COLUMN_COMMENT']; } elseif (isset($this->advCache['tableStructureLocales'][$tableUniqueId][$det...
[ "protected", "function", "getFieldNameForDisplay", "(", "$", "details", ")", "{", "$", "tableUniqueId", "=", "$", "details", "[", "'TABLE_SCHEMA'", "]", ".", "'.'", ".", "$", "details", "[", "'TABLE_NAME'", "]", ";", "if", "(", "$", "details", "[", "'COLUM...
Returns the name of a field for displaying @param array $details @return string
[ "Returns", "the", "name", "of", "a", "field", "for", "displaying" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPstructures.php#L67-L76
train
danielgp/common-lib
source/MySQLiByDanielGPstructures.php
MySQLiByDanielGPstructures.getFieldOutputTextFK
protected function getFieldOutputTextFK($foreignKeysArray, $value, $iar) { $query = $this->sQueryGenericSelectKeyValue([ '`' . $value['COLUMN_NAME'] . '`', $foreignKeysArray[$value['COLUMN_NAME']][2], $foreignKeysArray[$value['COLUMN_NAME']][0] ]); $inAd...
php
protected function getFieldOutputTextFK($foreignKeysArray, $value, $iar) { $query = $this->sQueryGenericSelectKeyValue([ '`' . $value['COLUMN_NAME'] . '`', $foreignKeysArray[$value['COLUMN_NAME']][2], $foreignKeysArray[$value['COLUMN_NAME']][0] ]); $inAd...
[ "protected", "function", "getFieldOutputTextFK", "(", "$", "foreignKeysArray", ",", "$", "value", ",", "$", "iar", ")", "{", "$", "query", "=", "$", "this", "->", "sQueryGenericSelectKeyValue", "(", "[", "'`'", ".", "$", "value", "[", "'COLUMN_NAME'", "]", ...
Prepares the output of text fields defined w. FKs @param array $foreignKeysArray @param array $value @param array $iar @return string
[ "Prepares", "the", "output", "of", "text", "fields", "defined", "w", ".", "FKs" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPstructures.php#L86-L105
train
danielgp/common-lib
source/MySQLiByDanielGPstructures.php
MySQLiByDanielGPstructures.getRowDataFromTable
protected function getRowDataFromTable($tableName, $filtersArray) { $query = $this->sQueryRowsFromTable([$tableName, $this->setArrayToFilterValues($filtersArray)]); $rawData = $this->setMySQLquery2Server($query, 'array_pairs_key_value')['result']; if (!is_null($rawData)) { $thi...
php
protected function getRowDataFromTable($tableName, $filtersArray) { $query = $this->sQueryRowsFromTable([$tableName, $this->setArrayToFilterValues($filtersArray)]); $rawData = $this->setMySQLquery2Server($query, 'array_pairs_key_value')['result']; if (!is_null($rawData)) { $thi...
[ "protected", "function", "getRowDataFromTable", "(", "$", "tableName", ",", "$", "filtersArray", ")", "{", "$", "query", "=", "$", "this", "->", "sQueryRowsFromTable", "(", "[", "$", "tableName", ",", "$", "this", "->", "setArrayToFilterValues", "(", "$", "f...
Reads data from table into REQUEST super global @param string $tableName @param array $filtersArray
[ "Reads", "data", "from", "table", "into", "REQUEST", "super", "global" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPstructures.php#L279-L290
train
danielgp/common-lib
source/MySQLiByDanielGPstructures.php
MySQLiByDanielGPstructures.setArrayToFilterValues
private function setArrayToFilterValues($entryArray, $referenceTable = '') { $filters = []; $refTable = $this->correctTableWithQuotesAsFieldPrefix($referenceTable); foreach ($entryArray as $key => $value) { if (is_array($value)) { $filters[] = $this->setArrayLine...
php
private function setArrayToFilterValues($entryArray, $referenceTable = '') { $filters = []; $refTable = $this->correctTableWithQuotesAsFieldPrefix($referenceTable); foreach ($entryArray as $key => $value) { if (is_array($value)) { $filters[] = $this->setArrayLine...
[ "private", "function", "setArrayToFilterValues", "(", "$", "entryArray", ",", "$", "referenceTable", "=", "''", ")", "{", "$", "filters", "=", "[", "]", ";", "$", "refTable", "=", "$", "this", "->", "correctTableWithQuotesAsFieldPrefix", "(", "$", "referenceTa...
Transforms an array into usable filters @param array $entryArray @param string $referenceTable @return string
[ "Transforms", "an", "array", "into", "usable", "filters" ]
627b99b4408414c7cd21a6c8016f6468dc9216b2
https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/MySQLiByDanielGPstructures.php#L299-L311
train
t3v/t3v_core
Classes/Utility/StringUtility.php
StringUtility.asciify
public static function asciify(string $input, string $language = 'en', bool $removeUnsupported = true): string { $output = S::toAscii($input, $language, $removeUnsupported); return $output; }
php
public static function asciify(string $input, string $language = 'en', bool $removeUnsupported = true): string { $output = S::toAscii($input, $language, $removeUnsupported); return $output; }
[ "public", "static", "function", "asciify", "(", "string", "$", "input", ",", "string", "$", "language", "=", "'en'", ",", "bool", "$", "removeUnsupported", "=", "true", ")", ":", "string", "{", "$", "output", "=", "S", "::", "toAscii", "(", "$", "input...
Returns an ASCII version of the input. @param string $input The input @param string $language The optional language, defaults to `en` @param bool $removeUnsupported Remove unsupported characters , defaults to `true` @return string The asciified input
[ "Returns", "an", "ASCII", "version", "of", "the", "input", "." ]
8c04b7688cc2773f11fcc87fda3f7cd53d80a980
https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/StringUtility.php#L20-L24
train
t3v/t3v_core
Classes/Utility/StringUtility.php
StringUtility.camelize
public static function camelize(string $input, string $separator = '_', bool $capitalizeFirstCharacter = false): string { $output = $input; if (ctype_upper($output)) { $output = mb_strtolower($output); } if (strpos($output, $separator) || strpos($output, ' ')) { $output = mb_strtolower($in...
php
public static function camelize(string $input, string $separator = '_', bool $capitalizeFirstCharacter = false): string { $output = $input; if (ctype_upper($output)) { $output = mb_strtolower($output); } if (strpos($output, $separator) || strpos($output, ' ')) { $output = mb_strtolower($in...
[ "public", "static", "function", "camelize", "(", "string", "$", "input", ",", "string", "$", "separator", "=", "'_'", ",", "bool", "$", "capitalizeFirstCharacter", "=", "false", ")", ":", "string", "{", "$", "output", "=", "$", "input", ";", "if", "(", ...
Camelizes an input. @param string $input The input @param string $separator The optional separator, defaults to `_` @param bool $capitalizeFirstCharacter If the first character should be capitalized, defaults to `false` @return string The camelized input
[ "Camelizes", "an", "input", "." ]
8c04b7688cc2773f11fcc87fda3f7cd53d80a980
https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/StringUtility.php#L34-L51
train
phpffcms/ffcms-core
src/Helper/Security.php
Security.secureHtml
public function secureHtml($data): ?string { return (Any::isArray($data) ? $this->purifier->purifyArray($data) : $this->purifier->purify($data)); }
php
public function secureHtml($data): ?string { return (Any::isArray($data) ? $this->purifier->purifyArray($data) : $this->purifier->purify($data)); }
[ "public", "function", "secureHtml", "(", "$", "data", ")", ":", "?", "string", "{", "return", "(", "Any", "::", "isArray", "(", "$", "data", ")", "?", "$", "this", "->", "purifier", "->", "purifyArray", "(", "$", "data", ")", ":", "$", "this", "->"...
Secure html code @param string|array $data @return string
[ "Secure", "html", "code" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Security.php#L40-L43
train
phpffcms/ffcms-core
src/Helper/Security.php
Security.strip_tags
public function strip_tags($html, $escapeQuotes = true) { // recursive usage if (Any::isArray($html)) { foreach ($html as $key=>$value) { $html[$key] = $this->strip_tags($value, $escapeQuotes); } return $html; } $text = strip_tags(...
php
public function strip_tags($html, $escapeQuotes = true) { // recursive usage if (Any::isArray($html)) { foreach ($html as $key=>$value) { $html[$key] = $this->strip_tags($value, $escapeQuotes); } return $html; } $text = strip_tags(...
[ "public", "function", "strip_tags", "(", "$", "html", ",", "$", "escapeQuotes", "=", "true", ")", "{", "// recursive usage", "if", "(", "Any", "::", "isArray", "(", "$", "html", ")", ")", "{", "foreach", "(", "$", "html", "as", "$", "key", "=>", "$",...
String html tags and escape quotes @param string|array $html @param boolean $escapeQuotes @return string|array|null
[ "String", "html", "tags", "and", "escape", "quotes" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Security.php#L51-L67
train
phpffcms/ffcms-core
src/Helper/Security.php
Security.strip_php_tags
public function strip_php_tags($data) { if (is_array($data)) { foreach ($data as $key=>$value) { $data[$key] = $this->strip_php_tags($value); } return $data; } return addslashes(htmlspecialchars(strip_tags($data))); }
php
public function strip_php_tags($data) { if (is_array($data)) { foreach ($data as $key=>$value) { $data[$key] = $this->strip_php_tags($value); } return $data; } return addslashes(htmlspecialchars(strip_tags($data))); }
[ "public", "function", "strip_php_tags", "(", "$", "data", ")", "{", "if", "(", "is_array", "(", "$", "data", ")", ")", "{", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "data", "[", "$", "key", "]", "=", "$"...
Strip php tags and notations in string. @param array|string $data @return array|null|string
[ "Strip", "php", "tags", "and", "notations", "in", "string", "." ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Security.php#L74-L83
train
sil-project/VarietyBundle
src/Entity/Genus.php
Genus.setFamily
public function setFamily(\Librinfo\VarietiesBundle\Entity\Family $family = null) { $this->family = $family; return $this; }
php
public function setFamily(\Librinfo\VarietiesBundle\Entity\Family $family = null) { $this->family = $family; return $this; }
[ "public", "function", "setFamily", "(", "\\", "Librinfo", "\\", "VarietiesBundle", "\\", "Entity", "\\", "Family", "$", "family", "=", "null", ")", "{", "$", "this", "->", "family", "=", "$", "family", ";", "return", "$", "this", ";", "}" ]
Set family. @param \Librinfo\VarietiesBundle\Entity\Family $family @return Genus
[ "Set", "family", "." ]
e9508ce13a4bb277d10bdcd925fdb84bc01f453f
https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Genus.php#L129-L134
train
sil-project/VarietyBundle
src/Entity/Genus.php
Genus.addSpeciese
public function addSpeciese(\Librinfo\VarietiesBundle\Entity\Species $species) { $species->setGenus($this); $this->specieses->add($species); return $this; }
php
public function addSpeciese(\Librinfo\VarietiesBundle\Entity\Species $species) { $species->setGenus($this); $this->specieses->add($species); return $this; }
[ "public", "function", "addSpeciese", "(", "\\", "Librinfo", "\\", "VarietiesBundle", "\\", "Entity", "\\", "Species", "$", "species", ")", "{", "$", "species", "->", "setGenus", "(", "$", "this", ")", ";", "$", "this", "->", "specieses", "->", "add", "("...
Alias for addSpecies. @param \Librinfo\VarietiesBundle\Entity\Species $species @return \Librinfo\VarietiesBundle\Entity\Genus
[ "Alias", "for", "addSpecies", "." ]
e9508ce13a4bb277d10bdcd925fdb84bc01f453f
https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Genus.php#L153-L159
train
sil-project/VarietyBundle
src/Entity/Genus.php
Genus.removeSpecies
public function removeSpecies(\Librinfo\VarietiesBundle\Entity\Species $species) { return $this->specieses->removeElement($species); }
php
public function removeSpecies(\Librinfo\VarietiesBundle\Entity\Species $species) { return $this->specieses->removeElement($species); }
[ "public", "function", "removeSpecies", "(", "\\", "Librinfo", "\\", "VarietiesBundle", "\\", "Entity", "\\", "Species", "$", "species", ")", "{", "return", "$", "this", "->", "specieses", "->", "removeElement", "(", "$", "species", ")", ";", "}" ]
Remove speciese. @param \Librinfo\VarietiesBundle\Entity\Species $species @return bool tRUE if this collection contained the specified element, FALSE otherwise
[ "Remove", "speciese", "." ]
e9508ce13a4bb277d10bdcd925fdb84bc01f453f
https://github.com/sil-project/VarietyBundle/blob/e9508ce13a4bb277d10bdcd925fdb84bc01f453f/src/Entity/Genus.php#L183-L186
train
PenoaksDev/Milky-Framework
src/Milky/Http/Routing/RouteDependencyResolverTrait.php
RouteDependencyResolverTrait.resolveClassMethodDependencies
protected function resolveClassMethodDependencies( array $parameters, $instance, $method ) { if ( !method_exists( $instance, $method ) ) return $parameters; return $this->resolveMethodDependencies( $parameters, new ReflectionMethod( $instance, $method ) ); }
php
protected function resolveClassMethodDependencies( array $parameters, $instance, $method ) { if ( !method_exists( $instance, $method ) ) return $parameters; return $this->resolveMethodDependencies( $parameters, new ReflectionMethod( $instance, $method ) ); }
[ "protected", "function", "resolveClassMethodDependencies", "(", "array", "$", "parameters", ",", "$", "instance", ",", "$", "method", ")", "{", "if", "(", "!", "method_exists", "(", "$", "instance", ",", "$", "method", ")", ")", "return", "$", "parameters", ...
Resolve the object method's type-hinted dependencies. @param array $parameters @param object $instance @param string $method @return array
[ "Resolve", "the", "object", "method", "s", "type", "-", "hinted", "dependencies", "." ]
8afd7156610a70371aa5b1df50b8a212bf7b142c
https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Routing/RouteDependencyResolverTrait.php#L34-L40
train
Wedeto/HTTP
src/Cookie.php
Cookie.setURL
public function setURL(URL $url) { $this->domain = $url->host; $this->path = $url->path; $this->secure = $url->secure; return $this; }
php
public function setURL(URL $url) { $this->domain = $url->host; $this->path = $url->path; $this->secure = $url->secure; return $this; }
[ "public", "function", "setURL", "(", "URL", "$", "url", ")", "{", "$", "this", "->", "domain", "=", "$", "url", "->", "host", ";", "$", "this", "->", "path", "=", "$", "url", "->", "path", ";", "$", "this", "->", "secure", "=", "$", "url", "->"...
Set the domain and path using a URL @param Wedeto\HTTP\URL The URI to use as the cookie domain
[ "Set", "the", "domain", "and", "path", "using", "a", "URL" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Cookie.php#L174-L180
train
Wedeto/HTTP
src/Cookie.php
Cookie.setExpiresIn
public function setExpiresIn(DateInterval $interval) { $this->expires = new DateTime(); $this->expires->add($interval); return $this; }
php
public function setExpiresIn(DateInterval $interval) { $this->expires = new DateTime(); $this->expires->add($interval); return $this; }
[ "public", "function", "setExpiresIn", "(", "DateInterval", "$", "interval", ")", "{", "$", "this", "->", "expires", "=", "new", "DateTime", "(", ")", ";", "$", "this", "->", "expires", "->", "add", "(", "$", "interval", ")", ";", "return", "$", "this",...
Set expiry date by a DateInterval, relative to the current time @param DateInterval $interval After how much time the cookie should expire @return Wedeto\HTTP\Cookie Provides fluent interface
[ "Set", "expiry", "date", "by", "a", "DateInterval", "relative", "to", "the", "current", "time" ]
7318eff1b81a3c103c4263466d09b7f3593b70b9
https://github.com/Wedeto/HTTP/blob/7318eff1b81a3c103c4263466d09b7f3593b70b9/src/Cookie.php#L214-L219
train
squareproton/Bond
src/Bond/Normality/Builder/EntityChild.php
EntityChild.getClassExtends
protected function getClassExtends() { $parentPlaceholderClass = sprintf( "\\%s\\%s", $this->options['entityPlaceholder'], $this->pgClass->getParent()->getEntityName() ); $this->class->addExtends($parentPlaceholderClass); }
php
protected function getClassExtends() { $parentPlaceholderClass = sprintf( "\\%s\\%s", $this->options['entityPlaceholder'], $this->pgClass->getParent()->getEntityName() ); $this->class->addExtends($parentPlaceholderClass); }
[ "protected", "function", "getClassExtends", "(", ")", "{", "$", "parentPlaceholderClass", "=", "sprintf", "(", "\"\\\\%s\\\\%s\"", ",", "$", "this", "->", "options", "[", "'entityPlaceholder'", "]", ",", "$", "this", "->", "pgClass", "->", "getParent", "(", ")...
Get class extends
[ "Get", "class", "extends" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/EntityChild.php#L34-L42
train
duncan3dc/serial
src/Php.php
Php.encode
public static function encode($array) { $array = static::asArray($array); if (is_array($array) && count($array) < 1) { return ""; } try { $string = serialize($array); } catch (\Exception $e) { throw new PhpException("Serialize Error: " . ...
php
public static function encode($array) { $array = static::asArray($array); if (is_array($array) && count($array) < 1) { return ""; } try { $string = serialize($array); } catch (\Exception $e) { throw new PhpException("Serialize Error: " . ...
[ "public", "static", "function", "encode", "(", "$", "array", ")", "{", "$", "array", "=", "static", "::", "asArray", "(", "$", "array", ")", ";", "if", "(", "is_array", "(", "$", "array", ")", "&&", "count", "(", "$", "array", ")", "<", "1", ")",...
Convert an array to a php serialized string. {@inheritDoc}
[ "Convert", "an", "array", "to", "a", "php", "serialized", "string", "." ]
2e40127a0a364ee1bd6f655b0f5b5d4a035a5716
https://github.com/duncan3dc/serial/blob/2e40127a0a364ee1bd6f655b0f5b5d4a035a5716/src/Php.php#L15-L30
train
duncan3dc/serial
src/Php.php
Php.decode
public static function decode($string) { if (!$string) { return new ArrayObject(); } try { $array = unserialize($string); } catch (\Exception $e) { throw new PhpException("Serialize Error: " . $e->getMessage()); } if (!is_array($a...
php
public static function decode($string) { if (!$string) { return new ArrayObject(); } try { $array = unserialize($string); } catch (\Exception $e) { throw new PhpException("Serialize Error: " . $e->getMessage()); } if (!is_array($a...
[ "public", "static", "function", "decode", "(", "$", "string", ")", "{", "if", "(", "!", "$", "string", ")", "{", "return", "new", "ArrayObject", "(", ")", ";", "}", "try", "{", "$", "array", "=", "unserialize", "(", "$", "string", ")", ";", "}", ...
Convert a php serialized string to an array. {@inheritDoc}
[ "Convert", "a", "php", "serialized", "string", "to", "an", "array", "." ]
2e40127a0a364ee1bd6f655b0f5b5d4a035a5716
https://github.com/duncan3dc/serial/blob/2e40127a0a364ee1bd6f655b0f5b5d4a035a5716/src/Php.php#L38-L55
train
agentmedia/phine-core
src/Core/Logic/Routing/BackendRouter.php
BackendRouter.ModuleUrl
static function ModuleUrl(BackendModule $module, array $args = array()) { $allArgs = array('module'=> ClassFinder::ModuleType($module)) + $args; return 'index.php?' . http_build_query($allArgs); }
php
static function ModuleUrl(BackendModule $module, array $args = array()) { $allArgs = array('module'=> ClassFinder::ModuleType($module)) + $args; return 'index.php?' . http_build_query($allArgs); }
[ "static", "function", "ModuleUrl", "(", "BackendModule", "$", "module", ",", "array", "$", "args", "=", "array", "(", ")", ")", "{", "$", "allArgs", "=", "array", "(", "'module'", "=>", "ClassFinder", "::", "ModuleType", "(", "$", "module", ")", ")", "...
Gets the url for a module @param BackendModule $module The module @param array $args @return string
[ "Gets", "the", "url", "for", "a", "module" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Routing/BackendRouter.php#L21-L25
train
agentmedia/phine-core
src/Core/Logic/Routing/BackendRouter.php
BackendRouter.AjaxUrl
static function AjaxUrl(ModuleBase $module, array $args = array()) { $allArgs = array('module'=> ClassFinder::ModuleType($module)) + $args; $guard = new UserGuard(); $user = $guard->GetUser(); if (!$user) { throw new \Exception('Security breach on ajax url: no bac...
php
static function AjaxUrl(ModuleBase $module, array $args = array()) { $allArgs = array('module'=> ClassFinder::ModuleType($module)) + $args; $guard = new UserGuard(); $user = $guard->GetUser(); if (!$user) { throw new \Exception('Security breach on ajax url: no bac...
[ "static", "function", "AjaxUrl", "(", "ModuleBase", "$", "module", ",", "array", "$", "args", "=", "array", "(", ")", ")", "{", "$", "allArgs", "=", "array", "(", "'module'", "=>", "ClassFinder", "::", "ModuleType", "(", "$", "module", ")", ")", "+", ...
Returns the url to ab ajax module whose content is rendered as is @param ModuleBase $module The module @param array $args The url parameters @return string Returns the ajax url
[ "Returns", "the", "url", "to", "ab", "ajax", "module", "whose", "content", "is", "rendered", "as", "is" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Routing/BackendRouter.php#L33-L44
train
agentmedia/phine-core
src/Core/Logic/Routing/BackendRouter.php
BackendRouter.ContentTreeUrl
static function ContentTreeUrl(Content $content) { $args = array(); $pageContent = $content->GetPageContent(); if ($pageContent) { $args['page'] = $pageContent->GetPage()->GetID(); $args['area'] = $pageContent->GetArea()->GetID(); return self::Modu...
php
static function ContentTreeUrl(Content $content) { $args = array(); $pageContent = $content->GetPageContent(); if ($pageContent) { $args['page'] = $pageContent->GetPage()->GetID(); $args['area'] = $pageContent->GetArea()->GetID(); return self::Modu...
[ "static", "function", "ContentTreeUrl", "(", "Content", "$", "content", ")", "{", "$", "args", "=", "array", "(", ")", ";", "$", "pageContent", "=", "$", "content", "->", "GetPageContent", "(", ")", ";", "if", "(", "$", "pageContent", ")", "{", "$", ...
Gets the url of the content tree for a content element @param Content $content @return string
[ "Gets", "the", "url", "of", "the", "content", "tree", "for", "a", "content", "element" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Logic/Routing/BackendRouter.php#L61-L83
train
bytic/orm
src/Traits/Relations/HasRelationsRecordsTrait.php
HasRelationsRecordsTrait.setRelation
public function setRelation($relation, $value) { $this->checkInitRelations(); $this->relations[$relation] = $value; return $this; }
php
public function setRelation($relation, $value) { $this->checkInitRelations(); $this->relations[$relation] = $value; return $this; }
[ "public", "function", "setRelation", "(", "$", "relation", ",", "$", "value", ")", "{", "$", "this", "->", "checkInitRelations", "(", ")", ";", "$", "this", "->", "relations", "[", "$", "relation", "]", "=", "$", "value", ";", "return", "$", "this", ...
Set the specific relationship in the model. @param string $relation @param mixed $value @return $this @throws \Exception
[ "Set", "the", "specific", "relationship", "in", "the", "model", "." ]
8d9a79b47761af0bfd9b8d1d28c83221dcac0de0
https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Traits/Relations/HasRelationsRecordsTrait.php#L233-L239
train
libreworks/caridea-dao
src/Doctrine2.php
Doctrine2.doExecute
protected function doExecute(\Closure $cb) { try { return $cb($this->manager); } catch (\Exception $e) { throw Exception\Translator\Doctrine::translate($e); } }
php
protected function doExecute(\Closure $cb) { try { return $cb($this->manager); } catch (\Exception $e) { throw Exception\Translator\Doctrine::translate($e); } }
[ "protected", "function", "doExecute", "(", "\\", "Closure", "$", "cb", ")", "{", "try", "{", "return", "$", "cb", "(", "$", "this", "->", "manager", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "e", ")", "{", "throw", "Exception", "\\", "Tr...
Executes something in the context of the entityManager. Exceptions are caught and translated. @param Closure $cb The closure to execute, takes the entityManager @return mixed whatever the function returns, this method also returns @throws \Caridea\Dao\Exception If a database problem occurs @see \Caridea\Dao\Exception...
[ "Executes", "something", "in", "the", "context", "of", "the", "entityManager", "." ]
22c2fc81f63050ad23f7b0c40e430ff026e1e767
https://github.com/libreworks/caridea-dao/blob/22c2fc81f63050ad23f7b0c40e430ff026e1e767/src/Doctrine2.php#L71-L78
train
libreworks/caridea-dao
src/Doctrine2.php
Doctrine2.doExecuteInRepository
protected function doExecuteInRepository(\Closure $cb) { try { return $cb($this->repository); } catch (\Exception $e) { throw Exception\Translator\Doctrine::translate($e); } }
php
protected function doExecuteInRepository(\Closure $cb) { try { return $cb($this->repository); } catch (\Exception $e) { throw Exception\Translator\Doctrine::translate($e); } }
[ "protected", "function", "doExecuteInRepository", "(", "\\", "Closure", "$", "cb", ")", "{", "try", "{", "return", "$", "cb", "(", "$", "this", "->", "repository", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "e", ")", "{", "throw", "Exception"...
Executes something in the context of the entityRepository. Exceptions are caught and translated. @param Closure $cb The closure to execute, takes the entityRepository @return mixed whatever the function returns, this method also returns @throws \Caridea\Dao\Exception If a database problem occurs @see \Caridea\Dao\Exc...
[ "Executes", "something", "in", "the", "context", "of", "the", "entityRepository", "." ]
22c2fc81f63050ad23f7b0c40e430ff026e1e767
https://github.com/libreworks/caridea-dao/blob/22c2fc81f63050ad23f7b0c40e430ff026e1e767/src/Doctrine2.php#L90-L97
train
TuumPHP/View
src/Section.php
Section.saveAs
public function saveAs($name) { $this->section_data[$name] = ob_get_clean(); $this->ob_level--; if ($this->ob_level) { echo $this->section_data[$name]; } }
php
public function saveAs($name) { $this->section_data[$name] = ob_get_clean(); $this->ob_level--; if ($this->ob_level) { echo $this->section_data[$name]; } }
[ "public", "function", "saveAs", "(", "$", "name", ")", "{", "$", "this", "->", "section_data", "[", "$", "name", "]", "=", "ob_get_clean", "(", ")", ";", "$", "this", "->", "ob_level", "--", ";", "if", "(", "$", "this", "->", "ob_level", ")", "{", ...
end capture with name. @param $name
[ "end", "capture", "with", "name", "." ]
b82b20d7b8ee66b2bdbe4eb0d95fabd9bafe4b21
https://github.com/TuumPHP/View/blob/b82b20d7b8ee66b2bdbe4eb0d95fabd9bafe4b21/src/Section.php#L35-L42
train
zarathustra323/modlr-data
src/Zarathustra/ModlrData/Metadata/Cache/CacheWarmer.php
CacheWarmer.warm
public function warm() { $warmed = []; if (false === $this->mf->hasCache()) { return $warmed; } $this->clear(); foreach ($this->mf->getAllTypeNames() as $type) { $metadata = $this->mf->getMetadataForType($type); $warmed[] = $type; ...
php
public function warm() { $warmed = []; if (false === $this->mf->hasCache()) { return $warmed; } $this->clear(); foreach ($this->mf->getAllTypeNames() as $type) { $metadata = $this->mf->getMetadataForType($type); $warmed[] = $type; ...
[ "public", "function", "warm", "(", ")", "{", "$", "warmed", "=", "[", "]", ";", "if", "(", "false", "===", "$", "this", "->", "mf", "->", "hasCache", "(", ")", ")", "{", "return", "$", "warmed", ";", "}", "$", "this", "->", "clear", "(", ")", ...
Warms up all metadata objects into the cache. @return array
[ "Warms", "up", "all", "metadata", "objects", "into", "the", "cache", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/Cache/CacheWarmer.php#L37-L50
train
zarathustra323/modlr-data
src/Zarathustra/ModlrData/Metadata/Cache/CacheWarmer.php
CacheWarmer.clear
public function clear() { $cleared = []; if (false === $this->mf->hasCache()) { return $cleared; } $this->mf->enableCache(false); foreach ($this->mf->getAllTypeNames() as $type) { $metadata = $this->mf->getMetadataForType($type); $this->mf...
php
public function clear() { $cleared = []; if (false === $this->mf->hasCache()) { return $cleared; } $this->mf->enableCache(false); foreach ($this->mf->getAllTypeNames() as $type) { $metadata = $this->mf->getMetadataForType($type); $this->mf...
[ "public", "function", "clear", "(", ")", "{", "$", "cleared", "=", "[", "]", ";", "if", "(", "false", "===", "$", "this", "->", "mf", "->", "hasCache", "(", ")", ")", "{", "return", "$", "cleared", ";", "}", "$", "this", "->", "mf", "->", "enab...
Clears all metadata objects from the cache. @return self
[ "Clears", "all", "metadata", "objects", "from", "the", "cache", "." ]
7c2c767216055f75abf8cf22e2200f11998ed24e
https://github.com/zarathustra323/modlr-data/blob/7c2c767216055f75abf8cf22e2200f11998ed24e/src/Zarathustra/ModlrData/Metadata/Cache/CacheWarmer.php#L57-L73
train
Hnto/nuki
src/Models/Data/File.php
File.setName
public function setName($name = false) { if ($name === false || empty($name)) { $this->name = \Nuki\Handlers\Core\Assist::randomString(); return; } $this->name = $name; }
php
public function setName($name = false) { if ($name === false || empty($name)) { $this->name = \Nuki\Handlers\Core\Assist::randomString(); return; } $this->name = $name; }
[ "public", "function", "setName", "(", "$", "name", "=", "false", ")", "{", "if", "(", "$", "name", "===", "false", "||", "empty", "(", "$", "name", ")", ")", "{", "$", "this", "->", "name", "=", "\\", "Nuki", "\\", "Handlers", "\\", "Core", "\\",...
Set file name if name not give, it will be generated @param string|bool $name @return void
[ "Set", "file", "name", "if", "name", "not", "give", "it", "will", "be", "generated" ]
c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c
https://github.com/Hnto/nuki/blob/c3fb16244e8d611c335a88e3b9c9ee7d81fafc0c/src/Models/Data/File.php#L80-L87
train
Talesoft/tale-framework
src/Tale/Cache/Adapter/File.php
File.init
protected function init() { $this->prependOptions([ 'path' => './cache', 'formatAliases' => [], 'format' => 'json' ]); $this->_path = $this->getOption('path'); $this->_formatFactory = new Factory(__NAMESPACE__.'\\File\\FormatBase', [ ...
php
protected function init() { $this->prependOptions([ 'path' => './cache', 'formatAliases' => [], 'format' => 'json' ]); $this->_path = $this->getOption('path'); $this->_formatFactory = new Factory(__NAMESPACE__.'\\File\\FormatBase', [ ...
[ "protected", "function", "init", "(", ")", "{", "$", "this", "->", "prependOptions", "(", "[", "'path'", "=>", "'./cache'", ",", "'formatAliases'", "=>", "[", "]", ",", "'format'", "=>", "'json'", "]", ")", ";", "$", "this", "->", "_path", "=", "$", ...
Initializes the file cache adapter
[ "Initializes", "the", "file", "cache", "adapter" ]
739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49
https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Cache/Adapter/File.php#L50-L74
train
Talesoft/tale-framework
src/Tale/Cache/Adapter/File.php
File.exists
public function exists($key) { $path = $this->getKeyPath($key); if (!file_exists($path) || empty($this->_lifeTimes[$key])) return false; if (time() - filemtime($path) > $this->_lifeTimes[$key]) return false; return true; }
php
public function exists($key) { $path = $this->getKeyPath($key); if (!file_exists($path) || empty($this->_lifeTimes[$key])) return false; if (time() - filemtime($path) > $this->_lifeTimes[$key]) return false; return true; }
[ "public", "function", "exists", "(", "$", "key", ")", "{", "$", "path", "=", "$", "this", "->", "getKeyPath", "(", "$", "key", ")", ";", "if", "(", "!", "file_exists", "(", "$", "path", ")", "||", "empty", "(", "$", "this", "->", "_lifeTimes", "[...
Checks if the given cache key has an existing cache file that didn't exceed the given life-time @param $key string The key that needs to be checked @return bool
[ "Checks", "if", "the", "given", "cache", "key", "has", "an", "existing", "cache", "file", "that", "didn", "t", "exceed", "the", "given", "life", "-", "time" ]
739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49
https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Cache/Adapter/File.php#L111-L123
train
Talesoft/tale-framework
src/Tale/Cache/Adapter/File.php
File.set
public function set($key, $value, $lifeTime) { $path = $this->getKeyPath($key); $dir = dirname($path); if (!is_dir($dir)) mkdir($dir, 0777, true); $this->_lifeTimes[$key] = intval($lifeTime); //Save the life times $this->_format->save($this->_lifeTimeP...
php
public function set($key, $value, $lifeTime) { $path = $this->getKeyPath($key); $dir = dirname($path); if (!is_dir($dir)) mkdir($dir, 0777, true); $this->_lifeTimes[$key] = intval($lifeTime); //Save the life times $this->_format->save($this->_lifeTimeP...
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ",", "$", "lifeTime", ")", "{", "$", "path", "=", "$", "this", "->", "getKeyPath", "(", "$", "key", ")", ";", "$", "dir", "=", "dirname", "(", "$", "path", ")", ";", "if", "(", ...
Sets the value of an cache item to the given value @param $key string The key that needs to be checked @param $value mixed The value that needs to be cached @param $lifeTime int The life-time of the cache item in seconds @return $this
[ "Sets", "the", "value", "of", "an", "cache", "item", "to", "the", "given", "value" ]
739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49
https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Cache/Adapter/File.php#L147-L165
train
koolkode/view-express
src/DecoratedTemplate.php
DecoratedTemplate.renderBlock
public function renderBlock(OutputBuffer $out, $name) { if(array_key_exists($name, $this->blocks)) { $pblock = $this->outerContext->set('@block', $name); $pout = $this->outerContext->set('@out', $out); $pthis = $this->outerContext->set('@this', $this); try { $this->blocks[$name]($out); ...
php
public function renderBlock(OutputBuffer $out, $name) { if(array_key_exists($name, $this->blocks)) { $pblock = $this->outerContext->set('@block', $name); $pout = $this->outerContext->set('@out', $out); $pthis = $this->outerContext->set('@this', $this); try { $this->blocks[$name]($out); ...
[ "public", "function", "renderBlock", "(", "OutputBuffer", "$", "out", ",", "$", "name", ")", "{", "if", "(", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "blocks", ")", ")", "{", "$", "pblock", "=", "$", "this", "->", "outerContext", ...
Render contents of block taking blocks from the decorator into consideration. @param OutputBuffer $out @param string $name The name of the block to be rendered.
[ "Render", "contents", "of", "block", "taking", "blocks", "from", "the", "decorator", "into", "consideration", "." ]
a8ebe6f373b6bfe8b8818d6264535e8fe063a596
https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/DecoratedTemplate.php#L117-L140
train
koolkode/view-express
src/DecoratedTemplate.php
DecoratedTemplate.renderParentBlock
public function renderParentBlock(OutputBuffer $out, $name) { $method = 'block_' . $name; if(method_exists($this, $method)) { return $this->$method($out); } return parent::renderParentBlock($out, $name); }
php
public function renderParentBlock(OutputBuffer $out, $name) { $method = 'block_' . $name; if(method_exists($this, $method)) { return $this->$method($out); } return parent::renderParentBlock($out, $name); }
[ "public", "function", "renderParentBlock", "(", "OutputBuffer", "$", "out", ",", "$", "name", ")", "{", "$", "method", "=", "'block_'", ".", "$", "name", ";", "if", "(", "method_exists", "(", "$", "this", ",", "$", "method", ")", ")", "{", "return", ...
Render contents of a block in the parent view taking block from the decorator into consideration. @param OutputBuffer $out @param string $name The name of the block to be rendered.
[ "Render", "contents", "of", "a", "block", "in", "the", "parent", "view", "taking", "block", "from", "the", "decorator", "into", "consideration", "." ]
a8ebe6f373b6bfe8b8818d6264535e8fe063a596
https://github.com/koolkode/view-express/blob/a8ebe6f373b6bfe8b8818d6264535e8fe063a596/src/DecoratedTemplate.php#L148-L158
train
Torann/skosh-generator
src/Config.php
Config.load
private function load($env = 'local', $file = 'config') { $path = BASE_PATH . ($file === '.env' ? '' : '/config'); // File paths $configPath = "{$path}/{$file}.yml"; $envConfigPath = "{$path}/{$file}_{$env}.yml"; if (!file_exists($configPath)) { throw new \Excep...
php
private function load($env = 'local', $file = 'config') { $path = BASE_PATH . ($file === '.env' ? '' : '/config'); // File paths $configPath = "{$path}/{$file}.yml"; $envConfigPath = "{$path}/{$file}_{$env}.yml"; if (!file_exists($configPath)) { throw new \Excep...
[ "private", "function", "load", "(", "$", "env", "=", "'local'", ",", "$", "file", "=", "'config'", ")", "{", "$", "path", "=", "BASE_PATH", ".", "(", "$", "file", "===", "'.env'", "?", "''", ":", "'/config'", ")", ";", "// File paths", "$", "configPa...
Loads and parses the config file @param string $env Environment @param string $file Config filename @return void @throws \Exception
[ "Loads", "and", "parses", "the", "config", "file" ]
ea60e037d92398d7c146eb2349735d5692e3c48c
https://github.com/Torann/skosh-generator/blob/ea60e037d92398d7c146eb2349735d5692e3c48c/src/Config.php#L58-L94
train
ekyna/SettingBundle
DependencyInjection/TinymceConfiguration.php
TinymceConfiguration.build
public function build(array $config) { $contentCss = [ '/css/admin-helper.css', '/bundles/ekynacore/css/tinymce-content.css', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800', ]; if (...
php
public function build(array $config) { $contentCss = [ '/css/admin-helper.css', '/bundles/ekynacore/css/tinymce-content.css', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800', ]; if (...
[ "public", "function", "build", "(", "array", "$", "config", ")", "{", "$", "contentCss", "=", "[", "'/css/admin-helper.css'", ",", "'/bundles/ekynacore/css/tinymce-content.css'", ",", "'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800ital...
Builds the tinymce configuration. @param array $config @return array
[ "Builds", "the", "tinymce", "configuration", "." ]
df58f83eb3a01ef56cd76ea73639322c581e75c1
https://github.com/ekyna/SettingBundle/blob/df58f83eb3a01ef56cd76ea73639322c581e75c1/DependencyInjection/TinymceConfiguration.php#L18-L55
train
eskirex/session
src/Traits/SessionTrait.php
SessionTrait.changeCurrentId
protected function changeCurrentId($newId) { if (!preg_match('/^[-,a-zA-Z0-9]{1,128}$/', $newId)) { throw new InvalidArgumentException('Invalid Session ID String'); } if (session_id($newId) === false) { throw new SessionRuntimeException('session_id Failed'); ...
php
protected function changeCurrentId($newId) { if (!preg_match('/^[-,a-zA-Z0-9]{1,128}$/', $newId)) { throw new InvalidArgumentException('Invalid Session ID String'); } if (session_id($newId) === false) { throw new SessionRuntimeException('session_id Failed'); ...
[ "protected", "function", "changeCurrentId", "(", "$", "newId", ")", "{", "if", "(", "!", "preg_match", "(", "'/^[-,a-zA-Z0-9]{1,128}$/'", ",", "$", "newId", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "'Invalid Session ID String'", ")", ";", ...
Set session id @param $newId @return bool @throws InvalidArgumentException @throws SessionRuntimeException
[ "Set", "session", "id" ]
3da2ca8c83d3c124b16fee2ad45c8e967c87cd63
https://github.com/eskirex/session/blob/3da2ca8c83d3c124b16fee2ad45c8e967c87cd63/src/Traits/SessionTrait.php#L170-L181
train
betasyntax/Betasyntax-Framework-Core
src/Betasyntax/Session.php
Session.getInstance
public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new self; } self::$instance->startSession(); return self::$instance; }
php
public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new self; } self::$instance->startSession(); return self::$instance; }
[ "public", "static", "function", "getInstance", "(", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "instance", ")", ")", "{", "self", "::", "$", "instance", "=", "new", "self", ";", "}", "self", "::", "$", "instance", "->", "startSession"...
Returns THE instance of 'Session'. The session is automatically initialized if it wasn't. @return object
[ "Returns", "THE", "instance", "of", "Session", ".", "The", "session", "is", "automatically", "initialized", "if", "it", "wasn", "t", "." ]
2d135ec1f7dd98e6ef21512a069ac2595f1eb78e
https://github.com/betasyntax/Betasyntax-Framework-Core/blob/2d135ec1f7dd98e6ef21512a069ac2595f1eb78e/src/Betasyntax/Session.php#L25-L32
train
betasyntax/Betasyntax-Framework-Core
src/Betasyntax/Session.php
Session.destroy
public function destroy() { if ($this->sessionState == self::SESSION_STARTED) { $_SESSION=array(); $this->sessionState = !session_destroy(); unset($_SESSION); return !$this->sessionState; } return FALSE; }
php
public function destroy() { if ($this->sessionState == self::SESSION_STARTED) { $_SESSION=array(); $this->sessionState = !session_destroy(); unset($_SESSION); return !$this->sessionState; } return FALSE; }
[ "public", "function", "destroy", "(", ")", "{", "if", "(", "$", "this", "->", "sessionState", "==", "self", "::", "SESSION_STARTED", ")", "{", "$", "_SESSION", "=", "array", "(", ")", ";", "$", "this", "->", "sessionState", "=", "!", "session_destroy", ...
Destroys the current session. @return bool TRUE is session has been deleted, else FALSE.
[ "Destroys", "the", "current", "session", "." ]
2d135ec1f7dd98e6ef21512a069ac2595f1eb78e
https://github.com/betasyntax/Betasyntax-Framework-Core/blob/2d135ec1f7dd98e6ef21512a069ac2595f1eb78e/src/Betasyntax/Session.php#L92-L101
train
squareproton/Bond
src/Bond/Entity/Sort.php
Sort.generateByPropertyClosure
public static function generateByPropertyClosure( $property, $direction = SORT_ASC ) { if( $direction === SORT_DESC ) { $aLTb = 1; $aGTb = -1; } else { $aLTb = -1; $aGTb = 1; } return function ( \Bond\Entity\Base $a, \Bond\Entity\Base...
php
public static function generateByPropertyClosure( $property, $direction = SORT_ASC ) { if( $direction === SORT_DESC ) { $aLTb = 1; $aGTb = -1; } else { $aLTb = -1; $aGTb = 1; } return function ( \Bond\Entity\Base $a, \Bond\Entity\Base...
[ "public", "static", "function", "generateByPropertyClosure", "(", "$", "property", ",", "$", "direction", "=", "SORT_ASC", ")", "{", "if", "(", "$", "direction", "===", "SORT_DESC", ")", "{", "$", "aLTb", "=", "1", ";", "$", "aGTb", "=", "-", "1", ";",...
Generate a sort by property callback @param string $property property to sort by
[ "Generate", "a", "sort", "by", "property", "callback" ]
a04ad9dd1a35adeaec98237716c2a41ce02b4f1a
https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Entity/Sort.php#L19-L39
train
agentmedia/phine-core
src/Core/Snippets/BackendRights/PageRights.php
PageRights.Save
function Save() { $this->contentRights->Save(); if (!$this->rights) { $this->rights = new BackendPageRights(); } $this->rights->SetCreateIn($this->Value('CreateIn')); $this->rights->SetEdit($this->Value('Edit')); $this->rights->SetMove($this->Value...
php
function Save() { $this->contentRights->Save(); if (!$this->rights) { $this->rights = new BackendPageRights(); } $this->rights->SetCreateIn($this->Value('CreateIn')); $this->rights->SetEdit($this->Value('Edit')); $this->rights->SetMove($this->Value...
[ "function", "Save", "(", ")", "{", "$", "this", "->", "contentRights", "->", "Save", "(", ")", ";", "if", "(", "!", "$", "this", "->", "rights", ")", "{", "$", "this", "->", "rights", "=", "new", "BackendPageRights", "(", ")", ";", "}", "$", "thi...
Saves the page rights
[ "Saves", "the", "page", "rights" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/BackendRights/PageRights.php#L49-L62
train
AppVerk/Components
Form/Handler/AbstractFormHandler.php
AbstractFormHandler.getErrorsFromForm
protected function getErrorsFromForm(FormInterface $form) { $errors = []; /** @var FormError $error */ if($form->getErrors()->count() === 0 && $form->isRoot() && !$form->isValid()){ $errors["_self"] = "Empty post data"; } foreach ($form->getErrors() as $error) {...
php
protected function getErrorsFromForm(FormInterface $form) { $errors = []; /** @var FormError $error */ if($form->getErrors()->count() === 0 && $form->isRoot() && !$form->isValid()){ $errors["_self"] = "Empty post data"; } foreach ($form->getErrors() as $error) {...
[ "protected", "function", "getErrorsFromForm", "(", "FormInterface", "$", "form", ")", "{", "$", "errors", "=", "[", "]", ";", "/** @var FormError $error */", "if", "(", "$", "form", "->", "getErrors", "(", ")", "->", "count", "(", ")", "===", "0", "&&", ...
Build inheritance form errors @param FormInterface $form @return array
[ "Build", "inheritance", "form", "errors" ]
979e613388e5ea8a5858455c34ed22035635277e
https://github.com/AppVerk/Components/blob/979e613388e5ea8a5858455c34ed22035635277e/Form/Handler/AbstractFormHandler.php#L96-L120
train
koolkode/config
src/ConfigurationSource.php
ConfigurationSource.loadConfiguration
public function loadConfiguration(ConfigurationLoader $loader, array $params = []) { try { $data = $loader->findLoader($this->source)->load($this->source, $params); return new Configuration($this->createBase($data)); } catch(\Exception $e) { throw new ConfigurationLoadingException(sprintf('Unabl...
php
public function loadConfiguration(ConfigurationLoader $loader, array $params = []) { try { $data = $loader->findLoader($this->source)->load($this->source, $params); return new Configuration($this->createBase($data)); } catch(\Exception $e) { throw new ConfigurationLoadingException(sprintf('Unabl...
[ "public", "function", "loadConfiguration", "(", "ConfigurationLoader", "$", "loader", ",", "array", "$", "params", "=", "[", "]", ")", "{", "try", "{", "$", "data", "=", "$", "loader", "->", "findLoader", "(", "$", "this", "->", "source", ")", "->", "l...
Load configuration data from the source. @param ConfigurationLoader $loader @param array<string, mixed> $params @return Configuration @throws ConfigurationLoadingException
[ "Load", "configuration", "data", "from", "the", "source", "." ]
ad97d80f6e4ae5f8925839488abf2d9bfcb6d7f6
https://github.com/koolkode/config/blob/ad97d80f6e4ae5f8925839488abf2d9bfcb6d7f6/src/ConfigurationSource.php#L69-L81
train
spress/spress-core
ContentManager/Permalink/PermalinkGenerator.php
PermalinkGenerator.getPermalink
public function getPermalink(ItemInterface $item) { if ($item->getPath(ItemInterface::SNAPSHOT_PATH_RELATIVE_AFTER_CONVERT) === '') { return new Permalink('', ''); } $placeholders = $this->getPlacehoders($item); $permalinkStyle = $this->getPermalinkAttribute($item); ...
php
public function getPermalink(ItemInterface $item) { if ($item->getPath(ItemInterface::SNAPSHOT_PATH_RELATIVE_AFTER_CONVERT) === '') { return new Permalink('', ''); } $placeholders = $this->getPlacehoders($item); $permalinkStyle = $this->getPermalinkAttribute($item); ...
[ "public", "function", "getPermalink", "(", "ItemInterface", "$", "item", ")", "{", "if", "(", "$", "item", "->", "getPath", "(", "ItemInterface", "::", "SNAPSHOT_PATH_RELATIVE_AFTER_CONVERT", ")", "===", "''", ")", "{", "return", "new", "Permalink", "(", "''",...
Gets a permalink. This method uses the SNAPSHOT_PATH_RELATIVE_AFTER_CONVERT of Item path. For binary items URL path and path point to SNAPSHOT_PATH_RELATIVE. Item's attributes with special meaning: - title: title of the item. - title_path: title extracted from the date filename pattern. - preserve_path_title: if true...
[ "Gets", "a", "permalink", ".", "This", "method", "uses", "the", "SNAPSHOT_PATH_RELATIVE_AFTER_CONVERT", "of", "Item", "path", "." ]
a61008c4cde3ba990e7faa164462171b019a60bf
https://github.com/spress/spress-core/blob/a61008c4cde3ba990e7faa164462171b019a60bf/ContentManager/Permalink/PermalinkGenerator.php#L107-L177
train
DoSomething/mb-stat-tracker
src/StatHat.php
StatHat.reportCount
public function reportCount($count) { $statName = $this->prefix . $this->statNames; if ($this->isProduction) { stathat_ez_count($this->ezkey, $statName, $count); } }
php
public function reportCount($count) { $statName = $this->prefix . $this->statNames; if ($this->isProduction) { stathat_ez_count($this->ezkey, $statName, $count); } }
[ "public", "function", "reportCount", "(", "$", "count", ")", "{", "$", "statName", "=", "$", "this", "->", "prefix", ".", "$", "this", "->", "statNames", ";", "if", "(", "$", "this", "->", "isProduction", ")", "{", "stathat_ez_count", "(", "$", "this",...
Reports a count to the StatHat API. @param int $count The count to report.
[ "Reports", "a", "count", "to", "the", "StatHat", "API", "." ]
14a8caef9128661e77492d61a09c06dd5a7ca611
https://github.com/DoSomething/mb-stat-tracker/blob/14a8caef9128661e77492d61a09c06dd5a7ca611/src/StatHat.php#L86-L91
train
DoSomething/mb-stat-tracker
src/StatHat.php
StatHat.reportValue
public function reportValue($value) { $statName = $this->prefix . $this->statNames; if ($this->isProduction) { stathat_ez_value($this->ezkey, $statName, $value); } }
php
public function reportValue($value) { $statName = $this->prefix . $this->statNames; if ($this->isProduction) { stathat_ez_value($this->ezkey, $statName, $value); } }
[ "public", "function", "reportValue", "(", "$", "value", ")", "{", "$", "statName", "=", "$", "this", "->", "prefix", ".", "$", "this", "->", "statNames", ";", "if", "(", "$", "this", "->", "isProduction", ")", "{", "stathat_ez_value", "(", "$", "this",...
Reports a value to the StatHat API. @param int $value The value to report.
[ "Reports", "a", "value", "to", "the", "StatHat", "API", "." ]
14a8caef9128661e77492d61a09c06dd5a7ca611
https://github.com/DoSomething/mb-stat-tracker/blob/14a8caef9128661e77492d61a09c06dd5a7ca611/src/StatHat.php#L99-L104
train
Wedeto/Util
src/Hook.php
Hook.subscribe
public static function subscribe(string $hook, callable $callback, int $precedence = 0) { $parts = explode(".", $hook); if (count($parts) < 2) throw new InvalidArgumentException("Hook name must consist of at least two parts"); if ($hook === Hook::SHUTDOWN_HOOK) self:...
php
public static function subscribe(string $hook, callable $callback, int $precedence = 0) { $parts = explode(".", $hook); if (count($parts) < 2) throw new InvalidArgumentException("Hook name must consist of at least two parts"); if ($hook === Hook::SHUTDOWN_HOOK) self:...
[ "public", "static", "function", "subscribe", "(", "string", "$", "hook", ",", "callable", "$", "callback", ",", "int", "$", "precedence", "=", "0", ")", "{", "$", "parts", "=", "explode", "(", "\".\"", ",", "$", "hook", ")", ";", "if", "(", "count", ...
Subscribe to a hook. @param string $hook The hook to hook into. Must contain of at least 2 parts separated by dots: vendor.hookname @param callable $callback The callback that will be called when the hook is executed. The function should have the following signature: function (Dictionary $params); @param int $precede...
[ "Subscribe", "to", "a", "hook", "." ]
0e080251bbaa8e7d91ae8d02eb79c029c976744a
https://github.com/Wedeto/Util/blob/0e080251bbaa8e7d91ae8d02eb79c029c976744a/src/Hook.php#L98-L131
train