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
nabu-3/core
nabu/data/security/base/CNabuRoleBase.php
CNabuRoleBase.setRoot
public function setRoot(string $root = "F") : CNabuDataObject { if ($root === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$root") ); } $this->setValue('nb_role_root', $root); return $this; }
php
public function setRoot(string $root = "F") : CNabuDataObject { if ($root === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$root") ); } $this->setValue('nb_role_root', $root); return $this; }
[ "public", "function", "setRoot", "(", "string", "$", "root", "=", "\"F\"", ")", ":", "CNabuDataObject", "{", "if", "(", "$", "root", "===", "null", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", "::", "ERROR_NULL_VALUE_NOT_ALLOWED_IN"...
Sets the Role Root attribute value. @param string $root New value for attribute @return CNabuDataObject Returns self instance to grant chained setters call.
[ "Sets", "the", "Role", "Root", "attribute", "value", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/security/base/CNabuRoleBase.php#L449-L460
train
rips/php-connector-bundle
Hydrators/Application/Scan/Issue/PatchHydrator.php
PatchHydrator.hydrateCollection
public static function hydrateCollection(array $patches) { $hydrated = []; foreach ($patches as $patch) { $hydrated[] = self::hydrate($patch); } return $hydrated; }
php
public static function hydrateCollection(array $patches) { $hydrated = []; foreach ($patches as $patch) { $hydrated[] = self::hydrate($patch); } return $hydrated; }
[ "public", "static", "function", "hydrateCollection", "(", "array", "$", "patches", ")", "{", "$", "hydrated", "=", "[", "]", ";", "foreach", "(", "$", "patches", "as", "$", "patch", ")", "{", "$", "hydrated", "[", "]", "=", "self", "::", "hydrate", "...
Hydrate a collection of patch objects into a collection of PatchEntity objects @param stdClass[] $patches @return PatchEntity[]
[ "Hydrate", "a", "collection", "of", "patch", "objects", "into", "a", "collection", "of", "PatchEntity", "objects" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/Application/Scan/Issue/PatchHydrator.php#L19-L28
train
nabu-3/core
nabu/data/site/CNabuSiteTargetSection.php
CNabuSiteTargetSection.getSiteTargetSections
static public function getSiteTargetSections($nb_site_target) { $nb_site_target_id = nb_getMixedValue($nb_site_target, 'nb_site_target_id'); if (is_numeric($nb_site_target_id)) { $retval = CNabuSiteTargetSection::buildObjectListFromSQL( 'nb_site_target_section_id', 'select * ' . 'from nb_site_target_section ' . 'where nb_site_target_id=%target_id$d ' . 'order by nb_site_target_section_order', array( 'target_id' => $nb_site_target_id ) ); if ($nb_site_target instanceof CNabuSiteTarget) { $retval->iterate(function($key, $nb_site_target_section) use ($nb_site_target) { $nb_site_target_section->setSiteTarget($nb_site_target); return true; }); } } else { $retval = new CNabuSiteTargetSectionList(); } return $retval; }
php
static public function getSiteTargetSections($nb_site_target) { $nb_site_target_id = nb_getMixedValue($nb_site_target, 'nb_site_target_id'); if (is_numeric($nb_site_target_id)) { $retval = CNabuSiteTargetSection::buildObjectListFromSQL( 'nb_site_target_section_id', 'select * ' . 'from nb_site_target_section ' . 'where nb_site_target_id=%target_id$d ' . 'order by nb_site_target_section_order', array( 'target_id' => $nb_site_target_id ) ); if ($nb_site_target instanceof CNabuSiteTarget) { $retval->iterate(function($key, $nb_site_target_section) use ($nb_site_target) { $nb_site_target_section->setSiteTarget($nb_site_target); return true; }); } } else { $retval = new CNabuSiteTargetSectionList(); } return $retval; }
[ "static", "public", "function", "getSiteTargetSections", "(", "$", "nb_site_target", ")", "{", "$", "nb_site_target_id", "=", "nb_getMixedValue", "(", "$", "nb_site_target", ",", "'nb_site_target_id'", ")", ";", "if", "(", "is_numeric", "(", "$", "nb_site_target_id"...
Gets entire collection of Section instances of a Site Target. @param mixed $nb_site_target A Site Target instance, an object containing a Site Target Id, or an Id. @return CNabuSiteTargetSectionList Returns a CNabuSiteTargetSectionList instance containing located Sections for $nb_site_target.
[ "Gets", "entire", "collection", "of", "Section", "instances", "of", "a", "Site", "Target", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/CNabuSiteTargetSection.php#L39-L64
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.registerApplication
public function registerApplication(INabuApplication $nb_application) { if ($this->nb_application !== null) { throw new ENabuCoreException(ENabuCoreException::ERROR_RUNNING_APPLICATION); } $this->nb_application = $nb_application; $this->nb_provider_factory->registerApplication($this->nb_application); }
php
public function registerApplication(INabuApplication $nb_application) { if ($this->nb_application !== null) { throw new ENabuCoreException(ENabuCoreException::ERROR_RUNNING_APPLICATION); } $this->nb_application = $nb_application; $this->nb_provider_factory->registerApplication($this->nb_application); }
[ "public", "function", "registerApplication", "(", "INabuApplication", "$", "nb_application", ")", "{", "if", "(", "$", "this", "->", "nb_application", "!==", "null", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", "::", "ERROR_RUNNING_APPL...
Set the running application. @param INabuApplication $nb_application @throws ENabuCoreException Throws an exception if another application is already setted
[ "Set", "the", "running", "application", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L309-L317
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.getMessagingPoolManager
public function getMessagingPoolManager(bool $force = false) : CNabuMessagingPoolManager { if ($this->nb_customer instanceof CNabuCustomer) { if ($this->nb_messaging_pool_manager === null || $force) { if ($this->nb_messaging_pool_manager instanceof CNabuMessagingPoolManager) { $this->nb_messaging_pool_manager->finish(); } $this->nb_messaging_pool_manager = new CNabuMessagingPoolManager($this->nb_customer); $this->nb_messaging_pool_manager->init(); } elseif ( !(($nb_aux_customer = $this->nb_messaging_pool_manager->getCustomer()) instanceof CNabuCustomer) || $this->nb_customer->getId() !== $nb_aux_customer->getId() ) { throw new ENabuMessagingException(ENabuMessagingException::ERROR_INVALID_MESSAGING_POOL_MANAGER); } } else { throw new ENabuCoreException(ENabuCoreException::ERROR_CUSTOMER_NOT_FOUND); } return $this->nb_messaging_pool_manager; }
php
public function getMessagingPoolManager(bool $force = false) : CNabuMessagingPoolManager { if ($this->nb_customer instanceof CNabuCustomer) { if ($this->nb_messaging_pool_manager === null || $force) { if ($this->nb_messaging_pool_manager instanceof CNabuMessagingPoolManager) { $this->nb_messaging_pool_manager->finish(); } $this->nb_messaging_pool_manager = new CNabuMessagingPoolManager($this->nb_customer); $this->nb_messaging_pool_manager->init(); } elseif ( !(($nb_aux_customer = $this->nb_messaging_pool_manager->getCustomer()) instanceof CNabuCustomer) || $this->nb_customer->getId() !== $nb_aux_customer->getId() ) { throw new ENabuMessagingException(ENabuMessagingException::ERROR_INVALID_MESSAGING_POOL_MANAGER); } } else { throw new ENabuCoreException(ENabuCoreException::ERROR_CUSTOMER_NOT_FOUND); } return $this->nb_messaging_pool_manager; }
[ "public", "function", "getMessagingPoolManager", "(", "bool", "$", "force", "=", "false", ")", ":", "CNabuMessagingPoolManager", "{", "if", "(", "$", "this", "->", "nb_customer", "instanceof", "CNabuCustomer", ")", "{", "if", "(", "$", "this", "->", "nb_messag...
Gets current Messaging Pool Manager instance. If not defined, then creates one for the current Customer. @param bool $force Forces to set a new Messaging Pool Manager Instance. @return CNabuMessagingPoolManager Returns the Messaging Pool Manager. @throws ENabuCoreException Raises an exception if Customer instance is not available or not matches with @throws ENabuMessagingException Raises an exception if none Pool Manager available. the existing Messaging Pool Manager.
[ "Gets", "current", "Messaging", "Pool", "Manager", "instance", ".", "If", "not", "defined", "then", "creates", "one", "for", "the", "current", "Customer", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L344-L364
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.getRenderPoolManager
public function getRenderPoolManager(bool $force = false) : CNabuRenderPoolManager { if ($this->nb_customer instanceof CNabuCustomer) { if ($this->nb_render_pool_manager === null || $force) { if ($this->nb_render_pool_manager instanceof CNabuRenderPoolManager) { $this->nb_render_pool_manager->finish(); } $this->nb_render_pool_manager = new CNabuRenderPoolManager($this->nb_customer); $this->nb_render_pool_manager->init(); } elseif ( !(($nb_aux_customer = $this->nb_render_pool_manager->getCustomer()) instanceof CNabuCustomer) || $this->nb_customer->getId() !== $nb_aux_customer->getId() ) { throw new ENabuRenderException(ENabuRenderException::ERROR_INVALID_RENDER_POOL_MANAGER); } } else { throw new ENabuCoreException(ENabuCoreException::EROR_CUSTOMER_NOT_FOUND); } return $this->nb_render_pool_manager; }
php
public function getRenderPoolManager(bool $force = false) : CNabuRenderPoolManager { if ($this->nb_customer instanceof CNabuCustomer) { if ($this->nb_render_pool_manager === null || $force) { if ($this->nb_render_pool_manager instanceof CNabuRenderPoolManager) { $this->nb_render_pool_manager->finish(); } $this->nb_render_pool_manager = new CNabuRenderPoolManager($this->nb_customer); $this->nb_render_pool_manager->init(); } elseif ( !(($nb_aux_customer = $this->nb_render_pool_manager->getCustomer()) instanceof CNabuCustomer) || $this->nb_customer->getId() !== $nb_aux_customer->getId() ) { throw new ENabuRenderException(ENabuRenderException::ERROR_INVALID_RENDER_POOL_MANAGER); } } else { throw new ENabuCoreException(ENabuCoreException::EROR_CUSTOMER_NOT_FOUND); } return $this->nb_render_pool_manager; }
[ "public", "function", "getRenderPoolManager", "(", "bool", "$", "force", "=", "false", ")", ":", "CNabuRenderPoolManager", "{", "if", "(", "$", "this", "->", "nb_customer", "instanceof", "CNabuCustomer", ")", "{", "if", "(", "$", "this", "->", "nb_render_pool_...
Gets current Render Pool Manager instance. If not defined, then creates one for the current Customer. @param bool $force Forces to set a new Render Pool Manager instance. @return CNabuRenderPoolManager Returns the Render Pool manager. @throws ENabuCoreException Raises an exception if Customer instance is not available or not matches with the existing Render Pool Manager. @throws ENabuRenderException Raises an exception if no Pool Managers are available.
[ "Gets", "current", "Render", "Pool", "Manager", "instance", ".", "If", "not", "defined", "then", "creates", "one", "for", "the", "current", "Customer", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L374-L394
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.getHTTPServerPoolManager
public function getHTTPServerPoolManager(bool $force = false) : CNabuHTTPServerPoolManager { if ($this->nb_http_server_pool_manager === null || $force) { if ($this->nb_http_server_pool_manager instanceof CNabuHTTPServerPoolManager) { $this->nb_http_server_pool_manager->finish(); } $this->nb_http_server_pool_manager = new CNabuHTTPServerPoolManager(); $this->nb_http_server_pool_manager->init(); } return $this->nb_http_server_pool_manager; }
php
public function getHTTPServerPoolManager(bool $force = false) : CNabuHTTPServerPoolManager { if ($this->nb_http_server_pool_manager === null || $force) { if ($this->nb_http_server_pool_manager instanceof CNabuHTTPServerPoolManager) { $this->nb_http_server_pool_manager->finish(); } $this->nb_http_server_pool_manager = new CNabuHTTPServerPoolManager(); $this->nb_http_server_pool_manager->init(); } return $this->nb_http_server_pool_manager; }
[ "public", "function", "getHTTPServerPoolManager", "(", "bool", "$", "force", "=", "false", ")", ":", "CNabuHTTPServerPoolManager", "{", "if", "(", "$", "this", "->", "nb_http_server_pool_manager", "===", "null", "||", "$", "force", ")", "{", "if", "(", "$", ...
Gets current HTTP Server Pool Manager instance. If not defined, then creates one for the current Customer. @param bool $force Forces to set a new HTTP Server Pool Manager instance. @return CNabuHTTPServerPoolManager Returns the HTTP Server Pool Manager instance.
[ "Gets", "current", "HTTP", "Server", "Pool", "Manager", "instance", ".", "If", "not", "defined", "then", "creates", "one", "for", "the", "current", "Customer", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L401-L412
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.class2Filename
private function class2Filename($class_name, $php_suffix = '.php') { return DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class_name) . ($php_suffix === false ? '' : $php_suffix); }
php
private function class2Filename($class_name, $php_suffix = '.php') { return DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class_name) . ($php_suffix === false ? '' : $php_suffix); }
[ "private", "function", "class2Filename", "(", "$", "class_name", ",", "$", "php_suffix", "=", "'.php'", ")", "{", "return", "DIRECTORY_SEPARATOR", ".", "str_replace", "(", "'\\\\'", ",", "DIRECTORY_SEPARATOR", ",", "$", "class_name", ")", ".", "(", "$", "php_s...
Convert a class name with namespace path to file name with namespace translated into File System path. The returned string start with the directory separator to safe prepend a route before it. @param string $class_name Class name with namespace path @param string $php_suffix File suffix to append to file name or false if not needed. @return string Class filename with path containing full namespace route.
[ "Convert", "a", "class", "name", "with", "namespace", "path", "to", "file", "name", "with", "namespace", "translated", "into", "File", "System", "path", ".", "The", "returned", "string", "start", "with", "the", "directory", "separator", "to", "safe", "prepend"...
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L468-L473
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.init
private function init() { $this->microtime_start = microtime(true); $this->nb_os = CNabuOS::getOS(); try { $this->registerHandlers(); $this->registerProviderFactory(); } catch (ENabuException $nb_exception) { if ($this->isCLIEnvironment()) { throw $nb_exception; } else { nb_displayErrorPage(500, $nb_exception); die; } } }
php
private function init() { $this->microtime_start = microtime(true); $this->nb_os = CNabuOS::getOS(); try { $this->registerHandlers(); $this->registerProviderFactory(); } catch (ENabuException $nb_exception) { if ($this->isCLIEnvironment()) { throw $nb_exception; } else { nb_displayErrorPage(500, $nb_exception); die; } } }
[ "private", "function", "init", "(", ")", "{", "$", "this", "->", "microtime_start", "=", "microtime", "(", "true", ")", ";", "$", "this", "->", "nb_os", "=", "CNabuOS", "::", "getOS", "(", ")", ";", "try", "{", "$", "this", "->", "registerHandlers", ...
Initializes the instance. Register handlers. Register main database.
[ "Initializes", "the", "instance", ".", "Register", "handlers", ".", "Register", "main", "database", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L592-L608
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.finish
private function finish() { if ($this->main_database !== null) { $this->main_database->disconnect(); } $this->microtime_end = microtime(true); $this->microtime_elapsed = $this->microtime_end - $this->microtime_start; $this->traceLog("Execution time", sprintf("%.3f ms", $this->microtime_elapsed * 1000)); }
php
private function finish() { if ($this->main_database !== null) { $this->main_database->disconnect(); } $this->microtime_end = microtime(true); $this->microtime_elapsed = $this->microtime_end - $this->microtime_start; $this->traceLog("Execution time", sprintf("%.3f ms", $this->microtime_elapsed * 1000)); }
[ "private", "function", "finish", "(", ")", "{", "if", "(", "$", "this", "->", "main_database", "!==", "null", ")", "{", "$", "this", "->", "main_database", "->", "disconnect", "(", ")", ";", "}", "$", "this", "->", "microtime_end", "=", "microtime", "(...
Ends the instance. Takes the elapsed time between init and finish calls and closes connections to external sources.
[ "Ends", "the", "instance", ".", "Takes", "the", "elapsed", "time", "between", "init", "and", "finish", "calls", "and", "closes", "connections", "to", "external", "sources", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L614-L623
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.registerMainDatabase
private function registerMainDatabase() { $filename = NABU_ETC_PATH.DIRECTORY_SEPARATOR.NABU_DB_DEFAULT_FILENAME_CONFIG; if (!file_exists($filename) && ($file = fopen($filename, "w")) !== false) { fwrite($file, "<?php\n". "\$db_user = \"nabu-3\";\n". "\$db_passwd = \"nabu-3\";\n". "\$db_host = \"localhost:3306\";\n". "\$db_schema = \"nabu-3\";\n". "\$db_trace_query = false;\n". "?>\n" ); fclose($file); } $this->main_database = new CMySQLConnector($filename); $this->main_database->setSpaceOptimization(true); if ($this->main_database->connect()) { if (!$this->main_database->testConnection()) { //throw new exceptions\ENabuCoreException(exceptions\ENabuCoreException::ERROR_M) $this->errorLog("Database Test error: ".$this->main_database->getLastErrorMessage()); } } else { throw new ENabuDBException(ENabuDBException::ERROR_NOT_CONNECTED); } }
php
private function registerMainDatabase() { $filename = NABU_ETC_PATH.DIRECTORY_SEPARATOR.NABU_DB_DEFAULT_FILENAME_CONFIG; if (!file_exists($filename) && ($file = fopen($filename, "w")) !== false) { fwrite($file, "<?php\n". "\$db_user = \"nabu-3\";\n". "\$db_passwd = \"nabu-3\";\n". "\$db_host = \"localhost:3306\";\n". "\$db_schema = \"nabu-3\";\n". "\$db_trace_query = false;\n". "?>\n" ); fclose($file); } $this->main_database = new CMySQLConnector($filename); $this->main_database->setSpaceOptimization(true); if ($this->main_database->connect()) { if (!$this->main_database->testConnection()) { //throw new exceptions\ENabuCoreException(exceptions\ENabuCoreException::ERROR_M) $this->errorLog("Database Test error: ".$this->main_database->getLastErrorMessage()); } } else { throw new ENabuDBException(ENabuDBException::ERROR_NOT_CONNECTED); } }
[ "private", "function", "registerMainDatabase", "(", ")", "{", "$", "filename", "=", "NABU_ETC_PATH", ".", "DIRECTORY_SEPARATOR", ".", "NABU_DB_DEFAULT_FILENAME_CONFIG", ";", "if", "(", "!", "file_exists", "(", "$", "filename", ")", "&&", "(", "$", "file", "=", ...
If database configuration file does not exists then creates a default one. Instantiate the object descriptor for main database. Assumes in this version that the only database engine available for main storage is MySQL.
[ "If", "database", "configuration", "file", "does", "not", "exists", "then", "creates", "a", "default", "one", ".", "Instantiate", "the", "object", "descriptor", "for", "main", "database", ".", "Assumes", "in", "this", "version", "that", "the", "only", "databas...
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L647-L673
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.getMainDB
public function getMainDB() { if ($this->main_database === null && ($this->isOperationModeCLI() || $this->isOperationModeStandalone()) ) { $this->registerMainDatabase(); } return $this->main_database; }
php
public function getMainDB() { if ($this->main_database === null && ($this->isOperationModeCLI() || $this->isOperationModeStandalone()) ) { $this->registerMainDatabase(); } return $this->main_database; }
[ "public", "function", "getMainDB", "(", ")", "{", "if", "(", "$", "this", "->", "main_database", "===", "null", "&&", "(", "$", "this", "->", "isOperationModeCLI", "(", ")", "||", "$", "this", "->", "isOperationModeStandalone", "(", ")", ")", ")", "{", ...
Get main database connection. @return INabuDBConnector Returns the database connector instance if active or null if not
[ "Get", "main", "database", "connection", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L679-L687
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.setMainDB
public function setMainDB(INabuDBConnector $connector) { if ($this->isInstallMode()) { if ($this->main_database === null) { $this->main_database = $connector; } else { throw new ENabuCoreException(ENabuCoreException::ERROR_MAIN_DB_ALREADY_EXISTS); } } else { throw new ENabuCoreException(ENabuCoreException::ERROR_INSTALL_MODE_REQUIRED); } }
php
public function setMainDB(INabuDBConnector $connector) { if ($this->isInstallMode()) { if ($this->main_database === null) { $this->main_database = $connector; } else { throw new ENabuCoreException(ENabuCoreException::ERROR_MAIN_DB_ALREADY_EXISTS); } } else { throw new ENabuCoreException(ENabuCoreException::ERROR_INSTALL_MODE_REQUIRED); } }
[ "public", "function", "setMainDB", "(", "INabuDBConnector", "$", "connector", ")", "{", "if", "(", "$", "this", "->", "isInstallMode", "(", ")", ")", "{", "if", "(", "$", "this", "->", "main_database", "===", "null", ")", "{", "$", "this", "->", "main_...
Database connector to main Nabu database schema This method is allowed only when Engine is in install mode @param INabuDBConnector $connector Connector of database
[ "Database", "connector", "to", "main", "Nabu", "database", "schema", "This", "method", "is", "allowed", "only", "when", "Engine", "is", "in", "install", "mode" ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L694-L705
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.traceLog
public function traceLog($key, $message) { if ($this->nb_error_handler) { $this->nb_error_handler->traceLog($key, $message); } return $this; }
php
public function traceLog($key, $message) { if ($this->nb_error_handler) { $this->nb_error_handler->traceLog($key, $message); } return $this; }
[ "public", "function", "traceLog", "(", "$", "key", ",", "$", "message", ")", "{", "if", "(", "$", "this", "->", "nb_error_handler", ")", "{", "$", "this", "->", "nb_error_handler", "->", "traceLog", "(", "$", "key", ",", "$", "message", ")", ";", "}"...
If a Error Handler is defined, then propagates the trace log to the handler elsewhere do nothing. @param string $key Categorized data key identifier. @param string $message Text message to log. @return CNabuEngine Returns the self pointer to grant cascade calls.
[ "If", "a", "Error", "Handler", "is", "defined", "then", "propagates", "the", "trace", "log", "to", "the", "handler", "elsewhere", "do", "nothing", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L746-L753
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.triggerError
public function triggerError($error_message = null, $error_type = null) { if ($error_message !== null && $error_type !== null) { trigger_error($error_message, $error_type); } }
php
public function triggerError($error_message = null, $error_type = null) { if ($error_message !== null && $error_type !== null) { trigger_error($error_message, $error_type); } }
[ "public", "function", "triggerError", "(", "$", "error_message", "=", "null", ",", "$", "error_type", "=", "null", ")", "{", "if", "(", "$", "error_message", "!==", "null", "&&", "$", "error_type", "!==", "null", ")", "{", "trigger_error", "(", "$", "err...
Trigger and error using the standard PHP Error chain. @param string $error_message Error message to be triggered. @param string $error_type Error type to be triggered.
[ "Trigger", "and", "error", "using", "the", "standard", "PHP", "Error", "chain", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L760-L765
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.runApplication
public function runApplication($class_name) { $this->traceLog('Request timestamp', $this->microtime_start); try { switch (self::$operation_mode) { case self::ENGINE_MODE_STANDALONE: $this->locateHTTPServer(); $this->createBuiltInServer(); $this->createBuiltInSite(); break; case self::ENGINE_MODE_HOSTED: $this->registerMainDatabase(); $this->locateHTTPServer(); $this->createBuiltInServer(); $this->locateRunningConfiguration(); break; case self::ENGINE_MODE_CLUSTERED: $this->registerMainDatabase(); $this->locateHTTPServer(); $this->locateRunningConfiguration(); break; default: } $retval = forward_static_call(array($class_name, 'launch')); } catch (Exception $e) { $this->nb_error_handler->dumpStack( $e->getMessage(), E_CORE_ERROR, $e->getFile(), $e->getLine(), null, $e->getTrace() ); if ($this->isOperationModeStandalone() || $this->isOperationModeStored() || $this->isOperationModeClustered() ) { nb_displayErrorPage(500, $e); } $retval = false; } if (self::isInstantiated()) { self::getEngine()->finish(); /** @todo Implement CNabuEngine Dump Popup Trace action */ /** @source $nb_engine->dumpPopupTrace(); */ } return $retval; }
php
public function runApplication($class_name) { $this->traceLog('Request timestamp', $this->microtime_start); try { switch (self::$operation_mode) { case self::ENGINE_MODE_STANDALONE: $this->locateHTTPServer(); $this->createBuiltInServer(); $this->createBuiltInSite(); break; case self::ENGINE_MODE_HOSTED: $this->registerMainDatabase(); $this->locateHTTPServer(); $this->createBuiltInServer(); $this->locateRunningConfiguration(); break; case self::ENGINE_MODE_CLUSTERED: $this->registerMainDatabase(); $this->locateHTTPServer(); $this->locateRunningConfiguration(); break; default: } $retval = forward_static_call(array($class_name, 'launch')); } catch (Exception $e) { $this->nb_error_handler->dumpStack( $e->getMessage(), E_CORE_ERROR, $e->getFile(), $e->getLine(), null, $e->getTrace() ); if ($this->isOperationModeStandalone() || $this->isOperationModeStored() || $this->isOperationModeClustered() ) { nb_displayErrorPage(500, $e); } $retval = false; } if (self::isInstantiated()) { self::getEngine()->finish(); /** @todo Implement CNabuEngine Dump Popup Trace action */ /** @source $nb_engine->dumpPopupTrace(); */ } return $retval; }
[ "public", "function", "runApplication", "(", "$", "class_name", ")", "{", "$", "this", "->", "traceLog", "(", "'Request timestamp'", ",", "$", "this", "->", "microtime_start", ")", ";", "try", "{", "switch", "(", "self", "::", "$", "operation_mode", ")", "...
Executes an Application instance in the Nabu Engine environment. @param string $class_name @return mixed Returned value from run method of the instance
[ "Executes", "an", "Application", "instance", "in", "the", "Nabu", "Engine", "environment", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L772-L818
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.callLocateHTTPServerHook
private function callLocateHTTPServerHook() { if (is_string(self::$locateHTTPServerHook)) { ${self::$locateHTTPServerHook}($this->nb_http_server); } elseif (self::$locateHTTPServerHook instanceof Closure) { (self::$locateHTTPServerHook)($this->nb_http_server); } }
php
private function callLocateHTTPServerHook() { if (is_string(self::$locateHTTPServerHook)) { ${self::$locateHTTPServerHook}($this->nb_http_server); } elseif (self::$locateHTTPServerHook instanceof Closure) { (self::$locateHTTPServerHook)($this->nb_http_server); } }
[ "private", "function", "callLocateHTTPServerHook", "(", ")", "{", "if", "(", "is_string", "(", "self", "::", "$", "locateHTTPServerHook", ")", ")", "{", "$", "{", "self", "::", "$", "locateHTTPServerHook", "}", "(", "$", "this", "->", "nb_http_server", ")", ...
Calls the Hook function after locate valid HTTP Server.
[ "Calls", "the", "Hook", "function", "after", "locate", "valid", "HTTP", "Server", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L838-L845
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.locateHTTPServer
private function locateHTTPServer() { $this->nb_http_server = null; if (self::isCLIEnvironment()) { throw new ENabuCoreException(ENabuCoreException::ERROR_METHOD_NOT_AVAILABLE, array(__METHOD__)); } elseif ($this->nb_http_server === null) { $this->getHTTPServerPoolManager(); $this->nb_provider_factory ->getInterfaceDescriptors(CNabuProviderFactory::INTERFACE_HTTP_SERVER_SERVICE) ->iterate(function(string $key, CNabuHTTPServerInterfaceDescriptor $descriptor) { $nb_factory = $this->nb_http_server_pool_manager->getHTTPServerFactory($descriptor); $nb_interface = $nb_factory->getInterface(); if ($nb_interface instanceof INabuHTTPServerInterface && $nb_interface->recognizeSoftware()) { $this->nb_http_server = $nb_interface; $this->callLocateHTTPServerHook(); } return is_null($this->nb_http_server); }) ; } if (is_null($this->nb_http_server)) { throw new ENabuHTTPException(ENabuHTTPException::ERROR_HTTP_SERVER_PROVIDER_NOT_FOUND); } return $this->nb_http_server; }
php
private function locateHTTPServer() { $this->nb_http_server = null; if (self::isCLIEnvironment()) { throw new ENabuCoreException(ENabuCoreException::ERROR_METHOD_NOT_AVAILABLE, array(__METHOD__)); } elseif ($this->nb_http_server === null) { $this->getHTTPServerPoolManager(); $this->nb_provider_factory ->getInterfaceDescriptors(CNabuProviderFactory::INTERFACE_HTTP_SERVER_SERVICE) ->iterate(function(string $key, CNabuHTTPServerInterfaceDescriptor $descriptor) { $nb_factory = $this->nb_http_server_pool_manager->getHTTPServerFactory($descriptor); $nb_interface = $nb_factory->getInterface(); if ($nb_interface instanceof INabuHTTPServerInterface && $nb_interface->recognizeSoftware()) { $this->nb_http_server = $nb_interface; $this->callLocateHTTPServerHook(); } return is_null($this->nb_http_server); }) ; } if (is_null($this->nb_http_server)) { throw new ENabuHTTPException(ENabuHTTPException::ERROR_HTTP_SERVER_PROVIDER_NOT_FOUND); } return $this->nb_http_server; }
[ "private", "function", "locateHTTPServer", "(", ")", "{", "$", "this", "->", "nb_http_server", "=", "null", ";", "if", "(", "self", "::", "isCLIEnvironment", "(", ")", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", "::", "ERROR_METH...
Try to detect the running HTTP Server attached to this process and returns their nabu-3 manager. @return INabuHTTPServerInterface Returns an instance of the HTTP Server Engine. @throws ENabuCoreException Throws an exception if Nabu Engine is not running in a HTTP Server mode. @throws ENabuHTTPException Throws an exception if HTTP Server Provider is not found.
[ "Try", "to", "detect", "the", "running", "HTTP", "Server", "attached", "to", "this", "process", "and", "returns", "their", "nabu", "-", "3", "manager", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L853-L880
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.createBuiltInServer
private function createBuiltInServer() { $nb_server = new CNabuBuiltInServer(); $nb_server_host = new CNabuBuiltInServerHost(); $host_path = $this->nb_http_server->getHostBaseDirectory(); $server_path = dirname($host_path); $nb_server->setBasePath(NABU_BASE_PATH); $nb_server->setVirtualHostsPath($server_path); $this->nb_http_server->setServer($nb_server); $this->nb_http_server->setServerHost($nb_server_host); }
php
private function createBuiltInServer() { $nb_server = new CNabuBuiltInServer(); $nb_server_host = new CNabuBuiltInServerHost(); $host_path = $this->nb_http_server->getHostBaseDirectory(); $server_path = dirname($host_path); $nb_server->setBasePath(NABU_BASE_PATH); $nb_server->setVirtualHostsPath($server_path); $this->nb_http_server->setServer($nb_server); $this->nb_http_server->setServerHost($nb_server_host); }
[ "private", "function", "createBuiltInServer", "(", ")", "{", "$", "nb_server", "=", "new", "CNabuBuiltInServer", "(", ")", ";", "$", "nb_server_host", "=", "new", "CNabuBuiltInServerHost", "(", ")", ";", "$", "host_path", "=", "$", "this", "->", "nb_http_serve...
Create the BuiltIn Server. If operation mode is setted to Standalone or Hosted, the BuiltIn Server is required due to the application instance cannot run in more than one server. @return CNabuBuiltInServer Returns the BuiltIn Server instance created and filled with their default values.
[ "Create", "the", "BuiltIn", "Server", ".", "If", "operation", "mode", "is", "setted", "to", "Standalone", "or", "Hosted", "the", "BuiltIn", "Server", "is", "required", "due", "to", "the", "application", "instance", "cannot", "run", "in", "more", "than", "one...
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L888-L901
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.createBuiltInSite
private function createBuiltInSite() { $this->nb_customer = new CNabuBuiltInCustomer(); $nb_site = new CNabuBuiltInSite(); $nb_site_alias = new CNabuBuiltInSiteAlias(); $nb_domain_zone = new CNabuBuiltInDomainZone(); $nb_domain_zone_host = new CNabuBuiltInDomainZoneHost(); $server_name = $this->nb_http_server->getServerName(); $sname_parts = preg_split('/\\./', $server_name, 2); if (count($sname_parts) === 2) { list($host, $domain) = $sname_parts; } elseif (count($sname_parts) === 1) { $host = $sname_parts[0]; $domain = ''; } else { throw new ENabuCoreException(ENabuCoreException::ERROR_DOMAIN_ZONE_NOT_FOUND); } $nb_domain_zone->setName($domain); $nb_domain_zone_host->setName($host); $nb_domain_zone_host->setDomainZone($nb_domain_zone); $host_path = $this->nb_http_server->getHostBaseDirectory(); $site_path = basename($host_path); $nb_site->setBasePath(DIRECTORY_SEPARATOR . $site_path); /** @source $nb_site->setPHPUtilsPath(NABU_PHPUTILS_FOLDER); */ $nb_site->setClassesPath(NABU_CLASSES_FOLDER); $nb_site->setPluginsPath(NABU_PLUGINS_FOLDER); $nb_site->setMainAlias($nb_site_alias); $nb_site_alias->setDomainZoneHost($nb_domain_zone_host); $this->nb_http_server->setSite($nb_site); $this->nb_http_server->setSiteAlias($nb_site_alias); }
php
private function createBuiltInSite() { $this->nb_customer = new CNabuBuiltInCustomer(); $nb_site = new CNabuBuiltInSite(); $nb_site_alias = new CNabuBuiltInSiteAlias(); $nb_domain_zone = new CNabuBuiltInDomainZone(); $nb_domain_zone_host = new CNabuBuiltInDomainZoneHost(); $server_name = $this->nb_http_server->getServerName(); $sname_parts = preg_split('/\\./', $server_name, 2); if (count($sname_parts) === 2) { list($host, $domain) = $sname_parts; } elseif (count($sname_parts) === 1) { $host = $sname_parts[0]; $domain = ''; } else { throw new ENabuCoreException(ENabuCoreException::ERROR_DOMAIN_ZONE_NOT_FOUND); } $nb_domain_zone->setName($domain); $nb_domain_zone_host->setName($host); $nb_domain_zone_host->setDomainZone($nb_domain_zone); $host_path = $this->nb_http_server->getHostBaseDirectory(); $site_path = basename($host_path); $nb_site->setBasePath(DIRECTORY_SEPARATOR . $site_path); /** @source $nb_site->setPHPUtilsPath(NABU_PHPUTILS_FOLDER); */ $nb_site->setClassesPath(NABU_CLASSES_FOLDER); $nb_site->setPluginsPath(NABU_PLUGINS_FOLDER); $nb_site->setMainAlias($nb_site_alias); $nb_site_alias->setDomainZoneHost($nb_domain_zone_host); $this->nb_http_server->setSite($nb_site); $this->nb_http_server->setSiteAlias($nb_site_alias); }
[ "private", "function", "createBuiltInSite", "(", ")", "{", "$", "this", "->", "nb_customer", "=", "new", "CNabuBuiltInCustomer", "(", ")", ";", "$", "nb_site", "=", "new", "CNabuBuiltInSite", "(", ")", ";", "$", "nb_site_alias", "=", "new", "CNabuBuiltInSiteAl...
Create the BuiltIn Site. If operation mode is setted to Standalone, the BuiltIn Site is required due to the HTTP Server cannot execute more than one application instance. @return CNabuBuiltInSite Returns the BuiltIn Site instance created and filled with their default values.
[ "Create", "the", "BuiltIn", "Site", ".", "If", "operation", "mode", "is", "setted", "to", "Standalone", "the", "BuiltIn", "Site", "is", "required", "due", "to", "the", "HTTP", "Server", "cannot", "execute", "more", "than", "one", "application", "instance", "...
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L909-L945
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.getPHPIncludeFolders
public function getPHPIncludeFolders() { if (!is_array($this->framework_folders)) { $this->framework_folders = array(); if (is_dir(NABU_SRC_PATH)) { $this->framework_folders[] = realpath(NABU_SRC_PATH); } if (is_dir(NABU_SDK_PATH)) { $this->framework_folders[] = realpath(NABU_SDK_PATH); } if (is_dir(NABU_PUB_PATH)) { $this->framework_folders[] = realpath(NABU_PUB_PATH); } if (is_dir(NABU_LIB_PATH)) { $this->framework_folders[] = realpath(NABU_LIB_PATH); } if (is_dir(NABU_ICONTACT_PATH)) { $this->framework_folders[] = realpath(NABU_ICONTACT_PATH); } if (count($this->framework_folders) === 0) { $this->framework_folders = null; } } return $this->framework_folders; }
php
public function getPHPIncludeFolders() { if (!is_array($this->framework_folders)) { $this->framework_folders = array(); if (is_dir(NABU_SRC_PATH)) { $this->framework_folders[] = realpath(NABU_SRC_PATH); } if (is_dir(NABU_SDK_PATH)) { $this->framework_folders[] = realpath(NABU_SDK_PATH); } if (is_dir(NABU_PUB_PATH)) { $this->framework_folders[] = realpath(NABU_PUB_PATH); } if (is_dir(NABU_LIB_PATH)) { $this->framework_folders[] = realpath(NABU_LIB_PATH); } if (is_dir(NABU_ICONTACT_PATH)) { $this->framework_folders[] = realpath(NABU_ICONTACT_PATH); } if (count($this->framework_folders) === 0) { $this->framework_folders = null; } } return $this->framework_folders; }
[ "public", "function", "getPHPIncludeFolders", "(", ")", "{", "if", "(", "!", "is_array", "(", "$", "this", "->", "framework_folders", ")", ")", "{", "$", "this", "->", "framework_folders", "=", "array", "(", ")", ";", "if", "(", "is_dir", "(", "NABU_SRC_...
Gets the list of PHP root folders in the framework for include purposes. @return array Returns an string array of all folder paths available in the framework.
[ "Gets", "the", "list", "of", "PHP", "root", "folders", "in", "the", "framework", "for", "include", "purposes", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L959-L985
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.getProviderManager
public function getProviderManager(string $vendor_key, string $module_key) { if ($this->nb_provider_factory instanceof CNabuProviderFactory) { return $this->nb_provider_factory->getManager($vendor_key, $module_key); } else { throw new ENabuProviderException(ENabuProviderException::ERROR_PROVIDER_FACTORY_NOT_AVAILABLE); } }
php
public function getProviderManager(string $vendor_key, string $module_key) { if ($this->nb_provider_factory instanceof CNabuProviderFactory) { return $this->nb_provider_factory->getManager($vendor_key, $module_key); } else { throw new ENabuProviderException(ENabuProviderException::ERROR_PROVIDER_FACTORY_NOT_AVAILABLE); } }
[ "public", "function", "getProviderManager", "(", "string", "$", "vendor_key", ",", "string", "$", "module_key", ")", "{", "if", "(", "$", "this", "->", "nb_provider_factory", "instanceof", "CNabuProviderFactory", ")", "{", "return", "$", "this", "->", "nb_provid...
Gets a Provider Manager instance. This method is intended normally to be used internally and inside provider modules. @param string $vendor_key Vendor Key to identify the Manager. @param string $module_key Module Key to identify the Manager. @return INabuProviderManager Returns the Manager instance if exists or false if not. @throws ENabuProviderException Raises an exception if $vendor_key or $module_key have invalid values.
[ "Gets", "a", "Provider", "Manager", "instance", ".", "This", "method", "is", "intended", "normally", "to", "be", "used", "internally", "and", "inside", "provider", "modules", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L1008-L1015
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.getProviderInterfaceDescriptor
public function getProviderInterfaceDescriptor(string $vendor, string $module, int $interface_type, string $interface) { return $this->nb_provider_factory->getInterfaceDescriptor($vendor, $module, $interface_type, $interface); }
php
public function getProviderInterfaceDescriptor(string $vendor, string $module, int $interface_type, string $interface) { return $this->nb_provider_factory->getInterfaceDescriptor($vendor, $module, $interface_type, $interface); }
[ "public", "function", "getProviderInterfaceDescriptor", "(", "string", "$", "vendor", ",", "string", "$", "module", ",", "int", "$", "interface_type", ",", "string", "$", "interface", ")", "{", "return", "$", "this", "->", "nb_provider_factory", "->", "getInterf...
Gets a Provider Interface descriptor. @param string $vendor Vendor key. @param string $module Module key. @param int $interface_type Interface type. @param string $interface Interface name to be retrieved. @return CNabuProviderInterfaceDescriptor|null Returns the descriptor found if any, or null if not found.
[ "Gets", "a", "Provider", "Interface", "descriptor", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L1045-L1048
train
nabu-3/core
nabu/core/CNabuEngine.php
CNabuEngine.getProviderInterfaceDescriptorByKey
public function getProviderInterfaceDescriptorByKey(int $interface_type, string $interface_key) { return $this->nb_provider_factory->getInterfaceDescriptors($interface_type)->getItem($interface_key); }
php
public function getProviderInterfaceDescriptorByKey(int $interface_type, string $interface_key) { return $this->nb_provider_factory->getInterfaceDescriptors($interface_type)->getItem($interface_key); }
[ "public", "function", "getProviderInterfaceDescriptorByKey", "(", "int", "$", "interface_type", ",", "string", "$", "interface_key", ")", "{", "return", "$", "this", "->", "nb_provider_factory", "->", "getInterfaceDescriptors", "(", "$", "interface_type", ")", "->", ...
Gets a Provider Interface Descriptor by his interface type and key. @param int $interface_type Interface Type. @param string $interface_key Interface Key as assigned in the descriptor by his manager. @return CNabuProviderInterfaceDescriptor|false Returns the located interface if found, or false if not found.
[ "Gets", "a", "Provider", "Interface", "Descriptor", "by", "his", "interface", "type", "and", "key", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuEngine.php#L1056-L1059
train
nabu-3/core
nabu/data/lang/CNabuDataObjectListIndexLanguage.php
CNabuDataObjectListIndexLanguage.extractNodes
protected function extractNodes(CNabuDataObject $item) { $retval = null; if ($item instanceof INabuTranslated) { if ($item->hasTranslations()) { $nodes = array(); $main_index_name = $this->list->getIndexedFieldName(); $item->getTranslations()->iterate( function ($key, $translation) use (&$nodes, $main_index_name, $item) { if (($translation->isValueNumeric($main_index_name) || $translation->isValueGUID($main_index_name) ) && ($translation->isValueString($this->key_field) || $translation->isValueNumeric($this->key_field) ) ) { $key = $translation->getValue($this->key_field); $nodes[$key] = array( 'key' => $key, 'pointer' => $translation->getValue($main_index_name) ); if ($translation->isValueNumeric($this->order_field) || $translation->isValueString($this->order_field) ) { $nodes[$key]['order'] = $translation->getValue($this->order_field); } elseif ($item->isValueNumeric($this->order_field) || $item->isValueString($this->order_field) ) { $nodes[$key]['order'] = $item->getValue($this->order_field); } } } ); if (count($nodes) > 0) { $retval = $nodes; } } } else { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE, array('$item', get_class($item)) ); } return $retval; }
php
protected function extractNodes(CNabuDataObject $item) { $retval = null; if ($item instanceof INabuTranslated) { if ($item->hasTranslations()) { $nodes = array(); $main_index_name = $this->list->getIndexedFieldName(); $item->getTranslations()->iterate( function ($key, $translation) use (&$nodes, $main_index_name, $item) { if (($translation->isValueNumeric($main_index_name) || $translation->isValueGUID($main_index_name) ) && ($translation->isValueString($this->key_field) || $translation->isValueNumeric($this->key_field) ) ) { $key = $translation->getValue($this->key_field); $nodes[$key] = array( 'key' => $key, 'pointer' => $translation->getValue($main_index_name) ); if ($translation->isValueNumeric($this->order_field) || $translation->isValueString($this->order_field) ) { $nodes[$key]['order'] = $translation->getValue($this->order_field); } elseif ($item->isValueNumeric($this->order_field) || $item->isValueString($this->order_field) ) { $nodes[$key]['order'] = $item->getValue($this->order_field); } } } ); if (count($nodes) > 0) { $retval = $nodes; } } } else { throw new ENabuCoreException( ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE, array('$item', get_class($item)) ); } return $retval; }
[ "protected", "function", "extractNodes", "(", "CNabuDataObject", "$", "item", ")", "{", "$", "retval", "=", "null", ";", "if", "(", "$", "item", "instanceof", "INabuTranslated", ")", "{", "if", "(", "$", "item", "->", "hasTranslations", "(", ")", ")", "{...
Extract Nodes list for translations in an item in this node. @param CNabuDataObject $item Item of which will extract the nodes. @return array Returns an array of found nodes or null when they are not available nodes.
[ "Extract", "Nodes", "list", "for", "translations", "in", "an", "item", "in", "this", "node", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/lang/CNabuDataObjectListIndexLanguage.php#L41-L87
train
nabu-3/core
nabu/data/messaging/CNabuMessagingServiceTemplate.php
CNabuMessagingServiceTemplate.getTemplatesForService
public static function getTemplatesForService($nb_messaging_service) : CNabuMessagingServiceTemplateList { if (is_numeric($nb_messaging_service_id = nb_getMixedValue($nb_messaging_service, NABU_MESSAGING_SERVICE_FIELD_ID))) { $retval = CNabuMessagingServiceTemplate::buildObjectListFromSQL( 'nb_messaging_template_id', 'select * ' . 'from nb_messaging_service_template ' . 'where nb_messaging_service_id=%service_id$d', array( 'service_id' => $nb_messaging_service_id ) ); if ($nb_messaging_service instanceof CNabuMessagingService) { $retval->iterate(function($key, CNabuMessagingServiceTemplate $nb_template) use ($nb_messaging_service) { $nb_template->setMessagingService($nb_messaging_service); return true; }); } } else { $retval = new CNabuMessagingServiceTemplateList(); } return $retval; }
php
public static function getTemplatesForService($nb_messaging_service) : CNabuMessagingServiceTemplateList { if (is_numeric($nb_messaging_service_id = nb_getMixedValue($nb_messaging_service, NABU_MESSAGING_SERVICE_FIELD_ID))) { $retval = CNabuMessagingServiceTemplate::buildObjectListFromSQL( 'nb_messaging_template_id', 'select * ' . 'from nb_messaging_service_template ' . 'where nb_messaging_service_id=%service_id$d', array( 'service_id' => $nb_messaging_service_id ) ); if ($nb_messaging_service instanceof CNabuMessagingService) { $retval->iterate(function($key, CNabuMessagingServiceTemplate $nb_template) use ($nb_messaging_service) { $nb_template->setMessagingService($nb_messaging_service); return true; }); } } else { $retval = new CNabuMessagingServiceTemplateList(); } return $retval; }
[ "public", "static", "function", "getTemplatesForService", "(", "$", "nb_messaging_service", ")", ":", "CNabuMessagingServiceTemplateList", "{", "if", "(", "is_numeric", "(", "$", "nb_messaging_service_id", "=", "nb_getMixedValue", "(", "$", "nb_messaging_service", ",", ...
Gets the list of Template Connections for a Service. @param mixed $nb_messaging_service A CNabuMessagingService instance, a CNabuDataObject inherited instance containing a field named nb_messaging_service_id or a valid Id. @return CNabuMessagingTemplateList Returns a list of all Template Connections found.
[ "Gets", "the", "list", "of", "Template", "Connections", "for", "a", "Service", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/messaging/CNabuMessagingServiceTemplate.php#L39-L63
train
rips/php-connector-bundle
Hydrators/Application/ScanHydrator.php
ScanHydrator.hydrateCollection
public static function hydrateCollection(array $scans) { $hydrated = []; foreach ($scans as $scan) { $hydrated[] = self::hydrate($scan); } return $hydrated; }
php
public static function hydrateCollection(array $scans) { $hydrated = []; foreach ($scans as $scan) { $hydrated[] = self::hydrate($scan); } return $hydrated; }
[ "public", "static", "function", "hydrateCollection", "(", "array", "$", "scans", ")", "{", "$", "hydrated", "=", "[", "]", ";", "foreach", "(", "$", "scans", "as", "$", "scan", ")", "{", "$", "hydrated", "[", "]", "=", "self", "::", "hydrate", "(", ...
Hydrate a collection of scan objects into a collection of ScanEntity objects @param stdClass[] $scans @return ScanEntity[]
[ "Hydrate", "a", "collection", "of", "scan", "objects", "into", "a", "collection", "of", "ScanEntity", "objects" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/Application/ScanHydrator.php#L28-L37
train
nabu-3/core
nabu/data/security/traits/TNabuRoleMaskList.php
TNabuRoleMaskList.applyRoleMask
public function applyRoleMask(CNabuRole $nb_role, array $additional = null) { $total = $this->getSize(); $count = 0; $this->iterate(function($key, INabuRoleMask $item) use($count, $nb_role, $additional) { if ($item->applyRoleMask($nb_role, $additional)) { $count++; } else { $this->removeItem($item); } return true; }); $this->role_applied = true; return $total === 0 || ($count > 0 && $count <= $total); }
php
public function applyRoleMask(CNabuRole $nb_role, array $additional = null) { $total = $this->getSize(); $count = 0; $this->iterate(function($key, INabuRoleMask $item) use($count, $nb_role, $additional) { if ($item->applyRoleMask($nb_role, $additional)) { $count++; } else { $this->removeItem($item); } return true; }); $this->role_applied = true; return $total === 0 || ($count > 0 && $count <= $total); }
[ "public", "function", "applyRoleMask", "(", "CNabuRole", "$", "nb_role", ",", "array", "$", "additional", "=", "null", ")", "{", "$", "total", "=", "$", "this", "->", "getSize", "(", ")", ";", "$", "count", "=", "0", ";", "$", "this", "->", "iterate"...
Applies Role policies to this list. All items that does not accomplishes the policies are removed. @param CNabuRole $nb_role Role instance to be applied. @param array $additional Additional data to be considered. The treatment of this data depends on the class representing each item. @return int Return the number of items that accomplished policies.
[ "Applies", "Role", "policies", "to", "this", "list", ".", "All", "items", "that", "does", "not", "accomplishes", "the", "policies", "are", "removed", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/security/traits/TNabuRoleMaskList.php#L42-L58
train
nabu-3/core
nabu/data/icontact/base/CNabuIContactLanguageBase.php
CNabuIContactLanguageBase.setIcontactId
public function setIcontactId(int $nb_icontact_id) : CNabuDataObject { if ($nb_icontact_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_icontact_id") ); } $this->setValue('nb_icontact_id', $nb_icontact_id); return $this; }
php
public function setIcontactId(int $nb_icontact_id) : CNabuDataObject { if ($nb_icontact_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_icontact_id") ); } $this->setValue('nb_icontact_id', $nb_icontact_id); return $this; }
[ "public", "function", "setIcontactId", "(", "int", "$", "nb_icontact_id", ")", ":", "CNabuDataObject", "{", "if", "(", "$", "nb_icontact_id", "===", "null", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", "::", "ERROR_NULL_VALUE_NOT_ALLOWE...
Sets the Icontact Id attribute value. @param int $nb_icontact_id New value for attribute @return CNabuDataObject Returns self instance to grant chained setters call.
[ "Sets", "the", "Icontact", "Id", "attribute", "value", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/icontact/base/CNabuIContactLanguageBase.php#L182-L193
train
rips/php-connector-bundle
Hydrators/LicenseHydrator.php
LicenseHydrator.hydrateCollection
public static function hydrateCollection(array $licenses) { $hydrated = []; foreach ($licenses as $license) { $hydrated[] = self::hydrate($license); } return $hydrated; }
php
public static function hydrateCollection(array $licenses) { $hydrated = []; foreach ($licenses as $license) { $hydrated[] = self::hydrate($license); } return $hydrated; }
[ "public", "static", "function", "hydrateCollection", "(", "array", "$", "licenses", ")", "{", "$", "hydrated", "=", "[", "]", ";", "foreach", "(", "$", "licenses", "as", "$", "license", ")", "{", "$", "hydrated", "[", "]", "=", "self", "::", "hydrate",...
Hydrate a collection of license objects into a collection of LicenseEntity objects @param stdClass[] $licenses @return LicenseEntity[]
[ "Hydrate", "a", "collection", "of", "license", "objects", "into", "a", "collection", "of", "LicenseEntity", "objects" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/LicenseHydrator.php#L18-L27
train
rips/php-connector-bundle
Hydrators/LicenseHydrator.php
LicenseHydrator.hydrate
public static function hydrate(stdClass $license) { $hydrated = new LicenseEntity(); if (isset($license->id)) { $hydrated->setId($license->id); } if (isset($license->created_at)) { $hydrated->setCreatedAt(new DateTime($license->created_at)); } if (isset($license->valid_until)) { $hydrated->setValidUntil(new DateTime($license->valid_until)); } if (isset($license->quota_distributed)) { $hydrated->setQuotaDistributed($license->quota_distributed); } if (isset($license->created_by)) { $hydrated->setCreatedBy(UserHydrator::hydrate($license->created_by)); } if (isset($license->parent)) { $hydrated->setParent(self::hydrate($license->parent)); } if (isset($license->child)) { $hydrated->setChild(self::hydrate($license->child)); } if (isset($license->organization)) { $hydrated->setOrganization(OrgHydrator::hydrate($license->organization)); } return $hydrated; }
php
public static function hydrate(stdClass $license) { $hydrated = new LicenseEntity(); if (isset($license->id)) { $hydrated->setId($license->id); } if (isset($license->created_at)) { $hydrated->setCreatedAt(new DateTime($license->created_at)); } if (isset($license->valid_until)) { $hydrated->setValidUntil(new DateTime($license->valid_until)); } if (isset($license->quota_distributed)) { $hydrated->setQuotaDistributed($license->quota_distributed); } if (isset($license->created_by)) { $hydrated->setCreatedBy(UserHydrator::hydrate($license->created_by)); } if (isset($license->parent)) { $hydrated->setParent(self::hydrate($license->parent)); } if (isset($license->child)) { $hydrated->setChild(self::hydrate($license->child)); } if (isset($license->organization)) { $hydrated->setOrganization(OrgHydrator::hydrate($license->organization)); } return $hydrated; }
[ "public", "static", "function", "hydrate", "(", "stdClass", "$", "license", ")", "{", "$", "hydrated", "=", "new", "LicenseEntity", "(", ")", ";", "if", "(", "isset", "(", "$", "license", "->", "id", ")", ")", "{", "$", "hydrated", "->", "setId", "("...
Hydrate a license object into a LicenseEntity object @param stdClass $license @return LicenseEntity
[ "Hydrate", "a", "license", "object", "into", "a", "LicenseEntity", "object" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/LicenseHydrator.php#L35-L72
train
nabu-3/core
nabu/data/customer/base/CNabuCustomerUserBase.php
CNabuCustomerUserBase.setUserId
public function setUserId(int $nb_user_id) : CNabuDataObject { if ($nb_user_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_user_id") ); } $this->setValue('nb_user_id', $nb_user_id); return $this; }
php
public function setUserId(int $nb_user_id) : CNabuDataObject { if ($nb_user_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_user_id") ); } $this->setValue('nb_user_id', $nb_user_id); return $this; }
[ "public", "function", "setUserId", "(", "int", "$", "nb_user_id", ")", ":", "CNabuDataObject", "{", "if", "(", "$", "nb_user_id", "===", "null", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", "::", "ERROR_NULL_VALUE_NOT_ALLOWED_IN", ","...
Sets the User Id attribute value. @param int $nb_user_id New value for attribute @return CNabuDataObject Returns self instance to grant chained setters call.
[ "Sets", "the", "User", "Id", "attribute", "value", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/customer/base/CNabuCustomerUserBase.php#L174-L185
train
nabu-3/core
nabu/data/catalog/base/CNabuCatalogTaxonomyLanguageBase.php
CNabuCatalogTaxonomyLanguageBase.setCatalogTaxonomyId
public function setCatalogTaxonomyId(int $nb_catalog_taxonomy_id) : CNabuDataObject { if ($nb_catalog_taxonomy_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_catalog_taxonomy_id") ); } $this->setValue('nb_catalog_taxonomy_id', $nb_catalog_taxonomy_id); return $this; }
php
public function setCatalogTaxonomyId(int $nb_catalog_taxonomy_id) : CNabuDataObject { if ($nb_catalog_taxonomy_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_catalog_taxonomy_id") ); } $this->setValue('nb_catalog_taxonomy_id', $nb_catalog_taxonomy_id); return $this; }
[ "public", "function", "setCatalogTaxonomyId", "(", "int", "$", "nb_catalog_taxonomy_id", ")", ":", "CNabuDataObject", "{", "if", "(", "$", "nb_catalog_taxonomy_id", "===", "null", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", "::", "ERRO...
Sets the Catalog Taxonomy Id attribute value. @param int $nb_catalog_taxonomy_id New value for attribute @return CNabuDataObject Returns self instance to grant chained setters call.
[ "Sets", "the", "Catalog", "Taxonomy", "Id", "attribute", "value", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/catalog/base/CNabuCatalogTaxonomyLanguageBase.php#L182-L193
train
rips/php-connector-bundle
Services/OrgService.php
OrgService.getAll
public function getAll(array $queryParams = []) { $response = $this->api->orgs()->getAll($queryParams); return new OrgsResponse($response); }
php
public function getAll(array $queryParams = []) { $response = $this->api->orgs()->getAll($queryParams); return new OrgsResponse($response); }
[ "public", "function", "getAll", "(", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "orgs", "(", ")", "->", "getAll", "(", "$", "queryParams", ")", ";", "return", "new", "OrgsResponse", "("...
Get all organizations @param array $queryParams @return OrgsResponse
[ "Get", "all", "organizations" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/OrgService.php#L33-L38
train
rips/php-connector-bundle
Services/OrgService.php
OrgService.getById
public function getById($orgId, array $queryParams = []) { $response = $this->api->orgs()->getById($orgId, $queryParams); return new OrgResponse($response); }
php
public function getById($orgId, array $queryParams = []) { $response = $this->api->orgs()->getById($orgId, $queryParams); return new OrgResponse($response); }
[ "public", "function", "getById", "(", "$", "orgId", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "orgs", "(", ")", "->", "getById", "(", "$", "orgId", ",", "$", "queryParams", ")",...
Get an organization by id @param int $orgId @param array $queryParams @return OrgResponse
[ "Get", "an", "organization", "by", "id" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/OrgService.php#L47-L52
train
rips/php-connector-bundle
Services/OrgService.php
OrgService.update
public function update($orgId, OrgBuilder $input, array $queryParams = []) { $response = $this->api->orgs()->update($orgId, $input->toArray(), $queryParams); return new OrgResponse($response); }
php
public function update($orgId, OrgBuilder $input, array $queryParams = []) { $response = $this->api->orgs()->update($orgId, $input->toArray(), $queryParams); return new OrgResponse($response); }
[ "public", "function", "update", "(", "$", "orgId", ",", "OrgBuilder", "$", "input", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "orgs", "(", ")", "->", "update", "(", "$", "orgId"...
Update existing organization by id @param integer $orgId @param OrgBuilder $input @param array $queryParams @return OrgResponse
[ "Update", "existing", "organization", "by", "id" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/OrgService.php#L76-L81
train
rips/php-connector-bundle
Services/OrgService.php
OrgService.deleteAll
public function deleteAll(array $queryParams = []) { $response = $this->api->orgs()->deleteAll($queryParams); return new BaseResponse($response); }
php
public function deleteAll(array $queryParams = []) { $response = $this->api->orgs()->deleteAll($queryParams); return new BaseResponse($response); }
[ "public", "function", "deleteAll", "(", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "orgs", "(", ")", "->", "deleteAll", "(", "$", "queryParams", ")", ";", "return", "new", "BaseResponse",...
Delete all organizations @param array $queryParams @return BaseResponse
[ "Delete", "all", "organizations" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/OrgService.php#L89-L94
train
rips/php-connector-bundle
Services/OrgService.php
OrgService.deleteById
public function deleteById($orgId, array $queryParams = []) { $response = $this->api->orgs()->deleteById($orgId, $queryParams); return new BaseResponse($response); }
php
public function deleteById($orgId, array $queryParams = []) { $response = $this->api->orgs()->deleteById($orgId, $queryParams); return new BaseResponse($response); }
[ "public", "function", "deleteById", "(", "$", "orgId", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "orgs", "(", ")", "->", "deleteById", "(", "$", "orgId", ",", "$", "queryParams", ...
Delete an organization by id @param int $orgId @param array $queryParams @return BaseResponse
[ "Delete", "an", "organization", "by", "id" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/OrgService.php#L103-L108
train
nabu-3/core
nabu/data/site/base/CNabuSiteLanguageBase.php
CNabuSiteLanguageBase.setEnabled
public function setEnabled(string $enabled = "T") : CNabuDataObject { if ($enabled === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$enabled") ); } $this->setValue('nb_site_lang_enabled', $enabled); return $this; }
php
public function setEnabled(string $enabled = "T") : CNabuDataObject { if ($enabled === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$enabled") ); } $this->setValue('nb_site_lang_enabled', $enabled); return $this; }
[ "public", "function", "setEnabled", "(", "string", "$", "enabled", "=", "\"T\"", ")", ":", "CNabuDataObject", "{", "if", "(", "$", "enabled", "===", "null", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", "::", "ERROR_NULL_VALUE_NOT_AL...
Sets the Site Lang Enabled attribute value. @param string $enabled New value for attribute @return CNabuDataObject Returns self instance to grant chained setters call.
[ "Sets", "the", "Site", "Lang", "Enabled", "attribute", "value", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteLanguageBase.php#L241-L252
train
nabu-3/core
nabu/data/site/base/CNabuSiteLanguageBase.php
CNabuSiteLanguageBase.setTranslationStatus
public function setTranslationStatus(string $translation_status = "D") : CNabuDataObject { if ($translation_status === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$translation_status") ); } $this->setValue('nb_site_lang_translation_status', $translation_status); return $this; }
php
public function setTranslationStatus(string $translation_status = "D") : CNabuDataObject { if ($translation_status === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$translation_status") ); } $this->setValue('nb_site_lang_translation_status', $translation_status); return $this; }
[ "public", "function", "setTranslationStatus", "(", "string", "$", "translation_status", "=", "\"D\"", ")", ":", "CNabuDataObject", "{", "if", "(", "$", "translation_status", "===", "null", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", ...
Sets the Site Lang Translation Status attribute value. @param string $translation_status New value for attribute @return CNabuDataObject Returns self instance to grant chained setters call.
[ "Sets", "the", "Site", "Lang", "Translation", "Status", "attribute", "value", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteLanguageBase.php#L268-L279
train
nabu-3/core
nabu/data/site/base/CNabuSiteLanguageBase.php
CNabuSiteLanguageBase.setEditable
public function setEditable(string $editable = "F") : CNabuDataObject { if ($editable === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$editable") ); } $this->setValue('nb_site_lang_editable', $editable); return $this; }
php
public function setEditable(string $editable = "F") : CNabuDataObject { if ($editable === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$editable") ); } $this->setValue('nb_site_lang_editable', $editable); return $this; }
[ "public", "function", "setEditable", "(", "string", "$", "editable", "=", "\"F\"", ")", ":", "CNabuDataObject", "{", "if", "(", "$", "editable", "===", "null", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", "::", "ERROR_NULL_VALUE_NOT...
Sets the Site Lang Editable attribute value. @param string $editable New value for attribute @return CNabuDataObject Returns self instance to grant chained setters call.
[ "Sets", "the", "Site", "Lang", "Editable", "attribute", "value", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteLanguageBase.php#L295-L306
train
mimmi20/WurflCache
src/Adapter/ZendCacheConnector.php
ZendCacheConnector.normalizeKey
protected function normalizeKey($cacheId) { $cacheId = parent::normalizeKey($cacheId); if (($pattern = $this->cache->getOptions()->getKeyPattern()) && !preg_match($pattern, $cacheId) ) { $pattern = str_replace(array('^[', '*$'), array('[^', ''), $pattern); $cacheId = preg_replace($pattern, '_', $cacheId); } return $cacheId; }
php
protected function normalizeKey($cacheId) { $cacheId = parent::normalizeKey($cacheId); if (($pattern = $this->cache->getOptions()->getKeyPattern()) && !preg_match($pattern, $cacheId) ) { $pattern = str_replace(array('^[', '*$'), array('[^', ''), $pattern); $cacheId = preg_replace($pattern, '_', $cacheId); } return $cacheId; }
[ "protected", "function", "normalizeKey", "(", "$", "cacheId", ")", "{", "$", "cacheId", "=", "parent", "::", "normalizeKey", "(", "$", "cacheId", ")", ";", "if", "(", "(", "$", "pattern", "=", "$", "this", "->", "cache", "->", "getOptions", "(", ")", ...
normalizes the cache id for zend cache @param string $cacheId The cache id @return string The formated cache id
[ "normalizes", "the", "cache", "id", "for", "zend", "cache" ]
9fc307df74f782a879f4604ab99bf61ecfc165d4
https://github.com/mimmi20/WurflCache/blob/9fc307df74f782a879f4604ab99bf61ecfc165d4/src/Adapter/ZendCacheConnector.php#L151-L164
train
mimmi20/WurflCache
src/Adapter/ZendCacheConnector.php
ZendCacheConnector.flush
public function flush() { if (!($this->cache instanceof FlushableInterface)) { return false; } try { return $this->cache->flush(); } catch (ZendException\ExceptionInterface $ex) { return false; } }
php
public function flush() { if (!($this->cache instanceof FlushableInterface)) { return false; } try { return $this->cache->flush(); } catch (ZendException\ExceptionInterface $ex) { return false; } }
[ "public", "function", "flush", "(", ")", "{", "if", "(", "!", "(", "$", "this", "->", "cache", "instanceof", "FlushableInterface", ")", ")", "{", "return", "false", ";", "}", "try", "{", "return", "$", "this", "->", "cache", "->", "flush", "(", ")", ...
Flush the whole storage @return bool
[ "Flush", "the", "whole", "storage" ]
9fc307df74f782a879f4604ab99bf61ecfc165d4
https://github.com/mimmi20/WurflCache/blob/9fc307df74f782a879f4604ab99bf61ecfc165d4/src/Adapter/ZendCacheConnector.php#L189-L200
train
nabu-3/core
nabu/data/medioteca/base/CNabuMediotecaLanguageBase.php
CNabuMediotecaLanguageBase.setMediotecaId
public function setMediotecaId(int $nb_medioteca_id) : CNabuDataObject { if ($nb_medioteca_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_medioteca_id") ); } $this->setValue('nb_medioteca_id', $nb_medioteca_id); return $this; }
php
public function setMediotecaId(int $nb_medioteca_id) : CNabuDataObject { if ($nb_medioteca_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_medioteca_id") ); } $this->setValue('nb_medioteca_id', $nb_medioteca_id); return $this; }
[ "public", "function", "setMediotecaId", "(", "int", "$", "nb_medioteca_id", ")", ":", "CNabuDataObject", "{", "if", "(", "$", "nb_medioteca_id", "===", "null", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", "::", "ERROR_NULL_VALUE_NOT_ALL...
Sets the Medioteca Id attribute value. @param int $nb_medioteca_id New value for attribute @return CNabuDataObject Returns self instance to grant chained setters call.
[ "Sets", "the", "Medioteca", "Id", "attribute", "value", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/medioteca/base/CNabuMediotecaLanguageBase.php#L184-L195
train
xtlsoft/NonDB
src/Components/Data.php
Data.findOne
public function findOne(){ foreach($this->data as $k=>$v){ $key = $k; break; } if(is_array($this->data[$key])){ return (new \NonDB\Data($this->data[$key], $key))->setParent($this); }else{ return $this->data[$key]; } }
php
public function findOne(){ foreach($this->data as $k=>$v){ $key = $k; break; } if(is_array($this->data[$key])){ return (new \NonDB\Data($this->data[$key], $key))->setParent($this); }else{ return $this->data[$key]; } }
[ "public", "function", "findOne", "(", ")", "{", "foreach", "(", "$", "this", "->", "data", "as", "$", "k", "=>", "$", "v", ")", "{", "$", "key", "=", "$", "k", ";", "break", ";", "}", "if", "(", "is_array", "(", "$", "this", "->", "data", "["...
Get one of the data. @return \NonDB\data
[ "Get", "one", "of", "the", "data", "." ]
6599c13bb5feabe77d91764fdf3c24b786c777b2
https://github.com/xtlsoft/NonDB/blob/6599c13bb5feabe77d91764fdf3c24b786c777b2/src/Components/Data.php#L126-L139
train
xtlsoft/NonDB
src/Components/Data.php
Data.findByKey
public function findByKey($rule){ $r = []; foreach($this->data as $k=>$v){ if($rule($k)){ $r[] = $this->{$k}; } } return $r; }
php
public function findByKey($rule){ $r = []; foreach($this->data as $k=>$v){ if($rule($k)){ $r[] = $this->{$k}; } } return $r; }
[ "public", "function", "findByKey", "(", "$", "rule", ")", "{", "$", "r", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "data", "as", "$", "k", "=>", "$", "v", ")", "{", "if", "(", "$", "rule", "(", "$", "k", ")", ")", "{", "$", "...
Find something by the key @param Callable $rule @return array
[ "Find", "something", "by", "the", "key" ]
6599c13bb5feabe77d91764fdf3c24b786c777b2
https://github.com/xtlsoft/NonDB/blob/6599c13bb5feabe77d91764fdf3c24b786c777b2/src/Components/Data.php#L171-L183
train
xtlsoft/NonDB
src/Components/Data.php
Data.sort
public function sort($rule, $algorithm = "DefaultSort"){ $class = "\\NonDB\\Sorter\\" . $algorithm; if(!class_exists($class) || !( \NonDB\Components\Tool::checkImplement($class, "NonDB\\Interfaces\\Sorter") )){ throw new \NonDB\Exceptions\DataException("Sorter $class didn't exists.", "0011"); return false; } $sorter = eval("return new ". $class . "(\$rule);"); $sorted = $sorter->sort($this->getArray()); $result = (new \NonDB\Data($sorted, $this->key))->setParent($this->parent); return $result; }
php
public function sort($rule, $algorithm = "DefaultSort"){ $class = "\\NonDB\\Sorter\\" . $algorithm; if(!class_exists($class) || !( \NonDB\Components\Tool::checkImplement($class, "NonDB\\Interfaces\\Sorter") )){ throw new \NonDB\Exceptions\DataException("Sorter $class didn't exists.", "0011"); return false; } $sorter = eval("return new ". $class . "(\$rule);"); $sorted = $sorter->sort($this->getArray()); $result = (new \NonDB\Data($sorted, $this->key))->setParent($this->parent); return $result; }
[ "public", "function", "sort", "(", "$", "rule", ",", "$", "algorithm", "=", "\"DefaultSort\"", ")", "{", "$", "class", "=", "\"\\\\NonDB\\\\Sorter\\\\\"", ".", "$", "algorithm", ";", "if", "(", "!", "class_exists", "(", "$", "class", ")", "||", "!", "(",...
Sort The Data @param Callable $rule @param string $algorithm @throws \NonDB\Exceptions\DataException @return \NonDB\Data
[ "Sort", "The", "Data" ]
6599c13bb5feabe77d91764fdf3c24b786c777b2
https://github.com/xtlsoft/NonDB/blob/6599c13bb5feabe77d91764fdf3c24b786c777b2/src/Components/Data.php#L196-L213
train
rips/php-connector-bundle
Hydrators/OAuth2/ClientHydrator.php
ClientHydrator.hydrateCollection
public static function hydrateCollection(array $clients) { $hydrated = []; foreach ($clients as $client) { $hydrated[] = self::hydrate($client); } return $hydrated; }
php
public static function hydrateCollection(array $clients) { $hydrated = []; foreach ($clients as $client) { $hydrated[] = self::hydrate($client); } return $hydrated; }
[ "public", "static", "function", "hydrateCollection", "(", "array", "$", "clients", ")", "{", "$", "hydrated", "=", "[", "]", ";", "foreach", "(", "$", "clients", "as", "$", "client", ")", "{", "$", "hydrated", "[", "]", "=", "self", "::", "hydrate", ...
Hydrate a collection of client object into a collection of ClientEntity objects @param stdClass[] $clients @return ClientEntity[]
[ "Hydrate", "a", "collection", "of", "client", "object", "into", "a", "collection", "of", "ClientEntity", "objects" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/OAuth2/ClientHydrator.php#L17-L26
train
rips/php-connector-bundle
Hydrators/OAuth2/ClientHydrator.php
ClientHydrator.hydrate
public static function hydrate(stdClass $client) { $hydrated = new ClientEntity(); if (isset($client->id)) { $hydrated->setId($client->id); } if (isset($client->name)) { $hydrated->setName($client->name); } if (isset($client->random_id)) { $hydrated->setRandomId($client->random_id); } if (isset($client->secret)) { $hydrated->setSecret($client->secret); } if (isset($client->allowed_grant_types)) { $hydrated->setAllowedGrantTypes($client->allowed_grant_types); } if (isset($client->redirect_uris)) { $hydrated->setRedirectUris($client->redirect_uris); } return $hydrated; }
php
public static function hydrate(stdClass $client) { $hydrated = new ClientEntity(); if (isset($client->id)) { $hydrated->setId($client->id); } if (isset($client->name)) { $hydrated->setName($client->name); } if (isset($client->random_id)) { $hydrated->setRandomId($client->random_id); } if (isset($client->secret)) { $hydrated->setSecret($client->secret); } if (isset($client->allowed_grant_types)) { $hydrated->setAllowedGrantTypes($client->allowed_grant_types); } if (isset($client->redirect_uris)) { $hydrated->setRedirectUris($client->redirect_uris); } return $hydrated; }
[ "public", "static", "function", "hydrate", "(", "stdClass", "$", "client", ")", "{", "$", "hydrated", "=", "new", "ClientEntity", "(", ")", ";", "if", "(", "isset", "(", "$", "client", "->", "id", ")", ")", "{", "$", "hydrated", "->", "setId", "(", ...
Hydrate a client object into a ClientEntity object @param stdClass $client @return ClientEntity
[ "Hydrate", "a", "client", "object", "into", "a", "ClientEntity", "object" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/OAuth2/ClientHydrator.php#L34-L63
train
nabu-3/core
nabu/data/catalog/base/CNabuCatalogBase.php
CNabuCatalogBase.getAllCatalogs
public static function getAllCatalogs(CNabuCustomer $nb_customer) { $nb_customer_id = nb_getMixedValue($nb_customer, 'nb_customer_id'); if (is_numeric($nb_customer_id)) { $retval = forward_static_call( array(get_called_class(), 'buildObjectListFromSQL'), 'nb_catalog_id', 'select * ' . 'from nb_catalog ' . 'where nb_customer_id=%cust_id$d', array( 'cust_id' => $nb_customer_id ), $nb_customer ); } else { $retval = new CNabuCatalogList(); } return $retval; }
php
public static function getAllCatalogs(CNabuCustomer $nb_customer) { $nb_customer_id = nb_getMixedValue($nb_customer, 'nb_customer_id'); if (is_numeric($nb_customer_id)) { $retval = forward_static_call( array(get_called_class(), 'buildObjectListFromSQL'), 'nb_catalog_id', 'select * ' . 'from nb_catalog ' . 'where nb_customer_id=%cust_id$d', array( 'cust_id' => $nb_customer_id ), $nb_customer ); } else { $retval = new CNabuCatalogList(); } return $retval; }
[ "public", "static", "function", "getAllCatalogs", "(", "CNabuCustomer", "$", "nb_customer", ")", "{", "$", "nb_customer_id", "=", "nb_getMixedValue", "(", "$", "nb_customer", ",", "'nb_customer_id'", ")", ";", "if", "(", "is_numeric", "(", "$", "nb_customer_id", ...
Get all items in the storage as an associative array where the field 'nb_catalog_id' is the index, and each value is an instance of class CNabuCatalogBase. @param CNabuCustomer $nb_customer The CNabuCustomer instance of the Customer that owns the Catalog List. @return mixed Returns and array with all items.
[ "Get", "all", "items", "in", "the", "storage", "as", "an", "associative", "array", "where", "the", "field", "nb_catalog_id", "is", "the", "index", "and", "each", "value", "is", "an", "instance", "of", "class", "CNabuCatalogBase", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/catalog/base/CNabuCatalogBase.php#L180-L200
train
nabu-3/core
nabu/data/catalog/traits/TNabuCatalogChild.php
TNabuCatalogChild.getCatalog
public function getCatalog($force = false) { if ($this->nb_catalog === null || $force) { $this->nb_catalog = null; if ($this instanceof CNabuDataObject && !$this->isBuiltIn() && $this->isValueNumeric(NABU_CATALOG_FIELD_ID) ) { $nb_aux_catalog = new CNabuCatalog($this->getValue(NABU_CATALOG_FIELD_ID)); if ($nb_aux_catalog->isFetched()) { $this->nb_catalog = $nb_aux_catalog; } } } return $this->nb_catalog; }
php
public function getCatalog($force = false) { if ($this->nb_catalog === null || $force) { $this->nb_catalog = null; if ($this instanceof CNabuDataObject && !$this->isBuiltIn() && $this->isValueNumeric(NABU_CATALOG_FIELD_ID) ) { $nb_aux_catalog = new CNabuCatalog($this->getValue(NABU_CATALOG_FIELD_ID)); if ($nb_aux_catalog->isFetched()) { $this->nb_catalog = $nb_aux_catalog; } } } return $this->nb_catalog; }
[ "public", "function", "getCatalog", "(", "$", "force", "=", "false", ")", "{", "if", "(", "$", "this", "->", "nb_catalog", "===", "null", "||", "$", "force", ")", "{", "$", "this", "->", "nb_catalog", "=", "null", ";", "if", "(", "$", "this", "inst...
Gets the Catalog instance that owns this object. @param bool $force If true force to reload catalog instance from database. @return CNabuCatalog Returns the catalog instance if exists or null if not.
[ "Gets", "the", "Catalog", "instance", "that", "owns", "this", "object", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/catalog/traits/TNabuCatalogChild.php#L48-L64
train
nabu-3/core
nabu/data/catalog/traits/TNabuCatalogChild.php
TNabuCatalogChild.setCatalog
public function setCatalog(CNabuCatalog $nb_catalog) { $this->nb_catalog = $nb_catalog; if ($this instanceof CNabuDataObject && $nb_catalog->contains(NABU_CATALOG_FIELD_ID)) { $this->transferValue($nb_catalog, NABU_CATALOG_FIELD_ID); } return $this; }
php
public function setCatalog(CNabuCatalog $nb_catalog) { $this->nb_catalog = $nb_catalog; if ($this instanceof CNabuDataObject && $nb_catalog->contains(NABU_CATALOG_FIELD_ID)) { $this->transferValue($nb_catalog, NABU_CATALOG_FIELD_ID); } return $this; }
[ "public", "function", "setCatalog", "(", "CNabuCatalog", "$", "nb_catalog", ")", "{", "$", "this", "->", "nb_catalog", "=", "$", "nb_catalog", ";", "if", "(", "$", "this", "instanceof", "CNabuDataObject", "&&", "$", "nb_catalog", "->", "contains", "(", "NABU...
Sets the Catalog instance that onws this object. @param CNabuCatalog $nb_catalog The Catalog instance to be setted. @return mixed Return $this to grant cascade chain.
[ "Sets", "the", "Catalog", "instance", "that", "onws", "this", "object", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/catalog/traits/TNabuCatalogChild.php#L71-L79
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.getFactory
public static function getFactory() { if (self::$nb_provider_factory === null) { self::$nb_provider_factory = new CNabuProviderFactory(); self::$nb_provider_factory->init(); } return self::$nb_provider_factory; }
php
public static function getFactory() { if (self::$nb_provider_factory === null) { self::$nb_provider_factory = new CNabuProviderFactory(); self::$nb_provider_factory->init(); } return self::$nb_provider_factory; }
[ "public", "static", "function", "getFactory", "(", ")", "{", "if", "(", "self", "::", "$", "nb_provider_factory", "===", "null", ")", "{", "self", "::", "$", "nb_provider_factory", "=", "new", "CNabuProviderFactory", "(", ")", ";", "self", "::", "$", "nb_p...
If singleton instance does not exists then instantiate it. @return CNabuProviderFactory Returns singleton instance @throws ENabuSingletonException
[ "If", "singleton", "instance", "does", "not", "exists", "then", "instantiate", "it", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L89-L97
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.scanProvidersFolder
public function scanProvidersFolder() { $folders = array(); $this->scanVendorFolders($folders); if (count($folders) > 0) { foreach ($folders as $provider) { try { nb_requireOnceIsolated($provider, true, true); } catch (Exception $ex) { throw new ENabuProviderException( ENabuProviderException::ERROR_MANAGER_NOT_INITIALIZED, array($provider) ); } } } }
php
public function scanProvidersFolder() { $folders = array(); $this->scanVendorFolders($folders); if (count($folders) > 0) { foreach ($folders as $provider) { try { nb_requireOnceIsolated($provider, true, true); } catch (Exception $ex) { throw new ENabuProviderException( ENabuProviderException::ERROR_MANAGER_NOT_INITIALIZED, array($provider) ); } } } }
[ "public", "function", "scanProvidersFolder", "(", ")", "{", "$", "folders", "=", "array", "(", ")", ";", "$", "this", "->", "scanVendorFolders", "(", "$", "folders", ")", ";", "if", "(", "count", "(", "$", "folders", ")", ">", "0", ")", "{", "foreach...
Scan providers folder to detect installed provider modules.
[ "Scan", "providers", "folder", "to", "detect", "installed", "provider", "modules", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L119-L136
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.scanVendorFolders
private function scanVendorFolders(&$folders) { $basedir = realpath(NABU_PROVIDERS_PATH); if (is_dir($basedir) && ($h = opendir($basedir))) { while (($folder = readdir($h))) { if ($folder !== '.' && $folder !== '..') { $this->scanModuleFolders($basedir . DIRECTORY_SEPARATOR . $folder, $folders); } } closedir($h); } }
php
private function scanVendorFolders(&$folders) { $basedir = realpath(NABU_PROVIDERS_PATH); if (is_dir($basedir) && ($h = opendir($basedir))) { while (($folder = readdir($h))) { if ($folder !== '.' && $folder !== '..') { $this->scanModuleFolders($basedir . DIRECTORY_SEPARATOR . $folder, $folders); } } closedir($h); } }
[ "private", "function", "scanVendorFolders", "(", "&", "$", "folders", ")", "{", "$", "basedir", "=", "realpath", "(", "NABU_PROVIDERS_PATH", ")", ";", "if", "(", "is_dir", "(", "$", "basedir", ")", "&&", "(", "$", "h", "=", "opendir", "(", "$", "basedi...
Scan vendor folders to find modules. @param array &$folders Array passed by reference to be filled with modules found.
[ "Scan", "vendor", "folders", "to", "find", "modules", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L142-L153
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.scanModuleFolders
private function scanModuleFolders($basedir, &$folders) { if (is_dir($basedir) && ($h = opendir($basedir))) { while (($folder = readdir($h))) { if ($folder !== '.' && $folder !== '..') { $this->scanModuleFiles($basedir . DIRECTORY_SEPARATOR . $folder, $folders); } } closedir($h); } }
php
private function scanModuleFolders($basedir, &$folders) { if (is_dir($basedir) && ($h = opendir($basedir))) { while (($folder = readdir($h))) { if ($folder !== '.' && $folder !== '..') { $this->scanModuleFiles($basedir . DIRECTORY_SEPARATOR . $folder, $folders); } } closedir($h); } }
[ "private", "function", "scanModuleFolders", "(", "$", "basedir", ",", "&", "$", "folders", ")", "{", "if", "(", "is_dir", "(", "$", "basedir", ")", "&&", "(", "$", "h", "=", "opendir", "(", "$", "basedir", ")", ")", ")", "{", "while", "(", "(", "...
Scan module folders to prepare init mechanism. @param string $basedir Base directory to looking for module folders. @param array &$folders Array passed by reference to be filled with modules found.
[ "Scan", "module", "folders", "to", "prepare", "init", "mechanism", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L160-L170
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.scanModuleFiles
private function scanModuleFiles($basedir, &$folders) { if (is_dir($basedir) && ($h = opendir($basedir))) { while (($filename = readdir($h))) { $phpfile = $basedir . DIRECTORY_SEPARATOR . $filename; if (preg_match('/^init[_|-](.+)\.php$/', $filename) && file_exists($phpfile) && filesize($phpfile) > 0) { $folders[] = $phpfile; } } closedir($h); } }
php
private function scanModuleFiles($basedir, &$folders) { if (is_dir($basedir) && ($h = opendir($basedir))) { while (($filename = readdir($h))) { $phpfile = $basedir . DIRECTORY_SEPARATOR . $filename; if (preg_match('/^init[_|-](.+)\.php$/', $filename) && file_exists($phpfile) && filesize($phpfile) > 0) { $folders[] = $phpfile; } } closedir($h); } }
[ "private", "function", "scanModuleFiles", "(", "$", "basedir", ",", "&", "$", "folders", ")", "{", "if", "(", "is_dir", "(", "$", "basedir", ")", "&&", "(", "$", "h", "=", "opendir", "(", "$", "basedir", ")", ")", ")", "{", "while", "(", "(", "$"...
Scan module root files to locate the init file. @param string $basedir Base directory to looking for module files. @param array &$folders Array passed by reference to be filled with modules found.
[ "Scan", "module", "root", "files", "to", "locate", "the", "init", "file", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L177-L188
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.addManager
public function addManager(INabuProviderManager $nb_manager) { $vendor_key = $nb_manager->getVendorKey(); if (nb_isValidKey($vendor_key)) { $module_key = $nb_manager->getModuleKey(); if (!nb_isValidKey($module_key)) { throw new ENabuProviderException( ENabuProviderException::ERROR_MODULE_KEY_NOT_VALID, array($module_key) ); } } else { throw new ENabuProviderException( ENabuProviderException::ERROR_VENDOR_KEY_NOT_VALID, array($vendor_key) ); } $this->nb_manager_list->addItem($nb_manager); if (!$nb_manager->enableManager()) { throw new ENabuProviderException( ENabuProviderException::ERROR_PROVIDER_MANAGER_FAIL, array(get_class($nb_manager)) ); } $nb_application = CNabuEngine::getEngine()->getApplication(); if ($nb_application instanceof INabuApplication) { $nb_manager->registerApplication($nb_application); } return $nb_manager; }
php
public function addManager(INabuProviderManager $nb_manager) { $vendor_key = $nb_manager->getVendorKey(); if (nb_isValidKey($vendor_key)) { $module_key = $nb_manager->getModuleKey(); if (!nb_isValidKey($module_key)) { throw new ENabuProviderException( ENabuProviderException::ERROR_MODULE_KEY_NOT_VALID, array($module_key) ); } } else { throw new ENabuProviderException( ENabuProviderException::ERROR_VENDOR_KEY_NOT_VALID, array($vendor_key) ); } $this->nb_manager_list->addItem($nb_manager); if (!$nb_manager->enableManager()) { throw new ENabuProviderException( ENabuProviderException::ERROR_PROVIDER_MANAGER_FAIL, array(get_class($nb_manager)) ); } $nb_application = CNabuEngine::getEngine()->getApplication(); if ($nb_application instanceof INabuApplication) { $nb_manager->registerApplication($nb_application); } return $nb_manager; }
[ "public", "function", "addManager", "(", "INabuProviderManager", "$", "nb_manager", ")", "{", "$", "vendor_key", "=", "$", "nb_manager", "->", "getVendorKey", "(", ")", ";", "if", "(", "nb_isValidKey", "(", "$", "vendor_key", ")", ")", "{", "$", "module_key"...
Adds a manager to the managers list. @param INabuProviderManager $nb_manager Manager to be added. @return INabuProviderManager Returns the added manager if success or false if not.
[ "Adds", "a", "manager", "to", "the", "managers", "list", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L195-L228
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.getManager
public function getManager(string $vendor_key, string $module_key) { if (nb_isValidKey($vendor_key) && nb_isValidKey($module_key)) { return $this->nb_manager_list->getItem("$vendor_key:$module_key"); } else { throw new ENabuProviderException(ENabuProviderException::ERROR_INVALID_KEYS); } }
php
public function getManager(string $vendor_key, string $module_key) { if (nb_isValidKey($vendor_key) && nb_isValidKey($module_key)) { return $this->nb_manager_list->getItem("$vendor_key:$module_key"); } else { throw new ENabuProviderException(ENabuProviderException::ERROR_INVALID_KEYS); } }
[ "public", "function", "getManager", "(", "string", "$", "vendor_key", ",", "string", "$", "module_key", ")", "{", "if", "(", "nb_isValidKey", "(", "$", "vendor_key", ")", "&&", "nb_isValidKey", "(", "$", "module_key", ")", ")", "{", "return", "$", "this", ...
Gets a Manager instance. This method is intended normally to be used internally and inside provider modules. @param string $vendor_key Vendor Key to identify the Manager. @param string $module_key Module Key to identify the Manager. @return INabuProviderManager Returns the Manager instance if exists or false if not. @throws ENabuProviderException Raises an exception if $vendor_key or $module_key have invalid values.
[ "Gets", "a", "Manager", "instance", ".", "This", "method", "is", "intended", "normally", "to", "be", "used", "internally", "and", "inside", "provider", "modules", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L237-L245
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.addInterface
public function addInterface(CNabuProviderInterfaceDescriptor $nb_descriptor) { $interface_type = $nb_descriptor->getType(); if (!array_key_exists($interface_type, $this->nb_interface_list)) { throw new ENabuProviderException( ENabuProviderException::ERROR_INTERFACE_TYPE_NOT_EXISTS, array(print_r($interface_type, true)) ); } $retval = $this->nb_interface_list[$interface_type]->addItem($nb_descriptor); if ($retval === false) { throw new ENabuProviderException( ENabuProviderException::ERROR_INTERFACE_ALREADY_REGISTERED, array($nb_descriptor->getClassName()) ); } return $retval; }
php
public function addInterface(CNabuProviderInterfaceDescriptor $nb_descriptor) { $interface_type = $nb_descriptor->getType(); if (!array_key_exists($interface_type, $this->nb_interface_list)) { throw new ENabuProviderException( ENabuProviderException::ERROR_INTERFACE_TYPE_NOT_EXISTS, array(print_r($interface_type, true)) ); } $retval = $this->nb_interface_list[$interface_type]->addItem($nb_descriptor); if ($retval === false) { throw new ENabuProviderException( ENabuProviderException::ERROR_INTERFACE_ALREADY_REGISTERED, array($nb_descriptor->getClassName()) ); } return $retval; }
[ "public", "function", "addInterface", "(", "CNabuProviderInterfaceDescriptor", "$", "nb_descriptor", ")", "{", "$", "interface_type", "=", "$", "nb_descriptor", "->", "getType", "(", ")", ";", "if", "(", "!", "array_key_exists", "(", "$", "interface_type", ",", ...
Adds an interface to the interfaces list. @param CNabuProviderInterfaceDescriptor $nb_descriptor Descriptor instance of the interface. @return bool Returns true if the interface is registered.
[ "Adds", "an", "interface", "to", "the", "interfaces", "list", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L252-L271
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.getInterfaceDescriptors
public function getInterfaceDescriptors(int $interface_type) { if (!array_key_exists($interface_type, $this->nb_interface_list)) { throw new ENabuProviderException( ENabuProviderException::ERROR_INTERFACE_TYPE_NOT_EXISTS, array(print_r($interface_type, true)) ); } return $this->nb_interface_list[$interface_type]; }
php
public function getInterfaceDescriptors(int $interface_type) { if (!array_key_exists($interface_type, $this->nb_interface_list)) { throw new ENabuProviderException( ENabuProviderException::ERROR_INTERFACE_TYPE_NOT_EXISTS, array(print_r($interface_type, true)) ); } return $this->nb_interface_list[$interface_type]; }
[ "public", "function", "getInterfaceDescriptors", "(", "int", "$", "interface_type", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "interface_type", ",", "$", "this", "->", "nb_interface_list", ")", ")", "{", "throw", "new", "ENabuProviderException", "(...
Gets the interfaces descriptor list of a type of interfaces. @param int $interface_type Interface type to be retrieved. @return CNabuProviderInterfaceDescriptorList The list of available interfaces.
[ "Gets", "the", "interfaces", "descriptor", "list", "of", "a", "type", "of", "interfaces", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L278-L288
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.getInterfaceDescriptor
public function getInterfaceDescriptor(string $vendor, string $module, int $interface_type, string $interface) { if (!array_key_exists($interface_type, $this->nb_interface_list)) { throw new ENabuProviderException( ENabuProviderException::ERROR_INTERFACE_TYPE_NOT_EXISTS, array(print_r($interface_type, true)) ); } $nb_descriptor = null; $this->nb_interface_list[$interface_type]->iterate( function ($key, $nb_interface_desc) use ($vendor, $module, $interface, &$nb_descriptor) { $retval = true; $nb_manager = $nb_interface_desc->getManager(); if ($nb_manager->getVendorKey() === $vendor && $nb_manager->getModuleKey() === $module && $nb_interface_desc->getClassName() === $interface ) { $nb_descriptor = $nb_interface_desc; $retval = false; } return $retval; } ); return $nb_descriptor; }
php
public function getInterfaceDescriptor(string $vendor, string $module, int $interface_type, string $interface) { if (!array_key_exists($interface_type, $this->nb_interface_list)) { throw new ENabuProviderException( ENabuProviderException::ERROR_INTERFACE_TYPE_NOT_EXISTS, array(print_r($interface_type, true)) ); } $nb_descriptor = null; $this->nb_interface_list[$interface_type]->iterate( function ($key, $nb_interface_desc) use ($vendor, $module, $interface, &$nb_descriptor) { $retval = true; $nb_manager = $nb_interface_desc->getManager(); if ($nb_manager->getVendorKey() === $vendor && $nb_manager->getModuleKey() === $module && $nb_interface_desc->getClassName() === $interface ) { $nb_descriptor = $nb_interface_desc; $retval = false; } return $retval; } ); return $nb_descriptor; }
[ "public", "function", "getInterfaceDescriptor", "(", "string", "$", "vendor", ",", "string", "$", "module", ",", "int", "$", "interface_type", ",", "string", "$", "interface", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "interface_type", ",", "$"...
Gets an Interface descriptor. @param string $vendor Vendor key. @param string $module Module key. @param int $interface_type Interface type. @param string $interface Interface name to be retrieved. @return CNabuProviderInterfaceDescriptor|null Returns the descriptor found if any, or null if not found.
[ "Gets", "an", "Interface", "descriptor", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L298-L326
train
nabu-3/core
nabu/provider/CNabuProviderFactory.php
CNabuProviderFactory.registerApplication
public function registerApplication(INabuApplication $nb_application) { $this->nb_manager_list->iterate( function($key, $manager) use ($nb_application) { $manager->registerApplication($nb_application); return true; } ); }
php
public function registerApplication(INabuApplication $nb_application) { $this->nb_manager_list->iterate( function($key, $manager) use ($nb_application) { $manager->registerApplication($nb_application); return true; } ); }
[ "public", "function", "registerApplication", "(", "INabuApplication", "$", "nb_application", ")", "{", "$", "this", "->", "nb_manager_list", "->", "iterate", "(", "function", "(", "$", "key", ",", "$", "manager", ")", "use", "(", "$", "nb_application", ")", ...
Register the application to connect all available managers with it. @param INabuApplication $nb_application Application instance to be registered.
[ "Register", "the", "application", "to", "connect", "all", "available", "managers", "with", "it", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/provider/CNabuProviderFactory.php#L332-L341
train
rips/php-connector-bundle
Services/Application/Scan/ComparisonService.php
ComparisonService.getComparison
public function getComparison($appId, $scanId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->comparisons() ->getComparison($appId, $scanId, $queryParams); return new ComparisonResponse($response); }
php
public function getComparison($appId, $scanId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->comparisons() ->getComparison($appId, $scanId, $queryParams); return new ComparisonResponse($response); }
[ "public", "function", "getComparison", "(", "$", "appId", ",", "$", "scanId", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applications", "(", ")", "->", "scans", "(", ")", "->", ...
Get comparison stats for a scan @param $appId @param $scanId @param array $queryParams @return ComparisonResponse
[ "Get", "comparison", "stats", "for", "a", "scan" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Scan/ComparisonService.php#L33-L42
train
rips/php-connector-bundle
Hydrators/Application/Scan/SinkHydrator.php
SinkHydrator.hydrateCollection
public static function hydrateCollection(array $sinks) { $hydrated = []; foreach ($sinks as $sink) { $hydrated[] = self::hydrate($sink); } return $hydrated; }
php
public static function hydrateCollection(array $sinks) { $hydrated = []; foreach ($sinks as $sink) { $hydrated[] = self::hydrate($sink); } return $hydrated; }
[ "public", "static", "function", "hydrateCollection", "(", "array", "$", "sinks", ")", "{", "$", "hydrated", "=", "[", "]", ";", "foreach", "(", "$", "sinks", "as", "$", "sink", ")", "{", "$", "hydrated", "[", "]", "=", "self", "::", "hydrate", "(", ...
Hydrate a collection of sink objects into a collection of SinkEntity objects @param stdClass[] $sinks @return SinkEntity[]
[ "Hydrate", "a", "collection", "of", "sink", "objects", "into", "a", "collection", "of", "SinkEntity", "objects" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/Application/Scan/SinkHydrator.php#L18-L27
train
rips/php-connector-bundle
Services/Application/Profile/ValidatorService.php
ValidatorService.getAll
public function getAll($appId, $profileId, array $queryParams) { $response = $this->api->applications()->profiles()->validators()->getAll($appId, $profileId, $queryParams); return new ValidatorsResponse($response); }
php
public function getAll($appId, $profileId, array $queryParams) { $response = $this->api->applications()->profiles()->validators()->getAll($appId, $profileId, $queryParams); return new ValidatorsResponse($response); }
[ "public", "function", "getAll", "(", "$", "appId", ",", "$", "profileId", ",", "array", "$", "queryParams", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applications", "(", ")", "->", "profiles", "(", ")", "->", "validators", "(", ...
Get all validators for a profile profile @param int $appId @param int $profileId @param array $queryParams @return ValidatorsResponse
[ "Get", "all", "validators", "for", "a", "profile", "profile" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Profile/ValidatorService.php#L36-L41
train
rips/php-connector-bundle
Services/Application/Profile/ValidatorService.php
ValidatorService.getById
public function getById($appId, $profileId, $validatorId, array $queryParams = []) { $response = $this->api->applications()->profiles()->validators()->getById($appId, $profileId, $validatorId, $queryParams); return new ValidatorResponse($response); }
php
public function getById($appId, $profileId, $validatorId, array $queryParams = []) { $response = $this->api->applications()->profiles()->validators()->getById($appId, $profileId, $validatorId, $queryParams); return new ValidatorResponse($response); }
[ "public", "function", "getById", "(", "$", "appId", ",", "$", "profileId", ",", "$", "validatorId", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applications", "(", ")", "->", "prof...
Get validator for profile profile by id @param int $appId @param int $profileId @param int $validatorId @param array $queryParams @return ValidatorResponse
[ "Get", "validator", "for", "profile", "profile", "by", "id" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Profile/ValidatorService.php#L52-L57
train
rips/php-connector-bundle
Services/Application/Profile/ValidatorService.php
ValidatorService.create
public function create($appId, $profileId, ValidatorBuilder $input, array $queryParams = []) { $response = $this->api->applications()->profiles()->validators()->create($appId, $profileId, $input->toArray(), $queryParams); return new ValidatorResponse($response); }
php
public function create($appId, $profileId, ValidatorBuilder $input, array $queryParams = []) { $response = $this->api->applications()->profiles()->validators()->create($appId, $profileId, $input->toArray(), $queryParams); return new ValidatorResponse($response); }
[ "public", "function", "create", "(", "$", "appId", ",", "$", "profileId", ",", "ValidatorBuilder", "$", "input", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applications", "(", ")", ...
Create validator for profile profile @param int $appId @param int $profileId @param ValidatorBuilder $input @param array $queryParams @return ValidatorResponse
[ "Create", "validator", "for", "profile", "profile" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Profile/ValidatorService.php#L68-L73
train
nabu-3/core
nabu/data/site/base/CNabuSiteTargetMediotecaBase.php
CNabuSiteTargetMediotecaBase.setSiteTargetId
public function setSiteTargetId(int $nb_site_target_id) : CNabuDataObject { if ($nb_site_target_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_site_target_id") ); } $this->setValue('nb_site_target_id', $nb_site_target_id); return $this; }
php
public function setSiteTargetId(int $nb_site_target_id) : CNabuDataObject { if ($nb_site_target_id === null) { throw new ENabuCoreException( ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN, array("\$nb_site_target_id") ); } $this->setValue('nb_site_target_id', $nb_site_target_id); return $this; }
[ "public", "function", "setSiteTargetId", "(", "int", "$", "nb_site_target_id", ")", ":", "CNabuDataObject", "{", "if", "(", "$", "nb_site_target_id", "===", "null", ")", "{", "throw", "new", "ENabuCoreException", "(", "ENabuCoreException", "::", "ERROR_NULL_VALUE_NO...
Sets the Site Target Id attribute value. @param int $nb_site_target_id New value for attribute @return CNabuDataObject Returns self instance to grant chained setters call.
[ "Sets", "the", "Site", "Target", "Id", "attribute", "value", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteTargetMediotecaBase.php#L148-L159
train
nabu-3/core
nabu/http/app/base/CNabuHTTPApplication.php
CNabuHTTPApplication.init
protected function init() { $this->prepareHTTPManagers(); $this->prepareHTTPRendersManager(); $this->prepareMediotecasManager(); $this->nb_engine->registerApplication($this); }
php
protected function init() { $this->prepareHTTPManagers(); $this->prepareHTTPRendersManager(); $this->prepareMediotecasManager(); $this->nb_engine->registerApplication($this); }
[ "protected", "function", "init", "(", ")", "{", "$", "this", "->", "prepareHTTPManagers", "(", ")", ";", "$", "this", "->", "prepareHTTPRendersManager", "(", ")", ";", "$", "this", "->", "prepareMediotecasManager", "(", ")", ";", "$", "this", "->", "nb_eng...
Initializes the instance and register them in the Engine.
[ "Initializes", "the", "instance", "and", "register", "them", "in", "the", "Engine", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/http/app/base/CNabuHTTPApplication.php#L107-L114
train
nabu-3/core
nabu/http/app/base/CNabuHTTPApplication.php
CNabuHTTPApplication.run
final public function run() { $this->nb_http_server = $this->nb_engine->getHTTPServer(); if (!($this->nb_http_server instanceof INabuHTTPServerInterface)) { throw new ENabuCoreException(ENabuCoreException::ERROR_HTTP_SERVER_NOT_FOUND); } $this->prepareSecurityManager(); $this->preparePluginsManager(); $this->prepareModulesManager(); $this->nb_session = CNabuHTTPSession::getSession(); $this->nb_engine->traceLog("Cookies", $_COOKIE); // If the request is not allowed then treat it as a redirection or an error try { if ($this->prepareRequest()) { $method = $this->nb_request->getMethod(); $this->prepareCookies(); $this->prepareLocale(); if ($this->validateCORSOrigin()) { if ($method !== 'OPTIONS') { $this->prepareModules(); } if ($this->prepareResponse() && $this->processMethods() && $this->processCommands() ) { if ($method !== 'OPTIONS' && $method !== 'HEAD') { $this->buildResponse(); } else { $this->prepareHeaders(); } } } } else { nb_displayErrorPage($this->nb_response->getHTTPResponseCode()); } } catch (ENabuRedirectionException $re) { $this->nb_engine->traceLog("Redirection", "Via exception"); $this->prepareCookies(); $this->buildRedirection($re->getHTTPResponseCode(), $re->getLocation()); } return true; }
php
final public function run() { $this->nb_http_server = $this->nb_engine->getHTTPServer(); if (!($this->nb_http_server instanceof INabuHTTPServerInterface)) { throw new ENabuCoreException(ENabuCoreException::ERROR_HTTP_SERVER_NOT_FOUND); } $this->prepareSecurityManager(); $this->preparePluginsManager(); $this->prepareModulesManager(); $this->nb_session = CNabuHTTPSession::getSession(); $this->nb_engine->traceLog("Cookies", $_COOKIE); // If the request is not allowed then treat it as a redirection or an error try { if ($this->prepareRequest()) { $method = $this->nb_request->getMethod(); $this->prepareCookies(); $this->prepareLocale(); if ($this->validateCORSOrigin()) { if ($method !== 'OPTIONS') { $this->prepareModules(); } if ($this->prepareResponse() && $this->processMethods() && $this->processCommands() ) { if ($method !== 'OPTIONS' && $method !== 'HEAD') { $this->buildResponse(); } else { $this->prepareHeaders(); } } } } else { nb_displayErrorPage($this->nb_response->getHTTPResponseCode()); } } catch (ENabuRedirectionException $re) { $this->nb_engine->traceLog("Redirection", "Via exception"); $this->prepareCookies(); $this->buildRedirection($re->getHTTPResponseCode(), $re->getLocation()); } return true; }
[ "final", "public", "function", "run", "(", ")", "{", "$", "this", "->", "nb_http_server", "=", "$", "this", "->", "nb_engine", "->", "getHTTPServer", "(", ")", ";", "if", "(", "!", "(", "$", "this", "->", "nb_http_server", "instanceof", "INabuHTTPServerInt...
Executes the Application runtime. @return bool Return true if success
[ "Executes", "the", "Application", "runtime", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/http/app/base/CNabuHTTPApplication.php#L130-L177
train
rips/php-connector-bundle
Services/Application/ProfileService.php
ProfileService.getAll
public function getAll($appId = null, array $queryParams = []) { $response = $this->api->applications()->profiles()->getAll($appId, $queryParams); return new ProfilesResponse($response); }
php
public function getAll($appId = null, array $queryParams = []) { $response = $this->api->applications()->profiles()->getAll($appId, $queryParams); return new ProfilesResponse($response); }
[ "public", "function", "getAll", "(", "$", "appId", "=", "null", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applications", "(", ")", "->", "profiles", "(", ")", "->", "getAll", "...
Get all profile profiles for an application @param int $appId @param array $queryParams @return ProfilesResponse
[ "Get", "all", "profile", "profiles", "for", "an", "application" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/ProfileService.php#L36-L41
train
rips/php-connector-bundle
Services/Application/ProfileService.php
ProfileService.getById
public function getById($appId, $profileId, array $queryParams = []) { $response = $this->api->applications()->profiles()->getById($appId, $profileId, $queryParams); return new ProfileResponse($response); }
php
public function getById($appId, $profileId, array $queryParams = []) { $response = $this->api->applications()->profiles()->getById($appId, $profileId, $queryParams); return new ProfileResponse($response); }
[ "public", "function", "getById", "(", "$", "appId", ",", "$", "profileId", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applications", "(", ")", "->", "profiles", "(", ")", "->", ...
Get profile for profile profile by id @param int $appId @param int $profileId @param array $queryParams @return ProfileResponse
[ "Get", "profile", "for", "profile", "profile", "by", "id" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/ProfileService.php#L51-L56
train
rips/php-connector-bundle
Services/Application/ProfileService.php
ProfileService.create
public function create($appId, ProfileBuilder $input, array $queryParams = []) { $response = $this->api->applications()->profiles()->create($appId, $input->toArray(), $queryParams); return new ProfileResponse($response); }
php
public function create($appId, ProfileBuilder $input, array $queryParams = []) { $response = $this->api->applications()->profiles()->create($appId, $input->toArray(), $queryParams); return new ProfileResponse($response); }
[ "public", "function", "create", "(", "$", "appId", ",", "ProfileBuilder", "$", "input", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applications", "(", ")", "->", "profiles", "(", ...
Create a profile profile for an application @param int $appId @param ProfileBuilder $input @param array $queryParams @return ProfileResponse
[ "Create", "a", "profile", "profile", "for", "an", "application" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/ProfileService.php#L66-L71
train
rips/php-connector-bundle
Services/Application/ProfileService.php
ProfileService.update
public function update($appId, $profileId, ProfileBuilder $input, array $queryParams = []) { $response = $this->api->applications()->profiles()->update($appId, $profileId, $input->toArray(), $queryParams); return new ProfileResponse($response); }
php
public function update($appId, $profileId, ProfileBuilder $input, array $queryParams = []) { $response = $this->api->applications()->profiles()->update($appId, $profileId, $input->toArray(), $queryParams); return new ProfileResponse($response); }
[ "public", "function", "update", "(", "$", "appId", ",", "$", "profileId", ",", "ProfileBuilder", "$", "input", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applications", "(", ")", ...
Update a profile profile by id @param int $appId @param int $profileId @param ProfileBuilder $input @param array $queryParams @return ProfileResponse
[ "Update", "a", "profile", "profile", "by", "id" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/ProfileService.php#L96-L101
train
nabu-3/core
nabu/data/messaging/traits/TNabuMessagingChild.php
TNabuMessagingChild.getMessaging
public function getMessaging(CNabuCustomer $nb_customer = null, string $field = NABU_MESSAGING_FIELD_ID, bool $force = false) { if ($nb_customer !== null && ($this->nb_messaging === null || $force)) { $this->nb_messaging = null; if ($this instanceof CNabuDataObject && $this->contains(NABU_MESSAGING_FIELD_ID)) { $this->nb_messaging = $nb_customer->getMessaging($this); } } return $this->nb_messaging; }
php
public function getMessaging(CNabuCustomer $nb_customer = null, string $field = NABU_MESSAGING_FIELD_ID, bool $force = false) { if ($nb_customer !== null && ($this->nb_messaging === null || $force)) { $this->nb_messaging = null; if ($this instanceof CNabuDataObject && $this->contains(NABU_MESSAGING_FIELD_ID)) { $this->nb_messaging = $nb_customer->getMessaging($this); } } return $this->nb_messaging; }
[ "public", "function", "getMessaging", "(", "CNabuCustomer", "$", "nb_customer", "=", "null", ",", "string", "$", "field", "=", "NABU_MESSAGING_FIELD_ID", ",", "bool", "$", "force", "=", "false", ")", "{", "if", "(", "$", "nb_customer", "!==", "null", "&&", ...
Gets the Messaging instance. @param null|CNabuCustomer $nb_customer If you want to get the Messaging in safe mode, you need to pass this parameter to grant the Customer that owns the Messaging where the Messaging is placed. In any other case, the Messaging could not be retrieved. @param string $field Field name where the site id will be stored. @param bool $force If true, then tries to reload Messaging instance from their storage. @return CNabuMessaging|null Returns the Messaging instance if setted or null if not.
[ "Gets", "the", "Messaging", "instance", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/messaging/traits/TNabuMessagingChild.php#L53-L63
train
rips/php-connector-bundle
Services/UserService.php
UserService.getAll
public function getAll(array $queryParams = []) { $response = $this->api->users()->getAll($queryParams); return new UsersResponse($response); }
php
public function getAll(array $queryParams = []) { $response = $this->api->users()->getAll($queryParams); return new UsersResponse($response); }
[ "public", "function", "getAll", "(", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "users", "(", ")", "->", "getAll", "(", "$", "queryParams", ")", ";", "return", "new", "UsersResponse", "...
Get a collection of user objects @param array $queryParams @return UsersResponse
[ "Get", "a", "collection", "of", "user", "objects" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/UserService.php#L34-L39
train
rips/php-connector-bundle
Services/UserService.php
UserService.getById
public function getById($userId, array $queryParams = []) { $response = $this->api->users()->getById($userId, $queryParams); return new UserResponse($response); }
php
public function getById($userId, array $queryParams = []) { $response = $this->api->users()->getById($userId, $queryParams); return new UserResponse($response); }
[ "public", "function", "getById", "(", "$", "userId", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "users", "(", ")", "->", "getById", "(", "$", "userId", ",", "$", "queryParams", "...
Get a user by id @param int $userId @param array $queryParams @return UserResponse
[ "Get", "a", "user", "by", "id" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/UserService.php#L48-L53
train
rips/php-connector-bundle
Services/UserService.php
UserService.deleteAll
public function deleteAll(array $queryParams = []) { $response = $this->api->users()->deleteAll($queryParams); return new BaseResponse($response); }
php
public function deleteAll(array $queryParams = []) { $response = $this->api->users()->deleteAll($queryParams); return new BaseResponse($response); }
[ "public", "function", "deleteAll", "(", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "users", "(", ")", "->", "deleteAll", "(", "$", "queryParams", ")", ";", "return", "new", "BaseResponse"...
Delete all users @param array $queryParams @return BaseResponse
[ "Delete", "all", "users" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/UserService.php#L90-L95
train
rips/php-connector-bundle
Services/UserService.php
UserService.deleteById
public function deleteById($userId, array $queryParams = []) { $response = $this->api->users()->deleteById($userId, $queryParams); return new BaseResponse($response); }
php
public function deleteById($userId, array $queryParams = []) { $response = $this->api->users()->deleteById($userId, $queryParams); return new BaseResponse($response); }
[ "public", "function", "deleteById", "(", "$", "userId", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "users", "(", ")", "->", "deleteById", "(", "$", "userId", ",", "$", "queryParams...
Delete user by id @param int $userId @param array $queryParams @return BaseResponse
[ "Delete", "user", "by", "id" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/UserService.php#L104-L109
train
rips/php-connector-bundle
Services/UserService.php
UserService.reset
public function reset($input, array $queryParams = []) { $response = $this->api->users()->reset($input->toArray(), $queryParams); return new UserResponse($response); }
php
public function reset($input, array $queryParams = []) { $response = $this->api->users()->reset($input->toArray(), $queryParams); return new UserResponse($response); }
[ "public", "function", "reset", "(", "$", "input", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "users", "(", ")", "->", "reset", "(", "$", "input", "->", "toArray", "(", ")", ","...
Request a reset email @param ResetBuilder $input @param array $queryParams @return UserResponse
[ "Request", "a", "reset", "email" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/UserService.php#L132-L137
train
rips/php-connector-bundle
Services/UserService.php
UserService.activate
public function activate($userId, $token, array $queryParams = []) { $response = $this->api->users()->activate($userId, $token, $queryParams); return new UserResponse($response); }
php
public function activate($userId, $token, array $queryParams = []) { $response = $this->api->users()->activate($userId, $token, $queryParams); return new UserResponse($response); }
[ "public", "function", "activate", "(", "$", "userId", ",", "$", "token", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "users", "(", ")", "->", "activate", "(", "$", "userId", ",", ...
Active a user account @param int $userId @param string $token @param array $queryParams @return UserResponse
[ "Active", "a", "user", "account" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/UserService.php#L147-L152
train
rips/php-connector-bundle
Services/Application/Scan/Issue/ReviewService.php
ReviewService.getAll
public function getAll($appId, $scanId, $issueId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->reviews() ->getAll($appId, $scanId, $issueId, $queryParams); return new ReviewsResponse($response); }
php
public function getAll($appId, $scanId, $issueId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->reviews() ->getAll($appId, $scanId, $issueId, $queryParams); return new ReviewsResponse($response); }
[ "public", "function", "getAll", "(", "$", "appId", ",", "$", "scanId", ",", "$", "issueId", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applications", "(", ")", "->", "scans", "(...
Get all reviews for an issue @param int $appId @param int $scanId @param int $issueId @param array $queryParams @return ReviewsResponse
[ "Get", "all", "reviews", "for", "an", "issue" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Scan/Issue/ReviewService.php#L36-L46
train
rips/php-connector-bundle
Services/Application/Scan/Issue/ReviewService.php
ReviewService.getById
public function getById($appId, $scanId, $issueId, $reviewId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->reviews() ->getById($appId, $scanId, $issueId, $reviewId, $queryParams); return new ReviewResponse($response); }
php
public function getById($appId, $scanId, $issueId, $reviewId, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->reviews() ->getById($appId, $scanId, $issueId, $reviewId, $queryParams); return new ReviewResponse($response); }
[ "public", "function", "getById", "(", "$", "appId", ",", "$", "scanId", ",", "$", "issueId", ",", "$", "reviewId", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applications", "(", ...
Get review for issue by id @param int $appId @param int $scanId @param int $issueId @param int $reviewId @param array $queryParams @return ReviewResponse
[ "Get", "review", "for", "issue", "by", "id" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Scan/Issue/ReviewService.php#L58-L68
train
rips/php-connector-bundle
Services/Application/Scan/Issue/ReviewService.php
ReviewService.create
public function create($appId, $scanId, $issueId, ReviewBuilder $input, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->reviews() ->create($appId, $scanId, $issueId, $input->toArray(), $queryParams); return new ReviewResponse($response); }
php
public function create($appId, $scanId, $issueId, ReviewBuilder $input, array $queryParams = []) { $response = $this->api ->applications() ->scans() ->issues() ->reviews() ->create($appId, $scanId, $issueId, $input->toArray(), $queryParams); return new ReviewResponse($response); }
[ "public", "function", "create", "(", "$", "appId", ",", "$", "scanId", ",", "$", "issueId", ",", "ReviewBuilder", "$", "input", ",", "array", "$", "queryParams", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "api", "->", "applicat...
Create a new review for an issue @param int $appId @param int $scanId @param int $issueId @param ReviewBuilder $input @param array $queryParams @return ReviewResponse
[ "Create", "a", "new", "review", "for", "an", "issue" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Scan/Issue/ReviewService.php#L80-L90
train
rips/php-connector-bundle
Hydrators/Application/Scan/PhpHydrator.php
PhpHydrator.hydrateCollection
public static function hydrateCollection(array $phps) { $hydrated = []; foreach ($phps as $php) { $hydrated[] = self::hydrate($php); } return $hydrated; }
php
public static function hydrateCollection(array $phps) { $hydrated = []; foreach ($phps as $php) { $hydrated[] = self::hydrate($php); } return $hydrated; }
[ "public", "static", "function", "hydrateCollection", "(", "array", "$", "phps", ")", "{", "$", "hydrated", "=", "[", "]", ";", "foreach", "(", "$", "phps", "as", "$", "php", ")", "{", "$", "hydrated", "[", "]", "=", "self", "::", "hydrate", "(", "$...
Hydrate a collection of php objects into a collection of PhpEntity objects @param stdClass[] $phps @return PhpEntity[]
[ "Hydrate", "a", "collection", "of", "php", "objects", "into", "a", "collection", "of", "PhpEntity", "objects" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/Application/Scan/PhpHydrator.php#L18-L27
train
rips/php-connector-bundle
Hydrators/Application/Scan/PhpHydrator.php
PhpHydrator.hydrate
public static function hydrate(stdClass $php) { $hydrated = new PhpEntity(); if (isset($php->id)) { $hydrated->setId($php->id); } if (isset($php->major_version)) { $hydrated->setMajorVersion($php->major_version); } if (isset($php->minor_version)) { $hydrated->setMinorVersion($php->minor_version); } if (isset($php->release_version)) { $hydrated->setReleaseVersion($php->release_version); } if (isset($php->magic_quotes_gpc)) { $hydrated->setMagicQuotesGpc($php->magic_quotes_gpc); } if (isset($php->register_globals)) { $hydrated->setRegisterGlobals($php->register_globals); } if (isset($php->allow_url_fopen)) { $hydrated->setAllowUrlFopen($php->allow_url_fopen); } if (isset($php->allow_url_include)) { $hydrated->setAllowUrlInclude($php->allow_url_include); } if (isset($php->filter_default)) { $hydrated->setFilterDefault($php->filter_default); } if (isset($php->setting)) { $hydrated->setSetting(SettingHydrator::hydrate($php->setting)); } return $hydrated; }
php
public static function hydrate(stdClass $php) { $hydrated = new PhpEntity(); if (isset($php->id)) { $hydrated->setId($php->id); } if (isset($php->major_version)) { $hydrated->setMajorVersion($php->major_version); } if (isset($php->minor_version)) { $hydrated->setMinorVersion($php->minor_version); } if (isset($php->release_version)) { $hydrated->setReleaseVersion($php->release_version); } if (isset($php->magic_quotes_gpc)) { $hydrated->setMagicQuotesGpc($php->magic_quotes_gpc); } if (isset($php->register_globals)) { $hydrated->setRegisterGlobals($php->register_globals); } if (isset($php->allow_url_fopen)) { $hydrated->setAllowUrlFopen($php->allow_url_fopen); } if (isset($php->allow_url_include)) { $hydrated->setAllowUrlInclude($php->allow_url_include); } if (isset($php->filter_default)) { $hydrated->setFilterDefault($php->filter_default); } if (isset($php->setting)) { $hydrated->setSetting(SettingHydrator::hydrate($php->setting)); } return $hydrated; }
[ "public", "static", "function", "hydrate", "(", "stdClass", "$", "php", ")", "{", "$", "hydrated", "=", "new", "PhpEntity", "(", ")", ";", "if", "(", "isset", "(", "$", "php", "->", "id", ")", ")", "{", "$", "hydrated", "->", "setId", "(", "$", "...
Hydrate a php object into a PhpEntity object @param \stdClass $php @return PhpEntity
[ "Hydrate", "a", "php", "object", "into", "a", "PhpEntity", "object" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/Application/Scan/PhpHydrator.php#L35-L80
train
orchestral/lumen
src/Application.php
Application.configure
public function configure($name) { if (isset($this->loadedConfigurations[$name])) { return; } $this->loadedConfigurations[$name] = true; $path = $this->getConfigurationPath($name); if (! \is_null($path)) { $this->make('config')->set(Arr::dot([ $name => require $path, ])); } }
php
public function configure($name) { if (isset($this->loadedConfigurations[$name])) { return; } $this->loadedConfigurations[$name] = true; $path = $this->getConfigurationPath($name); if (! \is_null($path)) { $this->make('config')->set(Arr::dot([ $name => require $path, ])); } }
[ "public", "function", "configure", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "loadedConfigurations", "[", "$", "name", "]", ")", ")", "{", "return", ";", "}", "$", "this", "->", "loadedConfigurations", "[", "$", "name", ...
Load a configuration file into the application. @param string $name @return void
[ "Load", "a", "configuration", "file", "into", "the", "application", "." ]
85a004e7cde0517b527241154f5ad031b7215851
https://github.com/orchestral/lumen/blob/85a004e7cde0517b527241154f5ad031b7215851/src/Application.php#L419-L434
train
orchestral/lumen
src/Application.php
Application.getProviders
public function getProviders($provider) { $name = \is_string($provider) ? $provider : \get_class($provider); return Arr::where($this->loadedProviders, function ($value) use ($name) { return $value instanceof $name; }); }
php
public function getProviders($provider) { $name = \is_string($provider) ? $provider : \get_class($provider); return Arr::where($this->loadedProviders, function ($value) use ($name) { return $value instanceof $name; }); }
[ "public", "function", "getProviders", "(", "$", "provider", ")", "{", "$", "name", "=", "\\", "is_string", "(", "$", "provider", ")", "?", "$", "provider", ":", "\\", "get_class", "(", "$", "provider", ")", ";", "return", "Arr", "::", "where", "(", "...
Get the registered service provider instances if any exist. @param \Illuminate\Support\ServiceProvider|string $provider @return array
[ "Get", "the", "registered", "service", "provider", "instances", "if", "any", "exist", "." ]
85a004e7cde0517b527241154f5ad031b7215851
https://github.com/orchestral/lumen/blob/85a004e7cde0517b527241154f5ad031b7215851/src/Application.php#L461-L468
train
orchestral/lumen
src/Application.php
Application.resourcePath
public function resourcePath($path = '') { if ($this->resourcePath) { return $this->resourcePath.($path ? '/'.$path : $path); } return $this->basePath('resources'.($path ? '/'.$path : $path)); }
php
public function resourcePath($path = '') { if ($this->resourcePath) { return $this->resourcePath.($path ? '/'.$path : $path); } return $this->basePath('resources'.($path ? '/'.$path : $path)); }
[ "public", "function", "resourcePath", "(", "$", "path", "=", "''", ")", "{", "if", "(", "$", "this", "->", "resourcePath", ")", "{", "return", "$", "this", "->", "resourcePath", ".", "(", "$", "path", "?", "'/'", ".", "$", "path", ":", "$", "path",...
Get the resource path for the application. @param string|null $path @return string
[ "Get", "the", "resource", "path", "for", "the", "application", "." ]
85a004e7cde0517b527241154f5ad031b7215851
https://github.com/orchestral/lumen/blob/85a004e7cde0517b527241154f5ad031b7215851/src/Application.php#L592-L599
train
rips/php-connector-bundle
Hydrators/Application/Scan/SourceHydrator.php
SourceHydrator.hydrateCollection
public static function hydrateCollection(array $sources) { $hydrated = []; foreach ($sources as $source) { $hydrated[] = self::hydrate($source); } return $hydrated; }
php
public static function hydrateCollection(array $sources) { $hydrated = []; foreach ($sources as $source) { $hydrated[] = self::hydrate($source); } return $hydrated; }
[ "public", "static", "function", "hydrateCollection", "(", "array", "$", "sources", ")", "{", "$", "hydrated", "=", "[", "]", ";", "foreach", "(", "$", "sources", "as", "$", "source", ")", "{", "$", "hydrated", "[", "]", "=", "self", "::", "hydrate", ...
Hydrate a collection of source objects into a collection of SourceEntity objects @param stdClass[] $sources @return SourceEntity[]
[ "Hydrate", "a", "collection", "of", "source", "objects", "into", "a", "collection", "of", "SourceEntity", "objects" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/Application/Scan/SourceHydrator.php#L18-L27
train
nabu-3/core
nabu/data/icontact/CNabuIContactProspectStatusType.php
CNabuIContactProspectStatusType.getTypesForIContact
public static function getTypesForIContact($nb_icontact) { if (is_numeric($nb_icontact_id = nb_getMixedValue($nb_icontact, 'nb_icontact_id'))) { $retval = CNabuIContactProspectStatusType::buildObjectListFromSQL( 'nb_icontact_prospect_status_type_id', 'SELECT ipst.* FROM nb_icontact_prospect_status_type ipst, nb_icontact i WHERE ipst.nb_icontact_id=i.nb_icontact_id AND i.nb_icontact_id=%cont_id$d', array( 'cont_id' => $nb_icontact_id ), ($nb_icontact instanceof CNabuIContact ? $nb_icontact : null) ); if ($nb_icontact instanceof CNabuIContact) { $retval->iterate(function($key, CNabuIContactProspectStatusType $nb_status) use($nb_icontact) { $nb_status->setIContact($nb_icontact); return true; }); } } else { if ($nb_icontact instanceof CNabuIContact) { $retval = new CNabuIContactProspectStatusTypeList($nb_icontact); } else { $retval = new CNabuIContactProspectStatusTypeList(); } } return $retval; }
php
public static function getTypesForIContact($nb_icontact) { if (is_numeric($nb_icontact_id = nb_getMixedValue($nb_icontact, 'nb_icontact_id'))) { $retval = CNabuIContactProspectStatusType::buildObjectListFromSQL( 'nb_icontact_prospect_status_type_id', 'SELECT ipst.* FROM nb_icontact_prospect_status_type ipst, nb_icontact i WHERE ipst.nb_icontact_id=i.nb_icontact_id AND i.nb_icontact_id=%cont_id$d', array( 'cont_id' => $nb_icontact_id ), ($nb_icontact instanceof CNabuIContact ? $nb_icontact : null) ); if ($nb_icontact instanceof CNabuIContact) { $retval->iterate(function($key, CNabuIContactProspectStatusType $nb_status) use($nb_icontact) { $nb_status->setIContact($nb_icontact); return true; }); } } else { if ($nb_icontact instanceof CNabuIContact) { $retval = new CNabuIContactProspectStatusTypeList($nb_icontact); } else { $retval = new CNabuIContactProspectStatusTypeList(); } } return $retval; }
[ "public", "static", "function", "getTypesForIContact", "(", "$", "nb_icontact", ")", "{", "if", "(", "is_numeric", "(", "$", "nb_icontact_id", "=", "nb_getMixedValue", "(", "$", "nb_icontact", ",", "'nb_icontact_id'", ")", ")", ")", "{", "$", "retval", "=", ...
Gets all Types associated with an iContact. @param mixed $nb_icontact A CNabuIContact instance, or a CNabuDataObject instance containing a field named nb_icontact_id or a valid iContact Id. @return CNabuIContactProspectStatusTypeList Returns a list with existing types.
[ "Gets", "all", "Types", "associated", "with", "an", "iContact", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/icontact/CNabuIContactProspectStatusType.php#L42-L72
train
nabu-3/core
nabu/data/site/CNabuSiteRole.php
CNabuSiteRole.getSiteRolesForSite
public static function getSiteRolesForSite($nb_site) : CNabuSiteRoleList { if (is_numeric($nb_site_id = nb_getMixedValue($nb_site, NABU_SITE_FIELD_ID))) { $retval = CNabuSiteRole::buildObjectListFromSQL( 'nb_role_id', 'select * ' . 'from nb_site_role ' . 'where nb_site_id=%site_id$d', array( 'site_id' => $nb_site_id ) ); if ($nb_site instanceof CNabuSite) { $retval->iterate(function($key, CNabuSiteRole $nb_site_role) use ($nb_site) { $nb_site_role->setSite($nb_site); return true; }); } } else { $retval = new CNabuSiteRoleList(); } return $retval; }
php
public static function getSiteRolesForSite($nb_site) : CNabuSiteRoleList { if (is_numeric($nb_site_id = nb_getMixedValue($nb_site, NABU_SITE_FIELD_ID))) { $retval = CNabuSiteRole::buildObjectListFromSQL( 'nb_role_id', 'select * ' . 'from nb_site_role ' . 'where nb_site_id=%site_id$d', array( 'site_id' => $nb_site_id ) ); if ($nb_site instanceof CNabuSite) { $retval->iterate(function($key, CNabuSiteRole $nb_site_role) use ($nb_site) { $nb_site_role->setSite($nb_site); return true; }); } } else { $retval = new CNabuSiteRoleList(); } return $retval; }
[ "public", "static", "function", "getSiteRolesForSite", "(", "$", "nb_site", ")", ":", "CNabuSiteRoleList", "{", "if", "(", "is_numeric", "(", "$", "nb_site_id", "=", "nb_getMixedValue", "(", "$", "nb_site", ",", "NABU_SITE_FIELD_ID", ")", ")", ")", "{", "$", ...
Get the list of all Roles assigned to a Site. @param mixed $nb_site A CNabuDataObject containing a field named nb_site_id or a valid Site Id. @return CNabuSiteRoleList Returns a list with all Site Role instances found.
[ "Get", "the", "list", "of", "all", "Roles", "assigned", "to", "a", "Site", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/CNabuSiteRole.php#L71-L94
train
nabu-3/core
nabu/data/medioteca/base/CNabuMediotecaItemBase.php
CNabuMediotecaItemBase.getAllMediotecaItems
public static function getAllMediotecaItems(CNabuMedioteca $nb_medioteca) { $nb_medioteca_id = nb_getMixedValue($nb_medioteca, 'nb_medioteca_id'); if (is_numeric($nb_medioteca_id)) { $retval = forward_static_call( array(get_called_class(), 'buildObjectListFromSQL'), 'nb_medioteca_item_id', 'select * ' . 'from nb_medioteca_item ' . 'where nb_medioteca_id=%medioteca_id$d', array( 'medioteca_id' => $nb_medioteca_id ), $nb_medioteca ); } else { $retval = new CNabuMediotecaItemList(); } return $retval; }
php
public static function getAllMediotecaItems(CNabuMedioteca $nb_medioteca) { $nb_medioteca_id = nb_getMixedValue($nb_medioteca, 'nb_medioteca_id'); if (is_numeric($nb_medioteca_id)) { $retval = forward_static_call( array(get_called_class(), 'buildObjectListFromSQL'), 'nb_medioteca_item_id', 'select * ' . 'from nb_medioteca_item ' . 'where nb_medioteca_id=%medioteca_id$d', array( 'medioteca_id' => $nb_medioteca_id ), $nb_medioteca ); } else { $retval = new CNabuMediotecaItemList(); } return $retval; }
[ "public", "static", "function", "getAllMediotecaItems", "(", "CNabuMedioteca", "$", "nb_medioteca", ")", "{", "$", "nb_medioteca_id", "=", "nb_getMixedValue", "(", "$", "nb_medioteca", ",", "'nb_medioteca_id'", ")", ";", "if", "(", "is_numeric", "(", "$", "nb_medi...
Get all items in the storage as an associative array where the field 'nb_medioteca_item_id' is the index, and each value is an instance of class CNabuMediotecaItemBase. @param CNabuMedioteca $nb_medioteca The CNabuMedioteca instance of the Medioteca that owns the Medioteca Item List. @return mixed Returns and array with all items.
[ "Get", "all", "items", "in", "the", "storage", "as", "an", "associative", "array", "where", "the", "field", "nb_medioteca_item_id", "is", "the", "index", "and", "each", "value", "is", "an", "instance", "of", "class", "CNabuMediotecaItemBase", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/medioteca/base/CNabuMediotecaItemBase.php#L179-L199
train
nabu-3/core
nabu/data/site/CNabuSiteTargetCTA.php
CNabuSiteTargetCTA.getSiteTargetCTAs
static public function getSiteTargetCTAs($nb_site_target) { $nb_site_target_id = nb_getMixedValue($nb_site_target, 'nb_site_target_id'); if (is_numeric($nb_site_target_id)) { $retval = CNabuSiteTargetCTA::buildObjectListFromSQL( 'nb_site_target_cta_id', 'select * ' . 'from nb_site_target_cta ' . 'where nb_site_target_id=%target_id$d ' . 'order by nb_site_target_cta_order', array( 'target_id' => $nb_site_target_id ) ); if ($nb_site_target instanceof CNabuSiteTarget) { $retval->iterate(function($key, $nb_cta) use($nb_site_target) { $nb_cta->setSiteTarget($nb_site_target); return true; }); } } else { $retval = new CNabuSiteTargetCTAList(); } return $retval; }
php
static public function getSiteTargetCTAs($nb_site_target) { $nb_site_target_id = nb_getMixedValue($nb_site_target, 'nb_site_target_id'); if (is_numeric($nb_site_target_id)) { $retval = CNabuSiteTargetCTA::buildObjectListFromSQL( 'nb_site_target_cta_id', 'select * ' . 'from nb_site_target_cta ' . 'where nb_site_target_id=%target_id$d ' . 'order by nb_site_target_cta_order', array( 'target_id' => $nb_site_target_id ) ); if ($nb_site_target instanceof CNabuSiteTarget) { $retval->iterate(function($key, $nb_cta) use($nb_site_target) { $nb_cta->setSiteTarget($nb_site_target); return true; }); } } else { $retval = new CNabuSiteTargetCTAList(); } return $retval; }
[ "static", "public", "function", "getSiteTargetCTAs", "(", "$", "nb_site_target", ")", "{", "$", "nb_site_target_id", "=", "nb_getMixedValue", "(", "$", "nb_site_target", ",", "'nb_site_target_id'", ")", ";", "if", "(", "is_numeric", "(", "$", "nb_site_target_id", ...
Gets entire collection of CTA instances of a Site Target. @param mixed $nb_site_target A Site Target instance, an object containing a Site Target Id, or an Id. @return CNabuSiteTargetCTAList Returns a CNabuSiteTargetCTAList instance containing located CTAs for $nb_site_target.
[ "Gets", "entire", "collection", "of", "CTA", "instances", "of", "a", "Site", "Target", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/CNabuSiteTargetCTA.php#L88-L113
train
nabu-3/core
nabu/data/site/CNabuSiteTargetCTA.php
CNabuSiteTargetCTA.getCTATarget
public function getCTATarget() { if (!($this->nb_site_target_destination instanceof CNabuSiteTarget) && $this->getTargetUseURI() === CNabuSiteTargetLink::USE_URI_TRANSLATED && is_numeric($this->getTargetId()) ) { $this->nb_site_target_destination = $this->nb_site_target->getSite()->getTarget($this->getTargetId()); } return $this->nb_site_target_destination; }
php
public function getCTATarget() { if (!($this->nb_site_target_destination instanceof CNabuSiteTarget) && $this->getTargetUseURI() === CNabuSiteTargetLink::USE_URI_TRANSLATED && is_numeric($this->getTargetId()) ) { $this->nb_site_target_destination = $this->nb_site_target->getSite()->getTarget($this->getTargetId()); } return $this->nb_site_target_destination; }
[ "public", "function", "getCTATarget", "(", ")", "{", "if", "(", "!", "(", "$", "this", "->", "nb_site_target_destination", "instanceof", "CNabuSiteTarget", ")", "&&", "$", "this", "->", "getTargetUseURI", "(", ")", "===", "CNabuSiteTargetLink", "::", "USE_URI_TR...
Gets the Site Target destination instance. @return CNabuSiteTarget Returns the instance if setted or null if not.
[ "Gets", "the", "Site", "Target", "destination", "instance", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/CNabuSiteTargetCTA.php#L119-L129
train
nabu-3/core
nabu/data/site/CNabuSiteTargetCTA.php
CNabuSiteTargetCTA.setCTATarget
public function setCTATarget(CNabuSiteTarget $nb_site_target = null) { if ($nb_site_target instanceof CNabuSiteTarget) { $this->setTargetUseURI(CNabuSiteTargetLink::USE_URI_TRANSLATED); $this->transferValue($nb_site_target, 'nb_site_target_id', 'nb_site_target_cta_target_id'); } else { $this->setTargetUseURI(CNabuSiteTargetLink::USE_URI_NONE); $this->setTargetId(null); } $this->nb_site_target_destination = $nb_site_target; return $this; }
php
public function setCTATarget(CNabuSiteTarget $nb_site_target = null) { if ($nb_site_target instanceof CNabuSiteTarget) { $this->setTargetUseURI(CNabuSiteTargetLink::USE_URI_TRANSLATED); $this->transferValue($nb_site_target, 'nb_site_target_id', 'nb_site_target_cta_target_id'); } else { $this->setTargetUseURI(CNabuSiteTargetLink::USE_URI_NONE); $this->setTargetId(null); } $this->nb_site_target_destination = $nb_site_target; return $this; }
[ "public", "function", "setCTATarget", "(", "CNabuSiteTarget", "$", "nb_site_target", "=", "null", ")", "{", "if", "(", "$", "nb_site_target", "instanceof", "CNabuSiteTarget", ")", "{", "$", "this", "->", "setTargetUseURI", "(", "CNabuSiteTargetLink", "::", "USE_UR...
Sets the CTA Target object. Updates nb_site_target_cta_target_id and nb_site_target_cta_use_uri to proper values. @param CNabuSiteTarget|null $nb_site_target If $nb_site_target contains an instance then sets this instance as the CTA Target else sets the CTA Target as none. @return CNabuSiteTargetCTA Returns the self instance to grant cascade setters mechanism.
[ "Sets", "the", "CTA", "Target", "object", ".", "Updates", "nb_site_target_cta_target_id", "and", "nb_site_target_cta_use_uri", "to", "proper", "values", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/CNabuSiteTargetCTA.php#L137-L149
train
nabu-3/core
nabu/data/site/CNabuSiteTargetCTA.php
CNabuSiteTargetCTA.addRole
public function addRole(CNabuSiteTargetCTARole $nb_role) { if ($nb_role->isValueNumeric(NABU_ROLE_FIELD_ID) || $nb_role->isValueGUID(NABU_ROLE_FIELD_ID)) { $nb_role->setSiteTargetCTA($this); $this->nb_site_target_cta_role_list->addItem($nb_role); } return $nb_role; }
php
public function addRole(CNabuSiteTargetCTARole $nb_role) { if ($nb_role->isValueNumeric(NABU_ROLE_FIELD_ID) || $nb_role->isValueGUID(NABU_ROLE_FIELD_ID)) { $nb_role->setSiteTargetCTA($this); $this->nb_site_target_cta_role_list->addItem($nb_role); } return $nb_role; }
[ "public", "function", "addRole", "(", "CNabuSiteTargetCTARole", "$", "nb_role", ")", "{", "if", "(", "$", "nb_role", "->", "isValueNumeric", "(", "NABU_ROLE_FIELD_ID", ")", "||", "$", "nb_role", "->", "isValueGUID", "(", "NABU_ROLE_FIELD_ID", ")", ")", "{", "$...
Add a Role to this Site Target CTA instance. @param CNabuSiteTargetCTARole $nb_role Role to be added. @return CNabuSiteTargetCTARole Returns the inserted Role instance.
[ "Add", "a", "Role", "to", "this", "Site", "Target", "CTA", "instance", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/CNabuSiteTargetCTA.php#L180-L188
train
nabu-3/core
nabu/data/site/CNabuSiteTargetCTA.php
CNabuSiteTargetCTA.getCTAOfSite
public static function getCTAOfSite($nb_site, $nb_site_target_cta) { $retval = null; if (is_numeric($nb_site_id = nb_getMixedValue($nb_site, NABU_SITE_FIELD_ID)) && is_numeric($nb_site_target_cta_id = nb_getMixedValue($nb_site_target_cta, NABU_SITE_TARGET_CTA_FIELD_ID)) ) { $retval = CNabuSiteTargetCTA::buildObjectFromSQL( 'select stc.* ' . 'from nb_site s, nb_site_target st, nb_site_target_cta stc ' . 'where s.nb_site_id=st.nb_site_id ' . 'and st.nb_site_target_id=stc.nb_site_target_id ' . 'and s.nb_site_id=%site_id$d ' . 'and stc.nb_site_target_cta_id=%cta_id$d', array( 'site_id' => $nb_site_id, 'cta_id' => $nb_site_target_cta_id ) ); } return $retval; }
php
public static function getCTAOfSite($nb_site, $nb_site_target_cta) { $retval = null; if (is_numeric($nb_site_id = nb_getMixedValue($nb_site, NABU_SITE_FIELD_ID)) && is_numeric($nb_site_target_cta_id = nb_getMixedValue($nb_site_target_cta, NABU_SITE_TARGET_CTA_FIELD_ID)) ) { $retval = CNabuSiteTargetCTA::buildObjectFromSQL( 'select stc.* ' . 'from nb_site s, nb_site_target st, nb_site_target_cta stc ' . 'where s.nb_site_id=st.nb_site_id ' . 'and st.nb_site_target_id=stc.nb_site_target_id ' . 'and s.nb_site_id=%site_id$d ' . 'and stc.nb_site_target_cta_id=%cta_id$d', array( 'site_id' => $nb_site_id, 'cta_id' => $nb_site_target_cta_id ) ); } return $retval; }
[ "public", "static", "function", "getCTAOfSite", "(", "$", "nb_site", ",", "$", "nb_site_target_cta", ")", "{", "$", "retval", "=", "null", ";", "if", "(", "is_numeric", "(", "$", "nb_site_id", "=", "nb_getMixedValue", "(", "$", "nb_site", ",", "NABU_SITE_FIE...
Gets a CTA instance related with a Site. @param mixed $nb_site A Site instance, or a CNabuDataObject instance containing a field named nb_site_id or an Id. @param mixed $nb_site_target_cta A Site Target CTA instance, or a CNabuDataObject instance containing a field named nb_site_target_cta_id or an Id. @return CNabuSiteTargetCTA | null Returns an instance if found or null if not.
[ "Gets", "a", "CTA", "instance", "related", "with", "a", "Site", "." ]
8a93a91ba146536d66f57821e6f23f9175d8bd11
https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/CNabuSiteTargetCTA.php#L255-L277
train
rips/php-connector-bundle
Hydrators/Application/Profile/SettingHydrator.php
SettingHydrator.hydrate
public static function hydrate(stdClass $setting) { $hydrated = new SettingEntity(); if (isset($setting->id)) { $hydrated->setId($setting->id); } if (isset($setting->issue_types)) { $hydrated->setIssueTypes($setting->issue_types); } if (isset($setting->code_stored)) { $hydrated->setCodeStored($setting->code_stored); } if (isset($setting->upload_removed)) { $hydrated->setUploadRemoved($setting->upload_removed); } if (isset($setting->full_code_compared)) { $hydrated->setFullCodeCompared($setting->full_code_compared); } if (isset($setting->history_inherited)) { $hydrated->setHistoryInherited($setting->history_inherited); } if (isset($setting->analysis_depth)) { $hydrated->setAnalysisDepth($setting->analysis_depth); } if (isset($setting->max_issues_per_type)) { $hydrated->setMaxIssuesPerType($setting->max_issues_per_type); } if (isset($setting->php)) { $hydrated->setPhp(PhpHydrator::hydrate($setting->php)); } if (isset($setting->java)) { $hydrated->setJava(JavaHydrator::hydrate($setting->java)); } return $hydrated; }
php
public static function hydrate(stdClass $setting) { $hydrated = new SettingEntity(); if (isset($setting->id)) { $hydrated->setId($setting->id); } if (isset($setting->issue_types)) { $hydrated->setIssueTypes($setting->issue_types); } if (isset($setting->code_stored)) { $hydrated->setCodeStored($setting->code_stored); } if (isset($setting->upload_removed)) { $hydrated->setUploadRemoved($setting->upload_removed); } if (isset($setting->full_code_compared)) { $hydrated->setFullCodeCompared($setting->full_code_compared); } if (isset($setting->history_inherited)) { $hydrated->setHistoryInherited($setting->history_inherited); } if (isset($setting->analysis_depth)) { $hydrated->setAnalysisDepth($setting->analysis_depth); } if (isset($setting->max_issues_per_type)) { $hydrated->setMaxIssuesPerType($setting->max_issues_per_type); } if (isset($setting->php)) { $hydrated->setPhp(PhpHydrator::hydrate($setting->php)); } if (isset($setting->java)) { $hydrated->setJava(JavaHydrator::hydrate($setting->java)); } return $hydrated; }
[ "public", "static", "function", "hydrate", "(", "stdClass", "$", "setting", ")", "{", "$", "hydrated", "=", "new", "SettingEntity", "(", ")", ";", "if", "(", "isset", "(", "$", "setting", "->", "id", ")", ")", "{", "$", "hydrated", "->", "setId", "("...
Hydrate a setting object into a SettingEntity object @param stdClass $setting @return SettingEntity
[ "Hydrate", "a", "setting", "object", "into", "a", "SettingEntity", "object" ]
34ac080a7988d4d91f8129419998e51291261f55
https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/Application/Profile/SettingHydrator.php#L18-L63
train