idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
17,600
public function getTargets ( $ force = false ) : CNabuSiteTargetList { if ( ! $ this -> isBuiltIn ( ) && ( $ this -> nb_site_target_list -> isEmpty ( ) || $ force ) ) { $ this -> nb_site_target_list -> clear ( ) ; $ this -> nb_site_target_list -> merge ( CNabuSiteTarget :: getAllSiteTargets ( $ this ) ) ; $ this -> nb_...
Gets the Target list associated with this instance .
17,601
public function addStaticContent ( CNabuSiteStaticContent $ nb_site_static_content ) { $ nb_site_static_content -> setSite ( $ this ) ; return $ this -> nb_site_static_content_list -> addItem ( $ nb_site_static_content ) ; }
Add a static content to a site .
17,602
public function getStaticContent ( $ nb_site_static_content ) { $ nb_site_static_content_id = nb_getMixedValue ( $ nb_site_static_content , 'nb_site_static_content_id' ) ; return ( is_numeric ( $ nb_site_static_content_id ) || nb_isValidGUID ( $ nb_site_static_content_id ) ) ? $ this -> nb_site_static_content_list -> g...
Gets a Static Content item from the list of static contents loaded in the Site .
17,603
public function getStaticContents ( $ force = false ) : CNabuSiteStaticContentList { if ( ! $ this -> isBuiltIn ( ) && ( $ this -> nb_site_static_content_list -> isEmpty ( ) || $ force ) ) { $ this -> nb_site_static_content_list = CNabuSiteStaticContent :: getStaticContentsForSite ( $ this ) ; $ this -> nb_site_static_...
Gets the Static Content list associated with this instance .
17,604
public function isDefaultTargetUsingTarget ( ) { return $ this -> getDefaultTargetUseURI ( ) === CNabuSiteTargetLink :: USE_URI_TRANSLATED && $ this -> nb_site_target_list -> containsKey ( $ this -> getDefaultTargetId ( ) ) ; }
Check if Default Target uses a Site Target object .
17,605
public function setDefaultTarget ( CNabuDataObject $ nb_site_target ) { $ this -> setDefaultTargetUseURI ( CNabuSiteTargetLink :: USE_URI_TRANSLATED ) ; $ this -> transferValue ( $ nb_site_target , 'nb_site_target_id' , 'nb_site_default_target_id' ) ; return $ this ; }
Sets the default Site Target .
17,606
public function setLoginTarget ( CNabuDataObject $ nb_site_target ) { $ this -> setLoginTargetUseURI ( CNabuSiteTargetLink :: USE_URI_TRANSLATED ) ; $ this -> transferValue ( $ nb_site_target , 'nb_site_target_id' , 'nb_site_login_target_id' ) ; return $ this ; }
Sets the login Site Target .
17,607
public function getSiteMap ( $ nb_site_map , $ cascade = false ) { $ retval = null ; $ nb_site_map_id = nb_getMixedValue ( $ nb_site_map , 'nb_site_map_id' ) ; if ( is_numeric ( $ nb_site_map_id ) || nb_isValidGUID ( $ nb_site_map_id ) ) { $ retval = $ this -> nb_site_map_tree -> getItem ( $ nb_site_map_id ) ; } return...
Gets a Site Map instance optionally looking for it in nested levels .
17,608
public function addSiteMap ( CNabuSiteMap $ nb_site_map ) { $ nb_site_map -> transferValue ( $ this , 'nb_site_id' ) ; return $ this -> nb_site_map_tree -> addItem ( $ nb_site_map ) ; }
Add a map to a site
17,609
public function getNaturalLanguages ( bool $ force = false ) : CNabuLanguageList { $ nb_natural = new CNabuLanguageList ( ) ; $ this -> getLanguages ( $ force ) -> iterate ( function ( $ key , CNabuLanguage $ nb_language ) use ( $ nb_natural ) { if ( $ nb_language -> isNaturalLanguage ( ) ) { $ nb_natural -> addItem ( ...
Get the list of all Natural Languages setted for this site .
17,610
public function getAPILanguages ( bool $ force = false ) : CNabuLanguageList { $ nb_api = new CNabuLanguageList ( ) ; $ this -> getLanguages ( $ force ) -> iterate ( function ( $ key , CNabuLanguage $ nb_language ) use ( $ nb_api ) { if ( $ nb_language -> isAPILanguage ( ) ) { $ nb_api -> addItem ( $ nb_language ) ; } ...
Get the list of all API Languages setted for this site .
17,611
public function getRoles ( bool $ force = false ) : CNabuRoleList { if ( $ this -> nb_role_list -> isEmpty ( ) || $ force ) { $ this -> nb_role_list -> fillFromSite ( $ this ) ; } return $ this -> nb_role_list ; }
Gets a list of all Roles availables in this Site .
17,612
public function getSiteRoles ( bool $ force = false ) : CNabuSiteRoleList { if ( $ this -> nb_site_role_list -> isEmpty ( ) || $ force ) { $ this -> nb_site_role_list -> clear ( ) ; $ this -> nb_site_role_list -> merge ( CNabuSiteRole :: getSiteRolesForSite ( $ this ) ) ; } return $ this -> nb_site_role_list ; }
Gets a list of all Site Roles availables in this Site .
17,613
public function getSiteRole ( $ nb_site_role ) { if ( is_numeric ( $ nb_role_id = nb_getMixedValue ( $ nb_site_role , NABU_ROLE_FIELD_ID ) ) ) { $ retval = $ this -> getSiteRoles ( ) -> getItem ( $ nb_role_id ) ; } else { $ retval = false ; } return $ retval ; }
Gets a Site Role by his Id .
17,614
public function sendNewUserNotification ( CNabuUser $ nb_user , array $ params = null ) : bool { $ retval = false ; $ nb_engine = CNabuEngine :: getEngine ( ) ; if ( ( $ nb_profile = $ this -> getUserProfile ( $ nb_user ) ) instanceof CNabuSiteUser && ( $ nb_language_id = $ nb_profile -> getLanguageId ( ) ) ) { if ( co...
Send a New User double opt - in message to validate the account or communitate something to him .
17,615
public function withAuthority ( Actor $ authority = null ) : self { $ statement = clone $ this ; $ statement -> authority = $ authority ; return $ statement ; }
Creates a new Statement based on the current one containing an Authority that asserts the Statement true .
17,616
public function getVoidStatement ( Actor $ actor ) : self { return new Statement ( null , $ actor , Verb :: createVoidVerb ( ) , $ this -> getStatementReference ( ) ) ; }
Returns a Statement that voids the current Statement .
17,617
public function equals ( Statement $ statement ) : bool { if ( null !== $ this -> id xor null !== $ statement -> id ) { return false ; } if ( null !== $ this -> id && null !== $ statement -> id && ! $ this -> id -> equals ( $ statement -> id ) ) { return false ; } if ( ! $ this -> actor -> equals ( $ statement -> actor...
Checks if another statement is equal .
17,618
public static function hydrateCollection ( array $ queues ) { $ hydrated = [ ] ; foreach ( $ queues as $ queue ) { $ hydrated [ ] = self :: hydrate ( $ queue ) ; } return $ hydrated ; }
Hydrate a collection of queue objects into a collection of QueueEntity objects
17,619
public static function hydrate ( stdClass $ queue ) { $ hydrated = new QueueEntity ( ) ; if ( isset ( $ queue -> id ) ) { $ hydrated -> setId ( $ queue -> id ) ; } if ( isset ( $ queue -> started_at ) ) { $ hydrated -> setStartedAt ( new DateTime ( $ queue -> started_at ) ) ; } if ( isset ( $ queue -> finished_at ) ) {...
Hydrate a java object into a QueueEntity object
17,620
public function getIContact ( $ force = false ) { if ( $ this -> nb_icontact === null || $ force ) { $ this -> nb_icontact = null ; if ( $ this instanceof CNabuDataObject && ! $ this -> isBuiltIn ( ) && $ this -> isValueNumeric ( NABU_ICONTACT_FIELD_ID ) ) { $ nb_icontact = new CNabuIContact ( $ this -> getValue ( NABU...
Gets the iContact instance that owns this object .
17,621
public function setIContact ( CNabuIContact $ nb_icontact ) { $ this -> nb_icontact = $ nb_icontact ; if ( $ this instanceof CNabuDataObject && $ nb_icontact -> contains ( NABU_ICONTACT_FIELD_ID ) ) { $ this -> transferValue ( $ nb_icontact , NABU_ICONTACT_FIELD_ID ) ; } return $ this ; }
Sets the iContact instance that onws this object .
17,622
public function getMembers ( $ force = false ) { if ( $ this -> nb_user_group_member_list -> isEmpty ( ) || $ force ) { $ this -> nb_user_group_member_list -> clear ( ) ; if ( $ this -> isValueNumeric ( 'nb_user_group_id' ) ) { $ this -> nb_user_group_member_list -> merge ( CNabuUserGroupMember :: getMembersOfGroup ( $...
Returns the full list of members in the group .
17,623
public function getAdminMembers ( $ force = false ) : CNabuUserGroupMemberList { $ this -> getMembers ( $ force ) ; $ nb_admin_list = new CNabuUserGroupMemberList ( ) ; $ this -> nb_user_group_member_list -> iterate ( function ( $ key , CNabuUserGroupMember $ nb_user_group_member ) use ( $ nb_admin_list ) { if ( $ nb_u...
Returns the full list of admin members in the group .
17,624
public static function hydrateCollection ( array $ applications ) { $ hydrated = [ ] ; foreach ( $ applications as $ application ) { $ hydrated [ ] = self :: hydrate ( $ application ) ; } return $ hydrated ; }
Hydrate a collection of application objects into a collection of ApplicationEntity objects
17,625
public static function hydrate ( stdClass $ application ) { $ hydrated = new ApplicationEntity ( ) ; if ( isset ( $ application -> id ) ) { $ hydrated -> setId ( $ application -> id ) ; } if ( isset ( $ application -> name ) ) { $ hydrated -> setName ( $ application -> name ) ; } if ( isset ( $ application -> current_s...
Hydrate a application object into a ApplicationEntity object
17,626
public function validateZone ( CNabuSiteTarget $ nb_site_target ) { $ nb_engine = CNabuEngine :: getEngine ( ) ; if ( ! ( ( $ nb_site = $ nb_site_target -> getSite ( ) ) instanceof CNabuSite ) ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_SITE_NOT_FOUND ) ; } $ this -> zone = ( $ this -> nb_user !== nu...
Validates if the zone is allowed for current user .
17,627
public function isSignInLocked ( ) { $ nb_session = $ this -> nb_application -> getSession ( ) ; if ( $ nb_session === null || ! ( $ nb_session instanceof CNabuHTTPSession ) ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_SESSION_NOT_FOUND ) ; } $ nb_site = $ this -> nb_application -> getHTTPServer ( ) -...
Check if the Sign - in is enabled or locked by an excess of retries .
17,628
public function resetSignInLock ( ) { $ nb_session = $ this -> nb_application -> getSession ( ) ; if ( $ nb_session === null || ! ( $ nb_session instanceof CNabuHTTPSession ) ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_SESSION_NOT_FOUND ) ; } $ nb_session -> unsetVariable ( 'signin_retries' ) ; $ nb_...
Reset sign - in counters to 0
17,629
public function lockSignIn ( ) { $ retval = false ; $ nb_session = $ this -> nb_application -> getSession ( ) ; if ( $ nb_session === null || ! ( $ nb_session instanceof CNabuHTTPSession ) ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_SESSION_NOT_FOUND ) ; } $ nb_response = $ this -> nb_application -> ...
Tries to lock the sign - in . If counter is less than the max then increases the counter . If elapsed time between now and last retry failed is great than the max lock delay then resets the counter .
17,630
public function isUserLogged ( ) { return ( $ this -> nb_user !== null && $ this -> nb_role !== null && $ this -> nb_site_user !== null ) ; }
Check if the user is logged .
17,631
public function revalidatePassword ( CNabuSite $ nb_site , CNabuUser $ nb_user , string $ passwd ) : bool { if ( ! ( $ nb_site instanceof CNabuSite ) ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_METHOD_PARAMETER_NOT_VALID , array ( '$nb_site' ) ) ; } if ( ! ( $ nb_user instanceof CNabuUser ) || ! $ nb...
Revalidates a password to ensure that the user can continue in the private zone .
17,632
public function applyRoleMask ( INabuRoleMask $ object , array $ params = null ) : bool { return $ object -> applyRoleMask ( $ this -> nb_role , array ( self :: ROLE_MASK_USER_SIGNED => $ this -> isUserLogged ( ) , self :: ROLE_MASK_WORK_CUSTOMER => $ this -> hasWorkCustomer ( ) ) ) ; }
Applies a Role to an object forcing to clean all related entities that does not share the same role .
17,633
public function acceptPolicies ( bool $ save = true ) { $ nb_site = $ this -> nb_application -> getHTTPServer ( ) -> getSite ( ) ; if ( $ nb_site === null || ! ( $ nb_site instanceof CNabuSite ) ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_SITE_NOT_FOUND ) ; } if ( $ this -> isUserLogged ( ) ) { $ thi...
Call this method when a User accept the Policies of the Site . In consequence the lock for policies in all Targets is ignored .
17,634
public function getAll ( $ appId , $ scanId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> classes ( ) -> getAll ( $ appId , $ scanId , $ queryParams ) ; return new CustomClassesResponse ( $ response ) ; }
Get all custom classes for a scan
17,635
public function getById ( $ appId , $ scanId , $ classId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> classes ( ) -> getById ( $ appId , $ scanId , $ classId , $ queryParams ) ; return new CustomClassResponse ( $ response ) ; }
Get custom class for scan by id
17,636
public function create ( $ appId , $ scanId , $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> classes ( ) -> create ( $ appId , $ scanId , $ input -> toArray ( ) , $ queryParams ) ; return new CustomClassResponse ( $ response ) ; }
Create custom class for a scan
17,637
public function getAll ( $ appId , $ scanId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> files ( ) -> getAll ( $ appId , $ scanId , $ queryParams ) ; return new FilesResponse ( $ response ) ; }
Get all files for a scan
17,638
public function getById ( $ appId , $ scanId , $ fileId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> files ( ) -> getById ( $ appId , $ scanId , $ fileId , $ queryParams ) ; return new FileResponse ( $ response ) ; }
Get file for scan by id
17,639
public function delete ( $ appId , $ scanId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> files ( ) -> delete ( $ appId , $ scanId , $ queryParams ) ; return new BaseResponse ( $ response ) ; }
Delete the source code of a scan
17,640
public static function getAlliContacts ( 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_icontact_id' , 'select * ' . 'from...
Get all items in the storage as an associative array where the field nb_icontact_id is the index and each value is an instance of class CNabuIContactBase .
17,641
private function getProvidersConfig ( ) { $ config = [ ] ; foreach ( self :: PROVIDERS as $ provider ) { $ config [ ucfirst ( $ provider ) ] = [ 'enabled' => ( bool ) $ this -> scopeConfig -> getValue ( sprintf ( self :: CONFIG_PATH_SOCIAL_LOGIN_PROVIDER_ENABLED , $ provider ) , ScopeInterface :: SCOPE_STORE ) , 'keys'...
Gets providers from Magento configuration .
17,642
private function getCustomerData ( UserProfile $ profile ) { $ customerData = [ ] ; foreach ( [ 'firstName' , 'lastName' , 'email' ] as $ field ) { $ data = $ profile -> { $ field } ; $ customerData [ strtolower ( $ field ) ] = $ data !== null ? $ data : '-' ; } return $ customerData ; }
Gets customer data for a hybrid auth profile .
17,643
private function handleProviderQuirks ( $ provider , $ customer ) { switch ( $ provider ) { case 'Twitter' : if ( $ customer -> getData ( 'lastname' ) === '-' ) { $ nameParts = explode ( ' ' , $ customer -> getData ( 'firstname' ) ) ; if ( count ( $ nameParts ) > 1 ) { $ customer -> setData ( 'firstname' , $ nameParts ...
Some providers don t really put data in the right fields .
17,644
private function getCustomerForProfile ( $ provider , UserProfile $ profile ) { $ customer = $ this -> customerFactory -> create ( ) ; $ customer -> setWebsiteId ( $ this -> getCurrentWebsiteId ( ) ) ; $ customer -> loadByEmail ( $ profile -> emailVerified ) ; if ( ! $ customer -> getId ( ) ) { $ customer -> setData ( ...
Loads or creates a customer for a hybridauth profile .
17,645
private function isProviderEnabled ( $ provider ) { return ( bool ) $ this -> scopeConfig -> getValue ( sprintf ( SocialLoginService :: CONFIG_PATH_SOCIAL_LOGIN_PROVIDER_ENABLED , $ provider ) , ScopeInterface :: SCOPE_STORE ) ; }
Checks if social login provider is enabled in config .
17,646
public function setClusterGroupId ( int $ nb_cluster_group_id ) : CNabuDataObject { if ( $ nb_cluster_group_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_cluster_group_id" ) ) ; } $ this -> setValue ( 'nb_cluster_group_id' , $ nb_cluster_group_id ) ...
Sets the Cluster Group Id attribute value .
17,647
public function setOSId ( int $ os_id ) : CNabuDataObject { if ( $ os_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$os_id" ) ) ; } $ this -> setValue ( 'nb_cluster_user_group_os_id' , $ os_id ) ; return $ this ; }
Sets the Cluster User Group OS Id attribute value .
17,648
public static function hydrateCollection ( array $ entrypoints ) { $ hydrated = [ ] ; foreach ( $ entrypoints as $ entrypoint ) { $ hydrated [ ] = self :: hydrate ( $ entrypoint ) ; } return $ hydrated ; }
Hydrate a collection of entrypoint objects into a collection of EntrypointEntity objects
17,649
public static function hydrate ( stdClass $ entrypoint ) { $ hydrated = new EntrypointEntity ( ) ; if ( isset ( $ entrypoint -> id ) ) { $ hydrated -> setId ( $ entrypoint -> id ) ; } if ( isset ( $ entrypoint -> line ) ) { $ hydrated -> setLine ( $ entrypoint -> line ) ; } if ( isset ( $ entrypoint -> file ) ) { $ hyd...
Hydrate a entrypoint object into a EntrypointEntity object
17,650
public static function hydrateCollection ( array $ customClasses ) { $ hydrated = [ ] ; foreach ( $ customClasses as $ customClass ) { $ hydrated [ ] = self :: hydrate ( $ customClass ) ; } return $ hydrated ; }
Hydrate a collection of customClass objects into a collection of CustomClassEntity objects
17,651
public static function hydrate ( stdClass $ customClass ) { $ hydrated = new CustomClassEntity ( ) ; if ( isset ( $ customClass -> id ) ) { $ hydrated -> setId ( $ customClass -> id ) ; } if ( isset ( $ customClass -> start_line ) ) { $ hydrated -> setStartLine ( $ customClass -> start_line ) ; } if ( isset ( $ customC...
Hydrate a customClass object into a CustomClassEntity object
17,652
public function setEncoding ( $ encoding ) { if ( ! is_string ( $ encoding ) || ! in_array ( $ encoding , mb_list_encodings ( ) ) ) { throw new \ InvalidArgumentException ( __METHOD__ . "() expects parameter one, encoding, to be a valid " . "character encoding name" ) ; } $ this -> encoding = $ encoding ; return $ this...
Sets the chunker s character encoding
17,653
public function setIndex ( $ index ) { if ( ! is_numeric ( $ index ) || ! is_int ( + $ index ) || $ index < 0 ) { throw new \ InvalidArgumentException ( __METHOD__ . "() expects parameter one, index, to be a positive " . "integer or zero" ) ; } $ this -> index = $ index ; return $ this ; }
Sets the chunker s chunk index
17,654
public function setSize ( $ size ) { if ( ! is_numeric ( $ size ) || ! is_int ( + $ size ) || $ size < 1 ) { throw new \ InvalidArgumentException ( __METHOD__ . "() expects parameter one, size, to be a positive integer" ) ; } $ this -> size = $ size ; return $ this ; }
Sets the chunker s chunk size
17,655
public function getPreviousChunk ( ) { $ offset = -- $ this -> index * $ this -> size ; if ( $ offset >= 0 ) { $ chunk = $ this -> getChunk ( $ offset ) ; } else { $ chunk = false ; } return $ chunk ; }
Returns the previous chunk and updates the chunker s internal pointer
17,656
public function compile ( $ stub , $ modelName , $ modelData , stdClass $ scaffolderConfig , $ hash , ScaffolderThemeExtensionInterface $ themeExtension , array $ extensions , $ extra = null ) { $ this -> stub = $ stub ; return $ this -> setPageTitle ( $ scaffolderConfig ) -> setAppName ( $ scaffolderConfig ) -> setLin...
Compiles the page layout .
17,657
private function setPageTitle ( stdClass $ scaffolderConfig ) { $ this -> stub = str_replace ( '{{page_title}}' , $ scaffolderConfig -> userInterface -> pageTitle , $ this -> stub ) ; return $ this ; }
Replace the page title .
17,658
private function setAppName ( stdClass $ scaffolderConfig ) { $ this -> stub = str_replace ( '{{app_name}}' , $ scaffolderConfig -> name , $ this -> stub ) ; return $ this ; }
Replace the app name .
17,659
private function setLinks ( $ links , stdClass $ scaffolderConfig ) { $ navLinks = '' ; foreach ( $ links as $ link ) { $ navLinks .= sprintf ( " <li> <a href='/%s' class='waves-effect'> %s </a> </li>" , $ scaffolderConfig -> routing -> prefix . '/'...
Add links to the nav .
17,660
public function getAll ( $ appId , $ profileId , array $ queryParams ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> sanitizers ( ) -> getAll ( $ appId , $ profileId , $ queryParams ) ; return new SanitizersResponse ( $ response ) ; }
Get all sanitizers for a profile profile
17,661
public function getById ( $ appId , $ profileId , $ sanitizerId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> sanitizers ( ) -> getById ( $ appId , $ profileId , $ sanitizerId , $ queryParams ) ; return new SanitizerResponse ( $ response ) ; }
Get sanitizer for profile profile by id
17,662
public function create ( $ appId , $ profileId , SanitizerBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> sanitizers ( ) -> create ( $ appId , $ profileId , $ input -> toArray ( ) , $ queryParams ) ; return new SanitizerResponse ( $ response ) ; }
Create sanitizer for profile profile
17,663
public static function hydrateCollection ( array $ ignores ) { $ hydrated = [ ] ; foreach ( $ ignores as $ ignore ) { $ hydrated [ ] = self :: hydrate ( $ ignore ) ; } return $ hydrated ; }
Hydrate a collection of ignore objects into a collection of IgnoredLocationEntity objects
17,664
public static function hydrate ( stdClass $ ignore ) { $ hydrated = new IgnoredLocationEntity ( ) ; if ( isset ( $ ignore -> id ) ) { $ hydrated -> setId ( $ ignore -> id ) ; } if ( isset ( $ ignore -> path ) ) { $ hydrated -> setPath ( $ ignore -> path ) ; } if ( isset ( $ ignore -> match ) ) { $ hydrated -> setMatch ...
Hydrate a ignore object into a IgnoredLocationEntity object
17,665
public static function hydrateCollection ( array $ customFunctions ) { $ hydrated = [ ] ; foreach ( $ customFunctions as $ customFunction ) { $ hydrated [ ] = self :: hydrate ( $ customFunction ) ; } return $ hydrated ; }
Hydrate a collection of custom - function objects into a collection of CustomFunctionEntity objects
17,666
public static function hydrate ( stdClass $ customFunction ) { $ hydrated = new CustomFunctionEntity ( ) ; if ( isset ( $ customFunction -> id ) ) { $ hydrated -> setId ( $ customFunction -> id ) ; } if ( isset ( $ customFunction -> start_line ) ) { $ hydrated -> setStartLine ( $ customFunction -> start_line ) ; } if (...
Hydrate a custom - function object into a CustomFunctionEntity object
17,667
public function compile ( $ stub , $ modelName , $ modelData , stdClass $ scaffolderConfig , $ hash , ScaffolderThemeExtensionInterface $ themeExtension , array $ extensions , $ extra = null ) { if ( File :: exists ( base_path ( 'scaffolder-config/cache/view_index_' . $ hash . self :: CACHE_EXT ) ) ) { return $ this ->...
Compiles the index view .
17,668
private function addDatatableFields ( $ modelName , $ modelData ) { $ fields = '' ; $ firstIteration = true ; foreach ( $ modelData -> fields as $ field ) { if ( $ field -> hideInListings === false ) { if ( $ firstIteration ) { $ fields .= sprintf ( "{ data: '%s', name: '%s' }," . PHP_EOL , $ field -> name , $ field ->...
Datatable fields .
17,669
protected function getVersionedResourceClassName ( $ group , $ name ) { $ class = \ str_replace ( '.' , '\\' , $ name ) ; $ version = $ this -> getVersionNamespace ( ) ; return \ sprintf ( '%s\%s\%s\%s' , $ this -> namespace , $ group , $ version , $ class ) ; }
Get versioned resource class name .
17,670
protected function getVersionNamespace ( ) { $ version = $ this -> api ( ) -> getVersion ( ) ; $ supported = $ this -> getSupportedVersionNamespace ( ) ; if ( isset ( $ supported [ $ version ] ) ) { return $ supported [ $ version ] ; } return 'Base' ; }
Get the version namespace .
17,671
static public function getItemsForCatalog ( $ nb_catalog , int $ level ) { $ nb_catalog_id = nb_getMixedValue ( $ nb_catalog , NABU_CATALOG_FIELD_ID ) ; if ( is_numeric ( $ nb_catalog_id ) ) { $ retval = CNabuCatalogItem :: buildObjectListFromSQL ( NABU_CATALOG_ITEM_FIELD_ID , 'SELECT * FROM nb_catalo...
Gets the list of items of a catalog from the storage .
17,672
static public function getItemTranslationsForCatalog ( $ nb_catalog , int $ level ) { $ nb_catalog_id = nb_getMixedValue ( $ nb_catalog , NABU_CATALOG_FIELD_ID ) ; if ( is_numeric ( $ nb_catalog_id ) ) { $ retval = CNabuCatalogItemLanguage :: buildObjectListFromSQL ( null , 'SELECT cil.* FROM nb_catal...
Gets the list of translations associated to all items of a catalog from the storage .
17,673
public function getItems ( bool $ force = false ) : CNabuCatalogItemList { if ( $ this -> nb_tree_child_list -> isEmpty ( ) || $ force ) { $ this -> nb_tree_child_list -> merge ( CNabuCatalogItem :: buildObjectListFromSQL ( 'nb_catalog_item_id' , 'SELECT * FROM nb_catalog_item ...
Get children items of this Item .
17,674
public static function getAllCatalogTaxonomies ( CNabuCatalog $ nb_catalog ) { $ nb_catalog_id = nb_getMixedValue ( $ nb_catalog , 'nb_catalog_id' ) ; if ( is_numeric ( $ nb_catalog_id ) ) { $ retval = forward_static_call ( array ( get_called_class ( ) , 'buildObjectListFromSQL' ) , 'nb_catalog_taxonomy_id' , 'select *...
Get all items in the storage as an associative array where the field nb_catalog_taxonomy_id is the index and each value is an instance of class CNabuCatalogTaxonomyBase .
17,675
public function setScope ( string $ scope = "O" ) : CNabuDataObject { if ( $ scope === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$scope" ) ) ; } $ this -> setValue ( 'nb_catalog_taxonomy_scope' , $ scope ) ; return $ this ; }
Sets the Catalog Taxonomy Scope attribute value .
17,676
public function setNew ( string $ new = "T" ) : CNabuDataObject { if ( $ new === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$new" ) ) ; } $ this -> setValue ( 'nb_user_group_member_new' , $ new ) ; return $ this ; }
Sets the User Group Member New attribute value .
17,677
public function setAdmin ( string $ admin = "F" ) : CNabuDataObject { if ( $ admin === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$admin" ) ) ; } $ this -> setValue ( 'nb_user_group_member_admin' , $ admin ) ; return $ this ; }
Sets the User Group Member Admin attribute value .
17,678
public function setVendorKey ( string $ vendor_key ) { if ( ! nb_isValidKey ( $ vendor_key ) ) { throw new ENabuProviderException ( ENabuProviderException :: ERROR_VENDOR_KEY_NOT_VALID , array ( $ vendor_key ) ) ; } $ this -> setValue ( self :: VENDOR_KEY , $ vendor_key ) ; try { $ this -> getComplexKey ( ) ; } catch (...
Sets the vendor key
17,679
public function setModuleKey ( string $ module_key ) { if ( ! nb_isValidKey ( $ module_key ) ) { throw new ENabuProviderException ( ENabuProviderException :: ERROR_MODULE_KEY_NOT_VALID , array ( $ module_key ) ) ; } $ this -> setValue ( self :: MODULE_KEY , $ module_key ) ; try { $ this -> getComplexKey ( ) ; } catch (...
Sets the module key
17,680
public static function getAllUserGroupTypes ( 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_user_group_type_id' , 'select...
Get all items in the storage as an associative array where the field nb_user_group_type_id is the index and each value is an instance of class CNabuUserGroupTypeBase .
17,681
public function setExclusive ( string $ exclusive = "F" ) : CNabuDataObject { if ( $ exclusive === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$exclusive" ) ) ; } $ this -> setValue ( 'nb_user_group_type_exclusive' , $ exclusive ) ; return $ this ; }
Sets the User Group Type Exclusive attribute value .
17,682
public function setCreatorOwner ( string $ creator_owner = "T" ) : CNabuDataObject { if ( $ creator_owner === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$creator_owner" ) ) ; } $ this -> setValue ( 'nb_user_group_type_creator_owner' , $ creator_owner ) ; re...
Sets the User Group Type Creator Owner attribute value .
17,683
protected function addElementTableAttributes ( ) { $ segments = Craft :: $ app -> getRequest ( ) -> getSegments ( ) ; $ actionSegment = $ segments [ count ( $ segments ) - 1 ] ?? null ; $ classes = [ Entry :: class , Category :: class ] ; foreach ( $ classes as $ class ) { Event :: on ( $ class , Element :: EVENT_REGIS...
Add element table attributes
17,684
public function setCommerceProductCategoryId ( int $ nb_commerce_product_category_id ) : CNabuDataObject { if ( $ nb_commerce_product_category_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_commerce_product_category_id" ) ) ; } $ this -> setValue ( '...
Sets the Commerce Product Category Id attribute value .
17,685
public static function getAllUserGroups ( 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_user_group_id' , 'select * ' . 'f...
Get all items in the storage as an associative array where the field nb_user_group_id is the index and each value is an instance of class CNabuUserGroupBase .
17,686
public function setStatus ( string $ status = "E" ) : CNabuDataObject { if ( $ status === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$status" ) ) ; } $ this -> setValue ( 'nb_user_group_status' , $ status ) ; return $ this ; }
Sets the User Group Status attribute value .
17,687
public function newProductCategory ( string $ key = null , int $ order = 1 ) : CNabuCommerceProductCategory { $ nb_commerce_product_category = $ this -> isBuiltIn ( ) ? new CNabuBuiltInCommerceProductCategory ( ) : new CNabuCommerceProductCategory ( ) ; $ nb_commerce_product_category -> setKey ( $ key ) ; $ nb_commerce...
Creates a new Product Category instance .
17,688
public function addProductCategoryObject ( CNabuCommerceProductCategory $ nb_commerce_product_category ) { $ nb_commerce_product_category -> setCommerce ( $ this ) ; return $ this -> nb_commerce_product_category_list -> addItem ( $ nb_commerce_product_category ) ; }
Adds a Product Category object to this Commerce .
17,689
public function getProductCategory ( $ nb_commerce_product_category ) { $ nb_category = false ; $ nb_category_id = nb_getMixedValue ( $ nb_commerce_product_category , NABU_COMMERCE_PRODUCT_CATEGORY_FIELD_ID ) ; if ( is_numeric ( $ nb_category_id ) ) { $ nb_category = $ this -> nb_commerce_product_category_list -> getIt...
Gets a Product Category by Id .
17,690
public function getProductCategories ( bool $ force = false ) : CNabuCommerceProductCategoryList { if ( $ this -> nb_commerce_product_category_list -> isEmpty ( ) || $ force ) { $ this -> nb_commerce_product_category_list -> clear ( ) ; $ this -> nb_commerce_product_category_list -> merge ( CNabuCommerceProductCategory...
Gets the full list of all Product Categories in this Commerce instance .
17,691
public function getProducts ( bool $ force = false ) : CNabuCommerceProductList { if ( $ this -> nb_commerce_product_list -> isEmpty ( ) || $ force ) { $ this -> nb_commerce_product_list -> clear ( ) ; $ this -> nb_commerce_product_list -> merge ( CNabuCommerceProduct :: getProductsForCommerce ( $ this ) ) ; } return $...
Gets the full list of all Products in this Commerce instance .
17,692
public function getProduct ( $ nb_commerce_product ) { $ nb_product = false ; $ nb_product_id = nb_getMixedValue ( $ nb_commerce_product , NABU_COMMERCE_PRODUCT_FIELD_ID ) ; if ( is_numeric ( $ nb_product_id ) ) { $ nb_product = $ this -> nb_commerce_product_list -> getItem ( $ nb_product_id ) ; } return $ nb_product ;...
Gets a Product by Id .
17,693
public function findProductBySlug ( string $ slug , $ nb_language = null ) { $ retval = false ; $ nb_language_id = nb_getMixedValue ( $ nb_language , NABU_LANG_FIELD_ID ) ; $ this -> getProducts ( ) -> iterate ( function ( $ key , CNabuCommerceProduct $ nb_product ) use ( & $ retval , $ slug , $ nb_language_id ) { if (...
Find a Product using their slug .
17,694
public function refresh ( bool $ force = false , bool $ cascade = false ) : bool { return parent :: refresh ( $ force , $ cascade ) && ( ! $ cascade || ( $ this -> getProductCategories ( $ force ) && $ this -> getProducts ( $ force ) ) ) ; }
Overrides refresh method to allow commerce subentities to be refreshed .
17,695
public function isServerValid ( ) { return ( $ this -> nb_server !== null && ( $ this -> nb_server -> isBuiltIn ( ) || $ this -> nb_server -> isFetched ( ) ) ) ; }
Checks if a server is valid . Valid servers are Built - in instances or fetched servers .
17,696
public function setMessagingServiceStackId ( int $ nb_messaging_service_stack_id ) : CNabuDataObject { if ( $ nb_messaging_service_stack_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_messaging_service_stack_id" ) ) ; } $ this -> setValue ( 'nb_messa...
Sets the Messaging Service Stack Id attribute value .
17,697
public function transform ( $ source ) { if ( $ this -> discoverInterface ( ) ) { $ this -> nb_interface -> transform ( $ source ) ; } else { throw new ENabuRenderException ( ENabuRenderException :: ERROR_RENDER_TRANSFORM_NOT_FOUND , array ( $ this -> nb_descriptor -> getKey ( ) ) ) ; } }
This method transform the content passed as parameter and exposes the result in the default output stream .
17,698
public function getSite ( CNabuCustomer $ nb_customer = null , $ force = false ) { if ( $ nb_customer !== null && ( $ this -> nb_site === null || $ force ) ) { $ this -> nb_site = null ; if ( $ this instanceof CNabuDataObject && $ this -> contains ( NABU_SITE_FIELD_ID ) ) { $ this -> nb_site = $ nb_customer -> getSite ...
Gets the Site instance .
17,699
public function setSite ( CNabuSite $ nb_site = null , $ field = NABU_SITE_FIELD_ID ) { $ this -> nb_site = $ nb_site ; if ( $ this instanceof CNabuDataObject ) { $ this -> transferValue ( $ nb_site , $ field ) ; } return $ this ; }
Sets the Site instance that owns this object and sets the field containing the site id .