idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
17,500
public function getAll ( $ appId , $ scanId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> entrypoints ( ) -> getAll ( $ appId , $ scanId , $ queryParams ) ; return new EntrypointsResponse ( $ response ) ; }
Get all entrypoints for a scan
17,501
public function getById ( $ appId , $ scanId , $ entrypointId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> entrypoints ( ) -> getById ( $ appId , $ scanId , $ entrypointId , $ queryParams ) ; return new EntrypointResponse ( $ response ) ; }
Get entrypoint for scan by id
17,502
public static function hydrateCollection ( array $ taints ) { $ hydrated = [ ] ; foreach ( $ taints as $ taint ) { $ hydrated [ ] = self :: hydrate ( $ taint ) ; } return $ hydrated ; }
Hydrate a collection of taint objects into a collection of TaintEntity objects
17,503
public static function hydrate ( stdClass $ taint ) { $ hydrated = new TaintEntity ( ) ; if ( isset ( $ taint -> id ) ) { $ hydrated -> setId ( $ taint -> id ) ; } if ( isset ( $ taint -> start_line ) ) { $ hydrated -> setStartLine ( $ taint -> start_line ) ; } if ( isset ( $ taint -> end_line ) ) { $ hydrated -> setEn...
Hydrate a taint object into a TaintEntity object
17,504
public function setCatalogId ( int $ nb_catalog_id ) : CNabuDataObject { if ( $ nb_catalog_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_catalog_id" ) ) ; } $ this -> setValue ( 'nb_catalog_id' , $ nb_catalog_id ) ; return $ this ; }
Sets the Catalog Id attribute value .
17,505
public static function hydrateCollection ( array $ concats ) { $ hydrated = [ ] ; foreach ( $ concats as $ concat ) { $ hydrated [ ] = self :: hydrate ( $ concat ) ; } return $ hydrated ; }
Hydrate a collection of concat objects into a collection of ConcatEntity objects
17,506
public static function hydrate ( stdClass $ concat ) { $ hydrated = new ConcatEntity ( ) ; if ( isset ( $ concat -> id ) ) { $ hydrated -> setId ( $ concat -> id ) ; } if ( isset ( $ concat -> line ) ) { $ hydrated -> setLine ( $ concat -> line ) ; } if ( isset ( $ concat -> start_line ) ) { $ hydrated -> setStartLine ...
Hydrate a concat object into a ConcatEntity object
17,507
public function getAll ( array $ queryParams = [ ] ) { $ response = $ this -> api -> oauth2 ( ) -> clients ( ) -> getAll ( $ queryParams ) ; return new ClientsResponse ( $ response ) ; }
Get all clients
17,508
public function getById ( $ clientId , array $ queryParams = [ ] ) { $ response = $ this -> api -> oauth2 ( ) -> clients ( ) -> getById ( $ clientId , $ queryParams ) ; return new ClientResponse ( $ response ) ; }
Get a client by id
17,509
public function create ( ClientBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> oauth2 ( ) -> clients ( ) -> create ( $ input -> toArray ( ) , $ queryParams ) ; return new ClientResponse ( $ response ) ; }
Create a new client
17,510
public function delete ( $ clientId , array $ queryParams ) { $ response = $ this -> api -> oauth2 ( ) -> clients ( ) -> delete ( $ clientId , $ queryParams ) ; return new BaseResponse ( $ response ) ; }
Delete a client
17,511
public function equals ( Account $ account ) : bool { if ( $ this -> name !== $ account -> name ) { return false ; } if ( ! $ this -> homePage -> equals ( $ account -> homePage ) ) { return false ; } return true ; }
Checks if another account is equal .
17,512
private function addFields ( $ modelData ) { $ fields = '' ; $ firstIteration = true ; foreach ( $ modelData -> fields as $ field ) { if ( $ firstIteration ) { $ fields .= self :: getInputFor ( $ field ) . PHP_EOL ; $ firstIteration = false ; } else { $ fields .= $ this -> tab ( 2 ) . self :: getInputFor ( $ field ) . ...
Add fields to the edit view .
17,513
private function replacePrimaryKey ( $ modelData ) { $ primaryKey = 'id' ; foreach ( $ modelData -> fields as $ field ) { if ( $ field -> index == 'primary' ) { $ primaryKey = $ field -> name ; break ; } } $ this -> stub = str_replace ( '{{primaryKey}}' , $ primaryKey , $ this -> stub ) ; return $ this ; }
Replace the primary key .
17,514
protected function registerHTTPServerInterface ( INabuHTTPServerInterface $ interface ) : bool { $ hash = $ interface -> getHash ( ) ; if ( is_array ( $ this -> http_server_interface_list ) && array_key_exists ( $ hash , $ this -> http_server_interface_list ) ) { throw new ENabuHTTPException ( ENabuHTTPException :: ERR...
Register a new HTTP Server Interface instance .
17,515
public function getClassesFromNamespace ( $ namespace = null ) { $ namespace = $ namespace ? : $ this -> getAppNamespace ( ) ; $ path = $ this -> convertNamespaceToPath ( $ namespace ) ; return $ this -> finder -> findClasses ( $ path ) ; }
Get all classes for a given namespace .
17,516
protected function convertNamespaceToPath ( $ namespace ) { $ appNamespace = $ this -> getAppNamespace ( ) ; if ( substr ( $ namespace , 0 , strlen ( $ appNamespace ) ) != $ appNamespace ) { return null ; } $ subNamespace = substr ( $ namespace , strlen ( $ appNamespace ) ) ; $ subPath = str_replace ( '\\' , '/' , $ su...
Convert given namespace to file path .
17,517
public function clean ( ) { if ( $ this -> files -> exists ( $ this -> path ) ) { $ this -> files -> cleanDirectory ( $ this -> path ) ; } }
Clean model directory .
17,518
protected function getPrimaryKeyColumn ( $ entityMetadata ) { $ primaryKey = 'id' ; $ incrementing = true ; foreach ( $ entityMetadata [ 'table' ] [ 'columns' ] as $ column ) { if ( $ column [ 'primary' ] ) { return $ column ; } } }
Get primary key and auto increment value .
17,519
protected function replaceTraits ( $ entityMetadata , & $ stub ) { $ traits = [ ] ; if ( ! empty ( $ entityMetadata [ 'versionTable' ] ) ) { $ traits [ 'versionable' ] = 'use \ProAI\Versioning\Versionable;' ; } if ( $ entityMetadata [ 'softDeletes' ] ) { $ traits [ 'softDeletes' ] = 'use \ProAI\Versioning\SoftDeletes;'...
Replace traits .
17,520
protected function replaceVersionable ( $ versionTable , & $ stub ) { $ option = ( ! empty ( $ versionTable ) ) ? true : false ; $ stub = str_replace ( '{{versionable}}' , ( ! empty ( $ versionTable ) ) ? 'use \ProAI\Versioning\Versionable;' . PHP_EOL . PHP_EOL . ' ' : '' , $ stub ) ; }
Replace versionable .
17,521
protected function replaceAutoUuids ( $ entityMetadata , & $ stub ) { $ autoUuids = [ ] ; foreach ( $ entityMetadata [ 'table' ] [ 'columns' ] as $ column ) { if ( ! empty ( $ column [ 'options' ] [ 'autoUuid' ] ) ) { $ autoUuids [ ] = $ column [ 'name' ] ; } } $ stub = str_replace ( '{{autoUuids}}' , $ this -> getArra...
Replace autoUuids .
17,522
protected function replaceVersioned ( $ versionTable , & $ stub ) { if ( ! $ versionTable ) { $ stub = str_replace ( '{{versioned}}' , $ this -> getArrayAsText ( [ ] ) , $ stub ) ; return ; } $ versioned = [ ] ; foreach ( $ versionTable [ 'columns' ] as $ column ) { if ( ! $ column [ 'primary' ] || $ column [ 'name' ] ...
Replace versioned .
17,523
protected function replaceMapping ( $ entityMetadata , & $ stub ) { $ attributes = [ ] ; foreach ( $ entityMetadata [ 'attributes' ] as $ attributeMetadata ) { $ attributes [ $ attributeMetadata [ 'name' ] ] = $ attributeMetadata [ 'columnName' ] ; } $ embeddeds = [ ] ; foreach ( $ entityMetadata [ 'embeddeds' ] as $ e...
Replace mapping .
17,524
protected function replaceRelations ( $ relations , & $ stub ) { $ textRelations = [ ] ; foreach ( $ relations as $ key => $ relation ) { $ relationStub = $ this -> stubs [ 'relation' ] ; $ options = [ ] ; if ( $ relation [ 'type' ] != 'morphTo' ) { $ options [ ] = "'" . get_mapped_model ( $ relation [ 'relatedEntity' ...
Replace relations .
17,525
protected function getArrayAsText ( $ array , $ intendBy = 1 ) { $ intention = '' ; for ( $ i = 0 ; $ i < $ intendBy ; $ i ++ ) { $ intention .= ' ' ; } $ text = var_export ( $ array , true ) ; $ text = preg_replace ( '/[ ]{2}/' , ' ' , $ text ) ; $ text = preg_replace ( "/\=\>[ \n ]+array[ ]+\(/" , '=> array(...
Get an array in text format .
17,526
public function getProject ( CNabuCustomer $ nb_customer = null , $ force = false ) { if ( $ nb_customer !== null && ( $ this -> nb_project === null || $ force ) ) { $ this -> nb_project = null ; if ( $ this instanceof CNabuDataObject && $ this -> contains ( NABU_PROJECT_FIELD_ID ) ) { $ this -> nb_project = $ nb_custo...
Gets the Project instance .
17,527
public function setProject ( CNabuProject $ nb_project , $ field = NABU_PROJECT_FIELD_ID ) { $ this -> nb_project = $ nb_project ; if ( $ this instanceof CNabuDataObject ) { $ this -> transferValue ( $ nb_project , NABU_PROJECT_FIELD_ID , $ field ) ; } return $ this ; }
Sets the Project instance that owns this object and sets the field containing the project id .
17,528
public function getAll ( $ appId , $ profileId , array $ queryParams ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> sources ( ) -> getAll ( $ appId , $ profileId , $ queryParams ) ; return new SourcesResponse ( $ response ) ; }
Get all sources for a profile profile
17,529
public function getById ( $ appId , $ profileId , $ sourceId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> sources ( ) -> getById ( $ appId , $ profileId , $ sourceId , $ queryParams ) ; return new SourceResponse ( $ response ) ; }
Get source for profile profile by id
17,530
public function create ( $ appId , $ profileId , SourceBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> sources ( ) -> create ( $ appId , $ profileId , $ input -> toArray ( ) , $ queryParams ) ; return new SourceResponse ( $ response ) ; }
Create source for profile profile
17,531
public function setErrorReporting ( int $ error_reporting = 0 ) : CNabuDataObject { if ( $ error_reporting === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$error_reporting" ) ) ; } $ this -> setValue ( 'nb_site_module_error_reporting' , $ error_reporting ) ;...
Sets the Site Module Error Reporting attribute value .
17,532
public function setDebugging ( string $ debugging = "F" ) : CNabuDataObject { if ( $ debugging === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$debugging" ) ) ; } $ this -> setValue ( 'nb_site_module_debugging' , $ debugging ) ; return $ this ; }
Sets the Site Module Debugging attribute value .
17,533
protected function replaceClassName ( $ modelName ) { $ this -> stub = str_replace ( '{{class_name}}' , $ modelName , $ this -> stub ) ; $ this -> stub = str_replace ( '{{class_name_lw}}' , strtolower ( $ modelName ) , $ this -> stub ) ; return $ this ; }
Replace the class name .
17,534
protected function replaceNamespace ( stdClass $ scaffolderConfig ) { $ this -> stub = str_replace ( '{{namespace}}' , $ scaffolderConfig -> namespaces -> models , $ this -> stub ) ; return $ this ; }
Replace the namespace .
17,535
static public function getRolesForSite ( $ nb_site ) : CNabuRoleList { $ nb_site_id = nb_getMixedValue ( $ nb_site , NABU_SITE_FIELD_ID ) ; if ( is_numeric ( $ nb_site_id ) ) { $ retval = self :: buildObjectListFromSQL ( 'nb_role_id' , 'select r.* ' . 'from nb_role r, nb_site_role sr, nb_site s ' . 'where r.nb_role_id=...
Get the Role List of Roles assigned to a Site .
17,536
public function setText ( $ text ) { if ( ! is_string ( $ text ) ) { throw new \ InvalidArgumentException ( __METHOD__ . "() expects parameter one, text, to be a string" ) ; } $ this -> text = $ text ; return $ this ; }
Sets the chunker s text
17,537
public function getMaxChunks ( ) { return ceil ( mb_strlen ( ( string ) $ this -> text , $ this -> encoding ) / $ this -> size ) ; }
Returns the maximum number of chunks in the text
17,538
protected function getChunk ( $ offset ) { if ( ! is_numeric ( $ offset ) || ! is_int ( + $ offset ) || $ offset < 0 ) { throw new \ InvalidArgumentException ( __METHOD__ . "() expects parameter one, offset, to be a positive " . "integer or zero" ) ; } $ chunk = false ; $ text = ( string ) $ this -> text ; if ( $ offse...
Returns a string chunk or false if chunk does not exist
17,539
private function replaceNamespaceModelExtend ( stdClass $ scaffolderConfig ) { $ this -> stub = str_replace ( '{{namespace_model_extend}}' , $ scaffolderConfig -> inheritance -> model , $ this -> stub ) ; return $ this ; }
Replace the namespace which the model extends
17,540
public function setMediotecaTypeId ( int $ nb_medioteca_type_id ) : CNabuDataObject { if ( $ nb_medioteca_type_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_medioteca_type_id" ) ) ; } $ this -> setValue ( 'nb_medioteca_type_id' , $ nb_medioteca_type...
Sets the Medioteca Type Id attribute value .
17,541
public function equals ( Score $ score ) : bool { if ( null !== $ this -> scaled xor null !== $ score -> scaled ) { return false ; } if ( ( float ) $ this -> scaled !== ( float ) $ score -> scaled ) { return false ; } if ( null !== $ this -> raw xor null !== $ score -> raw ) { return false ; } if ( ( float ) $ this -> ...
Checks if another score is equal .
17,542
public function renderEmailBody ( string $ templateName , string $ templatePackage , string $ format , array $ variables , bool $ emogrify = true ) : string { $ standaloneView = new StandaloneView ( ) ; $ request = $ standaloneView -> getRequest ( ) ; $ request -> setFormat ( $ format ) ; $ templatePath = sprintf ( 're...
Renders the email body of a template . Can be used directly to only render the email html body . if the given format is htm or html will automatically emogrify the email body . This can be skipped by setting the last parameter to false .
17,543
protected function sendMail ( Message $ mail ) : bool { $ allRecipients = $ mail -> getTo ( ) + $ mail -> getCc ( ) + $ mail -> getBcc ( ) ; $ totalNumberOfRecipients = count ( $ allRecipients ) ; $ actualNumberOfRecipients = 0 ; $ exceptionMessage = '' ; try { $ actualNumberOfRecipients = $ mail -> send ( ) ; } catch ...
Sends a mail and logs or throws any errors depending on configuration
17,544
public function getAll ( $ appId , $ scanId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> concats ( ) -> getAll ( $ appId , $ scanId , $ queryParams ) ; return new ConcatsResponse ( $ response ) ; }
Get all concats for a scan
17,545
public function getById ( $ appId , $ scanId , $ concatId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> concats ( ) -> getById ( $ appId , $ scanId , $ concatId , $ queryParams ) ; return new ConcatResponse ( $ response ) ; }
Get concat for scan by id
17,546
public static function hydrateCollection ( array $ validators ) { $ hydrated = [ ] ; foreach ( $ validators as $ validator ) { $ hydrated [ ] = self :: hydrate ( $ validator ) ; } return $ hydrated ; }
Hydrate a collection of validator objects into a collection of ValidatorEntity objects
17,547
public static function hydrate ( stdClass $ validator ) { $ hydrated = new ValidatorEntity ( ) ; if ( isset ( $ validator -> id ) ) { $ hydrated -> setId ( $ validator -> id ) ; } if ( isset ( $ validator -> class ) ) { $ hydrated -> setClass ( $ validator -> class ) ; } if ( isset ( $ validator -> method ) ) { $ hydra...
Hydrate a validator object into a ValidatorEntity object
17,548
public static function findByKey ( $ nb_customer , $ key ) { $ nb_customer_id = nb_getMixedValue ( $ nb_customer , 'nb_customer_id' ) ; if ( is_numeric ( $ nb_customer_id ) ) { $ retval = CNabuMediotecaType :: buildObjectFromSQL ( 'select * ' . 'from nb_medioteca_type ' . 'where nb_customer_id=%cust_id$d ' . "and nb_me...
Find an instance identified by nb_medioteca_type_key field .
17,549
public static function getAllMediotecaTypes ( 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_medioteca_type_id' , 'select ...
Get all items in the storage as an associative array where the field nb_medioteca_type_id is the index and each value is an instance of class CNabuMediotecaTypeBase .
17,550
public static function getFilteredMediotecaTypeList ( $ nb_customer , $ q = null , $ fields = null , $ order = null , $ offset = 0 , $ num_items = 0 ) { $ nb_customer_id = nb_getMixedValue ( $ nb_customer , NABU_CUSTOMER_FIELD_ID ) ; if ( is_numeric ( $ nb_customer_id ) ) { $ fields_part = nb_prefixFieldList ( CNabuMed...
Gets a filtered list of Medioteca Type instances represented as an array . Params allows the capability of select a subset of fields order by concrete fields or truncate the list by a number of rows starting in an offset .
17,551
public function getAll ( array $ queryParams = [ ] ) { $ response = $ this -> api -> sources ( ) -> getAll ( $ queryParams ) ; return new SourcesResponse ( $ response ) ; }
Get all directories from the root source directory
17,552
public function getById ( $ appId , $ aclId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> acls ( ) -> getById ( $ appId , $ aclId , $ queryParams ) ; return new AclResponse ( $ response ) ; }
Get a acl for application by id
17,553
public function create ( $ appId , AclBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> acls ( ) -> create ( $ appId , $ input -> toArray ( ) , $ queryParams ) ; return new AclResponse ( $ response ) ; }
Create a new acl for a application
17,554
public function update ( $ appId , $ aclId , AclBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> acls ( ) -> update ( $ appId , $ aclId , $ input -> toArray ( ) , $ queryParams ) ; return new AclResponse ( $ response ) ; }
Update existing acl for application by id
17,555
public function byVerb ( Verb $ verb ) : self { $ this -> filter [ 'verb' ] = $ verb -> getId ( ) -> getValue ( ) ; return $ this ; }
Filters by a verb .
17,556
public function byActivity ( Activity $ activity ) : self { $ this -> filter [ 'activity' ] = $ activity -> getId ( ) -> getValue ( ) ; return $ this ; }
Filter by an Activity .
17,557
public function limit ( int $ limit ) : self { if ( $ limit < 0 ) { throw new \ InvalidArgumentException ( 'Limit must be a non-negative integer' ) ; } $ this -> filter [ 'limit' ] = $ limit ; return $ this ; }
Sets the maximum number of Statements to return . The server side sets the maximum number of results when this value is not set or when it is 0 .
17,558
public function acquireItem ( $ key , $ index = false ) { if ( $ index === self :: INDEX_KEY ) { $ nb_site = CNabuEngine :: getEngine ( ) -> getApplication ( ) -> getRequest ( ) -> getSite ( ) ; $ retval = CNabuSiteTarget :: findByKey ( $ nb_site , $ key ) ; } else { $ retval = parent :: acquireItem ( $ key , $ index )...
Overrides temporally this method to support nb_site_target_key acquisitions .
17,559
public function setSiteTargetCTAId ( int $ nb_site_target_cta_id ) : CNabuDataObject { if ( $ nb_site_target_cta_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_site_target_cta_id" ) ) ; } $ this -> setValue ( 'nb_site_target_cta_id' , $ nb_site_targe...
Sets the Site Target CTA Id attribute value .
17,560
public static function findByKey ( $ nb_medioteca , $ key ) { $ nb_medioteca_id = nb_getMixedValue ( $ nb_medioteca , 'nb_medioteca_id' ) ; if ( is_numeric ( $ nb_medioteca_id ) ) { $ retval = CNabuSiteTargetSection :: buildObjectFromSQL ( 'select * ' . 'from nb_site_target_section ' . 'where nb_medioteca_id=%medioteca...
Find an instance identified by nb_site_target_section_key field .
17,561
public static function getAllSiteTargetSections ( 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_site_target_section...
Get all items in the storage as an associative array where the field nb_site_target_section_id is the index and each value is an instance of class CNabuSiteTargetSectionBase .
17,562
public static function getFilteredSiteTargetSectionList ( $ nb_medioteca = null , $ q = null , $ fields = null , $ order = null , $ offset = 0 , $ num_items = 0 ) { $ nb_medioteca_id = nb_getMixedValue ( $ nb_customer , NABU_MEDIOTECA_FIELD_ID ) ; if ( is_numeric ( $ nb_medioteca_id ) ) { $ fields_part = nb_prefixField...
Gets a filtered list of Site Target Section instances represented as an array . Params allows the capability of select a subset of fields order by concrete fields or truncate the list by a number of rows starting in an offset .
17,563
public function setOrder ( int $ order ) : CNabuDataObject { if ( $ order === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$order" ) ) ; } $ this -> setValue ( 'nb_site_target_section_order' , $ order ) ; return $ this ; }
Sets the Site Target Section Order attribute value .
17,564
public function deauthenticate ( ResponseFactory $ response , Guard $ guard , JWTAuth $ auth ) { $ guard -> logout ( ) ; $ auth -> invalidate ( ) ; return $ response -> json ( [ ] ) ; }
Deauthenticate the user .
17,565
public function refresh ( ResponseFactory $ response , JWTAuth $ auth ) { try { $ token = $ auth -> parseToken ( ) -> refresh ( ) ; } catch ( JWTException $ e ) { throw new UnauthorizedHttpException ( 'jwt-auth' , $ e -> getMessage ( ) ) ; } return $ response -> json ( [ 'token' => $ token ] ) ; }
Refresh user token .
17,566
public static function getAllCommerceProducts ( CNabuCommerce $ nb_commerce ) { $ nb_commerce_id = nb_getMixedValue ( $ nb_commerce , 'nb_commerce_id' ) ; if ( is_numeric ( $ nb_commerce_id ) ) { $ retval = forward_static_call ( array ( get_called_class ( ) , 'buildObjectListFromSQL' ) , 'nb_commerce_product_id' , 'sel...
Get all items in the storage as an associative array where the field nb_commerce_product_id is the index and each value is an instance of class CNabuCommerceProductBase .
17,567
public static function getFilteredCommerceProductList ( $ q = null , $ fields = null , $ order = null , $ offset = 0 , $ num_items = 0 ) { $ nb_commerce_id = nb_getMixedValue ( $ nb_customer , NABU_COMMERCE_FIELD_ID ) ; if ( is_numeric ( $ nb_commerce_id ) ) { $ fields_part = nb_prefixFieldList ( CNabuCommerceProductBa...
Gets a filtered list of Commerce Product instances represented as an array . Params allows the capability of select a subset of fields order by concrete fields or truncate the list by a number of rows starting in an offset .
17,568
public function setTaxPercentage ( $ tax_percentage ) : CNabuDataObject { if ( $ tax_percentage === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$tax_percentage" ) ) ; } $ this -> setValue ( 'nb_commerce_product_tax_percentage' , $ tax_percentage ) ; return $...
Sets the Commerce Product Tax Percentage attribute value .
17,569
public function setTaxAmount ( $ tax_amount ) : CNabuDataObject { if ( $ tax_amount === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$tax_amount" ) ) ; } $ this -> setValue ( 'nb_commerce_product_tax_amount' , $ tax_amount ) ; return $ this ; }
Sets the Commerce Product Tax Amount attribute value .
17,570
public function setPriceWithTax ( $ price_with_tax ) : CNabuDataObject { if ( $ price_with_tax === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$price_with_tax" ) ) ; } $ this -> setValue ( 'nb_commerce_product_price_with_tax' , $ price_with_tax ) ; return $ ...
Sets the Commerce Product Price With Tax attribute value .
17,571
public function setIsUpselling ( string $ is_upselling = "F" ) : CNabuDataObject { if ( $ is_upselling === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$is_upselling" ) ) ; } $ this -> setValue ( 'nb_commerce_product_is_upselling' , $ is_upselling ) ; return ...
Sets the Commerce Product Is Upselling attribute value .
17,572
public function setSoldIndividually ( string $ sold_individually = "T" ) : CNabuDataObject { if ( $ sold_individually === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$sold_individually" ) ) ; } $ this -> setValue ( 'nb_commerce_product_sold_individually' , $...
Sets the Commerce Product Sold Individually attribute value .
17,573
public function setIsVirtual ( string $ is_virtual = "F" ) : CNabuDataObject { if ( $ is_virtual === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$is_virtual" ) ) ; } $ this -> setValue ( 'nb_commerce_product_is_virtual' , $ is_virtual ) ; return $ this ; }
Sets the Commerce Product Is Virtual attribute value .
17,574
public function getCommerce ( $ force = false ) { if ( $ this -> nb_commerce === null || $ force ) { $ this -> nb_commerce = null ; if ( ! $ this -> isBuiltIn ( ) && $ this -> isValueNumeric ( NABU_COMMERCE_FIELD_ID ) ) { $ nb_commerce = new CNabuCommerce ( $ this -> getValue ( NABU_COMMERCE_FIELD_ID ) ) ; if ( $ nb_co...
Gets the Commerce instance that owns this object .
17,575
public function setCommerce ( CNabuCommerce $ nb_commerce ) { $ this -> nb_commerce = $ nb_commerce ; $ this -> transferValue ( $ nb_commerce , NABU_COMMERCE_FIELD_ID ) ; return $ this ; }
Sets the Commerce instance that onws this object .
17,576
public static function getProspectsForIContact ( $ nb_icontact , CNabuIContactProspectStatusType $ nb_status_type = null ) : CNabuIContactProspectList { if ( is_numeric ( $ nb_icontact_id = nb_getMixedValue ( $ nb_icontact , 'nb_icontact_id' ) ) ) { $ status_id = nb_getMixedValue ( $ nb_status_type , 'nb_icontact_prosp...
Get related Prospects of a User .
17,577
public static function getCountProspectsOfUser ( $ nb_icontact , $ nb_user , CNabuIContactProspectStatusType $ nb_status_type = null ) : int { if ( is_numeric ( $ nb_icontact_id = nb_getMixedValue ( $ nb_icontact , 'nb_icontact_id' ) ) && is_numeric ( $ nb_user_id = nb_getMixedValue ( $ nb_user , 'nb_user_id' ) ) ) { $...
Get the count of related Prospects of a User .
17,578
public static function encodeEmail ( string $ email ) : string { return md5 ( self :: EMAIL_PREF . preg_replace ( '/\\s/' , '' , mb_strtolower ( $ email ) ) . self :: EMAIL_SUFF ) ; }
Encodes a clear email using the nabu - 3 algorithm . This algorithm is not reversible .
17,579
public function setEmail ( string $ email = null ) : CNabuDataObject { parent :: setEmail ( $ email ) ; return parent :: setEmailHash ( is_string ( $ email ) ? self :: encodeEmail ( $ email ) : null ) ; }
Sets the Email and encoding it into a nabu - 3 hashing algorithm .
17,580
public static function findIContactProspectsByEmailHash ( CNabuIContact $ nb_icontact , string $ hash ) : CNabuIContactProspectList { if ( is_numeric ( $ nb_icontact_id = nb_getMixedValue ( $ nb_icontact , 'nb_icontact_id' ) ) && strlen ( $ hash ) === 32 ) { $ list = CNabuIContactProspect :: buildObjectListFromSQL ( 'n...
To find a list of Prospects related by the same Email hash .
17,581
public function getAttachments ( bool $ force = false ) : CNabuIContactProspectAttachmentList { if ( $ this -> nb_attachment_list -> isEmpty ( ) || $ force ) { $ this -> nb_attachment_list -> clear ( ) ; $ this -> nb_attachment_list -> merge ( CNabuIContactProspectAttachment :: getAttachmentsForProspect ( $ this ) ) ; ...
Get the list of all attachments associated with this instance .
17,582
public function addAttachment ( string $ name , string $ mimetype , string $ file , CNabuIContactProspectDiary $ nb_diary = null , bool $ save = true ) { if ( $ this -> isFetched ( ) ) { $ nb_icontact = $ this -> getIContact ( ) ; $ base_path = $ nb_icontact -> getBasePath ( ) ; $ retval = $ nb_attachment = new CNabuIC...
Add an Attachment file to this Prospect .
17,583
public function deleteAttachment ( $ nb_attachment ) : bool { $ retval = false ; $ nb_attachment_id = nb_getMixedValue ( $ nb_attachment , NABU_ICONTACT_PROSPECT_ATTACHMENT_FIELD_ID ) ; if ( is_numeric ( $ nb_attachment_id ) ) { $ nb_attachment = $ this -> nb_attachment_list -> getItem ( $ nb_attachment_id ) ; if ( $ n...
Delete an Attachment from the list if exists .
17,584
public function save ( $ trace = false ) { $ retval = parent :: save ( $ trace ) ; $ this -> nb_attachment_list -> iterate ( function ( $ key , CNabuIContactProspectAttachment $ nb_attachment ) use ( $ retval ) { $ retval |= $ nb_attachment -> save ( ) ; return true ; } ) ; return $ retval ; }
Overrides the parent method to save modified subordinated instances .
17,585
public function registerAnnotations ( ) { $ app = $ this -> app ; $ loader = new AnnotationLoader ( $ app [ 'files' ] , __DIR__ . '/../Annotations' ) ; $ loader -> registerAll ( ) ; }
Registers all annotation classes
17,586
public function setIsApi ( string $ is_api = "F" ) : CNabuDataObject { if ( $ is_api === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$is_api" ) ) ; } $ this -> setValue ( 'nb_language_is_api' , $ is_api ) ; return $ this ; }
Sets the Language Is Api attribute value .
17,587
public function setName ( string $ name ) : CNabuDataObject { if ( $ name === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$name" ) ) ; } $ this -> setValue ( 'nb_language_name' , $ name ) ; return $ this ; }
Sets the Language Name attribute value .
17,588
public static function hydrateCollection ( array $ summaries ) { $ hydrated = [ ] ; foreach ( $ summaries as $ summary ) { $ hydrated [ ] = self :: hydrate ( $ summary ) ; } return $ hydrated ; }
Hydrate a collection of summary objects into a collection of SummaryEntity objects
17,589
public static function hydrate ( stdClass $ summary ) { $ hydrated = new SummaryEntity ( ) ; if ( isset ( $ summary -> id ) ) { $ hydrated -> setId ( $ summary -> id ) ; } if ( isset ( $ summary -> line ) ) { $ hydrated -> setLine ( $ summary -> line ) ; } if ( isset ( $ summary -> content ) ) { $ hydrated -> setConten...
Hydrate a summary object into a SummaryEntity object
17,590
private function setRedirections ( SimpleXMLElement $ element ) { $ pages = $ element -> addChild ( 'redirections' ) ; $ this -> setRedirection ( $ pages , 'default' , 'default' ) ; $ this -> setRedirection ( $ pages , 'page_not_found' , 'pageNotFound' ) ; $ this -> setRedirection ( $ pages , 'login' , 'login' ) ; $ th...
Build redirection pointers for special cases .
17,591
private function setRedirection ( SimpleXMLElement $ element , string $ field , string $ tag_name ) { $ page = $ element -> addChild ( $ tag_name ) ; switch ( $ this -> nb_data_object -> getValue ( "nb_site_${field}_target_use_uri" ) ) { case 'T' : $ id = $ this -> nb_data_object -> getValue ( "nb_site_${field}_target_...
Build a redirection element .
17,592
private function setTargets ( SimpleXMLElement $ parent ) { $ xml_targets = new CNabuXMLSiteTargetList ( $ this -> nb_data_object -> getTargets ( true ) ) ; $ xml_targets -> build ( $ parent ) ; }
Build Target branch .
17,593
private function setMaps ( SimpleXMLElement $ parent ) { $ xml_targets = new CNabuXMLSiteMapList ( $ this -> nb_data_object -> getSiteMaps ( true ) ) ; $ xml_targets -> build ( $ parent ) ; }
Build Map branch .
17,594
private function setStaticContents ( SimpleXMLElement $ parent ) { $ xml_statics = new CNabuXMLSiteStaticContentList ( $ this -> nb_data_object -> getStaticContents ( true ) ) ; $ xml_statics -> build ( $ parent ) ; }
Build Static Content branch .
17,595
private function grantTargetHash ( int $ nb_site_target_id ) : string { $ nb_site_target = $ this -> nb_data_object -> getTarget ( $ nb_site_target_id ) ; return $ nb_site_target -> isFetched ( ) ? $ nb_site_target -> grantHash ( true ) : null ; }
Grant that a target have a valid hash to identify it .
17,596
public static function hydrateCollection ( array $ files ) { $ hydrated = [ ] ; foreach ( $ files as $ file ) { $ hydrated [ ] = self :: hydrate ( $ file ) ; } return $ hydrated ; }
Hydrate a collection of file objects into a collection of FileEntity objects
17,597
public static function hydrate ( stdClass $ file ) { $ hydrated = new FileEntity ( ) ; if ( isset ( $ file -> id ) ) { $ hydrated -> setId ( $ file -> id ) ; } if ( isset ( $ file -> loc ) ) { $ hydrated -> setLoc ( $ file -> loc ) ; } if ( isset ( $ file -> path ) ) { $ hydrated -> setPath ( $ file -> path ) ; } if ( ...
Hydrate a file object into a FileEntity object
17,598
public function addTarget ( CNabuSiteTarget $ nb_site_target , $ default = false ) { $ nb_site_target -> setSite ( $ this ) ; if ( $ default ) { $ this -> setDefaultTarget ( $ nb_site_target ) ; } return $ this -> nb_site_target_list -> addItem ( $ nb_site_target ) ; }
Add a target to a site .
17,599
public function getTarget ( $ nb_site_target ) { $ nb_site_target_id = nb_getMixedValue ( $ nb_site_target , 'nb_site_target_id' ) ; return ( is_numeric ( $ nb_site_target_id ) || nb_isValidGUID ( $ nb_site_target_id ) ) ? $ this -> nb_site_target_list -> getItem ( $ nb_site_target_id ) -> setSite ( $ this ) : null ; }
Gets a Target item from the list of targets loaded in the Site .