idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
17,400 | 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 ; } | Sets the Role Root attribute value . |
17,401 | public static function hydrateCollection ( array $ patches ) { $ hydrated = [ ] ; foreach ( $ patches as $ patch ) { $ hydrated [ ] = self :: hydrate ( $ patch ) ; } return $ hydrated ; } | Hydrate a collection of patch objects into a collection of PatchEntity objects |
17,402 | 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 ; } | Gets entire collection of Section instances of a Site Target . |
17,403 | 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 ) ; } | Set the running application . |
17,404 | 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 ; } | Gets current Messaging Pool Manager instance . If not defined then creates one for the current Customer . |
17,405 | 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 ; } | Gets current Render Pool Manager instance . If not defined then creates one for the current Customer . |
17,406 | 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 ; } | Gets current HTTP Server Pool Manager instance . If not defined then creates one for the current Customer . |
17,407 | private function class2Filename ( $ class_name , $ php_suffix = '.php' ) { return DIRECTORY_SEPARATOR . str_replace ( '\\' , DIRECTORY_SEPARATOR , $ class_name ) . ( $ php_suffix === false ? '' : $ php_suffix ) ; } | 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 . |
17,408 | 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 ; } } } | Initializes the instance . Register handlers . Register main database . |
17,409 | 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 ) ) ; } | Ends the instance . Takes the elapsed time between init and finish calls and closes connections to external sources . |
17,410 | 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 ( ) ) { $ this -> errorLog ( "Database Test error: " . $ this -> main_database -> getLastErrorMessage ( ) ) ; } } else { throw new ENabuDBException ( ENabuDBException :: ERROR_NOT_CONNECTED ) ; } } | 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 . |
17,411 | public function getMainDB ( ) { if ( $ this -> main_database === null && ( $ this -> isOperationModeCLI ( ) || $ this -> isOperationModeStandalone ( ) ) ) { $ this -> registerMainDatabase ( ) ; } return $ this -> main_database ; } | Get main database connection . |
17,412 | 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 ) ; } } | Database connector to main Nabu database schema This method is allowed only when Engine is in install mode |
17,413 | public function traceLog ( $ key , $ message ) { if ( $ this -> nb_error_handler ) { $ this -> nb_error_handler -> traceLog ( $ key , $ message ) ; } return $ this ; } | If a Error Handler is defined then propagates the trace log to the handler elsewhere do nothing . |
17,414 | public function triggerError ( $ error_message = null , $ error_type = null ) { if ( $ error_message !== null && $ error_type !== null ) { trigger_error ( $ error_message , $ error_type ) ; } } | Trigger and error using the standard PHP Error chain . |
17,415 | 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 ( ) ; } return $ retval ; } | Executes an Application instance in the Nabu Engine environment . |
17,416 | 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 ) ; } } | Calls the Hook function after locate valid HTTP Server . |
17,417 | 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 ; } | Try to detect the running HTTP Server attached to this process and returns their nabu - 3 manager . |
17,418 | 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 ) ; } | 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 . |
17,419 | 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 ) ; $ 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 ) ; } | 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 . |
17,420 | 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 ; } | Gets the list of PHP root folders in the framework for include purposes . |
17,421 | 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 ) ; } } | Gets a Provider Manager instance . This method is intended normally to be used internally and inside provider modules . |
17,422 | public function getProviderInterfaceDescriptor ( string $ vendor , string $ module , int $ interface_type , string $ interface ) { return $ this -> nb_provider_factory -> getInterfaceDescriptor ( $ vendor , $ module , $ interface_type , $ interface ) ; } | Gets a Provider Interface descriptor . |
17,423 | public function getProviderInterfaceDescriptorByKey ( int $ interface_type , string $ interface_key ) { return $ this -> nb_provider_factory -> getInterfaceDescriptors ( $ interface_type ) -> getItem ( $ interface_key ) ; } | Gets a Provider Interface Descriptor by his interface type and key . |
17,424 | 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 ; } | Extract Nodes list for translations in an item in this node . |
17,425 | 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 ; } | Gets the list of Template Connections for a Service . |
17,426 | public static function hydrateCollection ( array $ scans ) { $ hydrated = [ ] ; foreach ( $ scans as $ scan ) { $ hydrated [ ] = self :: hydrate ( $ scan ) ; } return $ hydrated ; } | Hydrate a collection of scan objects into a collection of ScanEntity objects |
17,427 | 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 ) ; } | Applies Role policies to this list . All items that does not accomplishes the policies are removed . |
17,428 | 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 ; } | Sets the Icontact Id attribute value . |
17,429 | public static function hydrateCollection ( array $ licenses ) { $ hydrated = [ ] ; foreach ( $ licenses as $ license ) { $ hydrated [ ] = self :: hydrate ( $ license ) ; } return $ hydrated ; } | Hydrate a collection of license objects into a collection of LicenseEntity objects |
17,430 | 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 ; } | Hydrate a license object into a LicenseEntity object |
17,431 | 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 ; } | Sets the User Id attribute value . |
17,432 | 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 ; } | Sets the Catalog Taxonomy Id attribute value . |
17,433 | public function getAll ( array $ queryParams = [ ] ) { $ response = $ this -> api -> orgs ( ) -> getAll ( $ queryParams ) ; return new OrgsResponse ( $ response ) ; } | Get all organizations |
17,434 | public function getById ( $ orgId , array $ queryParams = [ ] ) { $ response = $ this -> api -> orgs ( ) -> getById ( $ orgId , $ queryParams ) ; return new OrgResponse ( $ response ) ; } | Get an organization by id |
17,435 | public function update ( $ orgId , OrgBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> orgs ( ) -> update ( $ orgId , $ input -> toArray ( ) , $ queryParams ) ; return new OrgResponse ( $ response ) ; } | Update existing organization by id |
17,436 | public function deleteAll ( array $ queryParams = [ ] ) { $ response = $ this -> api -> orgs ( ) -> deleteAll ( $ queryParams ) ; return new BaseResponse ( $ response ) ; } | Delete all organizations |
17,437 | public function deleteById ( $ orgId , array $ queryParams = [ ] ) { $ response = $ this -> api -> orgs ( ) -> deleteById ( $ orgId , $ queryParams ) ; return new BaseResponse ( $ response ) ; } | Delete an organization by id |
17,438 | 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 ; } | Sets the Site Lang Enabled attribute value . |
17,439 | 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 ; } | Sets the Site Lang Translation Status attribute value . |
17,440 | 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 ; } | Sets the Site Lang Editable attribute value . |
17,441 | 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 ; } | normalizes the cache id for zend cache |
17,442 | public function flush ( ) { if ( ! ( $ this -> cache instanceof FlushableInterface ) ) { return false ; } try { return $ this -> cache -> flush ( ) ; } catch ( ZendException \ ExceptionInterface $ ex ) { return false ; } } | Flush the whole storage |
17,443 | 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 ; } | Sets the Medioteca Id attribute value . |
17,444 | 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 ] ; } } | Get one of the data . |
17,445 | public function findByKey ( $ rule ) { $ r = [ ] ; foreach ( $ this -> data as $ k => $ v ) { if ( $ rule ( $ k ) ) { $ r [ ] = $ this -> { $ k } ; } } return $ r ; } | Find something by the key |
17,446 | 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 ; } | Sort The Data |
17,447 | public static function hydrateCollection ( array $ clients ) { $ hydrated = [ ] ; foreach ( $ clients as $ client ) { $ hydrated [ ] = self :: hydrate ( $ client ) ; } return $ hydrated ; } | Hydrate a collection of client object into a collection of ClientEntity objects |
17,448 | 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 ; } | Hydrate a client object into a ClientEntity object |
17,449 | 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 ; } | 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 . |
17,450 | 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 ; } | Gets the Catalog instance that owns this object . |
17,451 | 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 ; } | Sets the Catalog instance that onws this object . |
17,452 | 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 ; } | If singleton instance does not exists then instantiate it . |
17,453 | 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 ) ) ; } } } } | Scan providers folder to detect installed provider modules . |
17,454 | 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 ) ; } } | Scan vendor folders to find modules . |
17,455 | 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 ) ; } } | Scan module folders to prepare init mechanism . |
17,456 | 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 ) ; } } | Scan module root files to locate the init file . |
17,457 | 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 ; } | Adds a manager to the managers list . |
17,458 | 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 ) ; } } | Gets a Manager instance . This method is intended normally to be used internally and inside provider modules . |
17,459 | 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 ; } | Adds an interface to the interfaces list . |
17,460 | 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 ] ; } | Gets the interfaces descriptor list of a type of interfaces . |
17,461 | 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 ; } | Gets an Interface descriptor . |
17,462 | public function registerApplication ( INabuApplication $ nb_application ) { $ this -> nb_manager_list -> iterate ( function ( $ key , $ manager ) use ( $ nb_application ) { $ manager -> registerApplication ( $ nb_application ) ; return true ; } ) ; } | Register the application to connect all available managers with it . |
17,463 | public function getComparison ( $ appId , $ scanId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> comparisons ( ) -> getComparison ( $ appId , $ scanId , $ queryParams ) ; return new ComparisonResponse ( $ response ) ; } | Get comparison stats for a scan |
17,464 | public static function hydrateCollection ( array $ sinks ) { $ hydrated = [ ] ; foreach ( $ sinks as $ sink ) { $ hydrated [ ] = self :: hydrate ( $ sink ) ; } return $ hydrated ; } | Hydrate a collection of sink objects into a collection of SinkEntity objects |
17,465 | public function getAll ( $ appId , $ profileId , array $ queryParams ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> validators ( ) -> getAll ( $ appId , $ profileId , $ queryParams ) ; return new ValidatorsResponse ( $ response ) ; } | Get all validators for a profile profile |
17,466 | public function getById ( $ appId , $ profileId , $ validatorId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> validators ( ) -> getById ( $ appId , $ profileId , $ validatorId , $ queryParams ) ; return new ValidatorResponse ( $ response ) ; } | Get validator for profile profile by id |
17,467 | 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 ) ; } | Create validator for profile profile |
17,468 | 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 ; } | Sets the Site Target Id attribute value . |
17,469 | protected function init ( ) { $ this -> prepareHTTPManagers ( ) ; $ this -> prepareHTTPRendersManager ( ) ; $ this -> prepareMediotecasManager ( ) ; $ this -> nb_engine -> registerApplication ( $ this ) ; } | Initializes the instance and register them in the Engine . |
17,470 | 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 ) ; 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 ; } | Executes the Application runtime . |
17,471 | public function getAll ( $ appId = null , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> getAll ( $ appId , $ queryParams ) ; return new ProfilesResponse ( $ response ) ; } | Get all profile profiles for an application |
17,472 | public function getById ( $ appId , $ profileId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> getById ( $ appId , $ profileId , $ queryParams ) ; return new ProfileResponse ( $ response ) ; } | Get profile for profile profile by id |
17,473 | public function create ( $ appId , ProfileBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> create ( $ appId , $ input -> toArray ( ) , $ queryParams ) ; return new ProfileResponse ( $ response ) ; } | Create a profile profile for an application |
17,474 | public function update ( $ appId , $ profileId , ProfileBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> update ( $ appId , $ profileId , $ input -> toArray ( ) , $ queryParams ) ; return new ProfileResponse ( $ response ) ; } | Update a profile profile by id |
17,475 | 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 ; } | Gets the Messaging instance . |
17,476 | public function getAll ( array $ queryParams = [ ] ) { $ response = $ this -> api -> users ( ) -> getAll ( $ queryParams ) ; return new UsersResponse ( $ response ) ; } | Get a collection of user objects |
17,477 | public function getById ( $ userId , array $ queryParams = [ ] ) { $ response = $ this -> api -> users ( ) -> getById ( $ userId , $ queryParams ) ; return new UserResponse ( $ response ) ; } | Get a user by id |
17,478 | public function deleteAll ( array $ queryParams = [ ] ) { $ response = $ this -> api -> users ( ) -> deleteAll ( $ queryParams ) ; return new BaseResponse ( $ response ) ; } | Delete all users |
17,479 | public function deleteById ( $ userId , array $ queryParams = [ ] ) { $ response = $ this -> api -> users ( ) -> deleteById ( $ userId , $ queryParams ) ; return new BaseResponse ( $ response ) ; } | Delete user by id |
17,480 | public function reset ( $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> users ( ) -> reset ( $ input -> toArray ( ) , $ queryParams ) ; return new UserResponse ( $ response ) ; } | Request a reset email |
17,481 | public function activate ( $ userId , $ token , array $ queryParams = [ ] ) { $ response = $ this -> api -> users ( ) -> activate ( $ userId , $ token , $ queryParams ) ; return new UserResponse ( $ response ) ; } | Active a user account |
17,482 | public function getAll ( $ appId , $ scanId , $ issueId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> issues ( ) -> reviews ( ) -> getAll ( $ appId , $ scanId , $ issueId , $ queryParams ) ; return new ReviewsResponse ( $ response ) ; } | Get all reviews for an issue |
17,483 | 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 ) ; } | Get review for issue by id |
17,484 | 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 ) ; } | Create a new review for an issue |
17,485 | public static function hydrateCollection ( array $ phps ) { $ hydrated = [ ] ; foreach ( $ phps as $ php ) { $ hydrated [ ] = self :: hydrate ( $ php ) ; } return $ hydrated ; } | Hydrate a collection of php objects into a collection of PhpEntity objects |
17,486 | 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 ; } | Hydrate a php object into a PhpEntity object |
17,487 | 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 , ] ) ) ; } } | Load a configuration file into the application . |
17,488 | 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 ; } ) ; } | Get the registered service provider instances if any exist . |
17,489 | public function resourcePath ( $ path = '' ) { if ( $ this -> resourcePath ) { return $ this -> resourcePath . ( $ path ? '/' . $ path : $ path ) ; } return $ this -> basePath ( 'resources' . ( $ path ? '/' . $ path : $ path ) ) ; } | Get the resource path for the application . |
17,490 | public static function hydrateCollection ( array $ sources ) { $ hydrated = [ ] ; foreach ( $ sources as $ source ) { $ hydrated [ ] = self :: hydrate ( $ source ) ; } return $ hydrated ; } | Hydrate a collection of source objects into a collection of SourceEntity objects |
17,491 | 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 ; } | Gets all Types associated with an iContact . |
17,492 | 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 ; } | Get the list of all Roles assigned to a Site . |
17,493 | 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 ; } | 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 . |
17,494 | 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 ; } | Gets entire collection of CTA instances of a Site Target . |
17,495 | 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 ; } | Gets the Site Target destination instance . |
17,496 | 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 ; } | Sets the CTA Target object . Updates nb_site_target_cta_target_id and nb_site_target_cta_use_uri to proper values . |
17,497 | 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 ; } | Add a Role to this Site Target CTA instance . |
17,498 | 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 ; } | Gets a CTA instance related with a Site . |
17,499 | 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 ; } | Hydrate a setting object into a SettingEntity object |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.