idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
17,300 | public function compile ( $ stub , $ modelName , $ modelData , stdClass $ scaffolderConfig , $ hash , ScaffolderThemeExtensionInterface $ themeExtension , array $ extensions , $ extra = null ) { $ this -> stub = $ stub ; return $ this -> store ( null , $ scaffolderConfig , $ themeExtension -> runAfterEditLayoutIsCompiled ( $ this -> stub , $ scaffolderConfig ) , new FileToCompile ( null , null ) ) ; } | Compiles the edit layout . |
17,301 | public function populate ( int $ deep = 0 ) { $ nb_catalog = $ this -> getCatalog ( ) ; $ this -> clear ( ) ; $ this -> merge ( CNabuCatalogItem :: getItemsForCatalog ( $ nb_catalog , $ deep ) ) ; $ translations = CNabuCatalogItem :: getItemTranslationsForCatalog ( $ nb_catalog , $ deep ) ; $ translations -> iterate ( function ( $ key , $ translation ) { $ item = $ this -> getItem ( $ translation -> getCatalogItemId ( ) ) ; if ( $ item instanceof INabuTranslated ) { $ item -> setTranslation ( $ translation ) ; } return true ; } ) ; } | Populates the catalog with all Items . |
17,302 | public function getDescriptor ( $ force = false ) { if ( ! ( $ this -> storage_descriptor instanceof INabuDBDescriptor ) || $ force ) { $ this -> storage_descriptor = null ; $ this -> storage_descriptor = $ this -> db -> getDescriptorFromFile ( $ this -> getStorageDescriptorPath ( ) ) ; } return $ this -> storage_descriptor ; } | Gets the Storage Descriptor . When calls this method the first time an internal INabuDBDescriptor object is created and returned next times . |
17,303 | public function refresh ( bool $ force = false , bool $ cascade = false ) : bool { $ this -> relinkDB ( ) ; return $ this -> load ( ) ; } | Refresh data from the database storage . |
17,304 | public static function findByKey ( $ nb_site , $ key ) { $ nb_site_id = nb_getMixedValue ( $ nb_site , 'nb_site_id' ) ; if ( is_numeric ( $ nb_site_id ) ) { $ retval = CNabuSiteTarget :: buildObjectFromSQL ( 'select * ' . 'from nb_site_target ' . 'where nb_site_id=%site_id$d ' . "and nb_site_target_key='%key\$s'" , array ( 'site_id' => $ nb_site_id , 'key' => $ key ) ) ; } else { $ retval = null ; } return $ retval ; } | Find an instance identified by nb_site_target_key field . |
17,305 | public static function getAllSiteTargets ( CNabuSite $ nb_site ) { $ nb_site_id = nb_getMixedValue ( $ nb_site , 'nb_site_id' ) ; if ( is_numeric ( $ nb_site_id ) ) { $ retval = forward_static_call ( array ( get_called_class ( ) , 'buildObjectListFromSQL' ) , 'nb_site_target_id' , 'select * ' . 'from nb_site_target ' . 'where nb_site_id=%site_id$d' , array ( 'site_id' => $ nb_site_id ) , $ nb_site ) ; } else { $ retval = new CNabuSiteTargetList ( ) ; } return $ retval ; } | Get all items in the storage as an associative array where the field nb_site_target_id is the index and each value is an instance of class CNabuSiteTargetBase . |
17,306 | public function setUseHTTP ( string $ use_http = "F" ) : CNabuDataObject { if ( $ use_http === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$use_http" ) ) ; } $ this -> setValue ( 'nb_site_target_use_http' , $ use_http ) ; return $ this ; } | Sets the Site Target Use HTTP attribute value . |
17,307 | public function setUseHTTPS ( string $ use_https = "F" ) : CNabuDataObject { if ( $ use_https === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$use_https" ) ) ; } $ this -> setValue ( 'nb_site_target_use_https' , $ use_https ) ; return $ this ; } | Sets the Site Target Use HTTPS attribute value . |
17,308 | public function setAttachment ( string $ attachment = "F" ) : CNabuDataObject { if ( $ attachment === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$attachment" ) ) ; } $ this -> setValue ( 'nb_site_target_attachment' , $ attachment ) ; return $ this ; } | Sets the Site Target Attachment attribute value . |
17,309 | public function setSmartyDebugging ( string $ smarty_debugging = "F" ) : CNabuDataObject { if ( $ smarty_debugging === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$smarty_debugging" ) ) ; } $ this -> setValue ( 'nb_site_target_smarty_debugging' , $ smarty_debugging ) ; return $ this ; } | Sets the Site Target Smarty Debugging attribute value . |
17,310 | public function setPHPTrace ( string $ php_trace = "F" ) : CNabuDataObject { if ( $ php_trace === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$php_trace" ) ) ; } $ this -> setValue ( 'nb_site_target_php_trace' , $ php_trace ) ; return $ this ; } | Sets the Site Target PHP Trace attribute value . |
17,311 | public function setIgnorePolicies ( string $ ignore_policies = "F" ) : CNabuDataObject { if ( $ ignore_policies === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$ignore_policies" ) ) ; } $ this -> setValue ( 'nb_site_target_ignore_policies' , $ ignore_policies ) ; return $ this ; } | Sets the Site Target Ignore Policies attribute value . |
17,312 | public function setUseCommerce ( string $ use_commerce = "F" ) : CNabuDataObject { if ( $ use_commerce === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$use_commerce" ) ) ; } $ this -> setValue ( 'nb_site_target_use_commerce' , $ use_commerce ) ; return $ this ; } | Sets the Site Target Use Commerce attribute value . |
17,313 | public function setUseApps ( string $ use_apps = "F" ) : CNabuDataObject { if ( $ use_apps === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$use_apps" ) ) ; } $ this -> setValue ( 'nb_site_target_use_apps' , $ use_apps ) ; return $ this ; } | Sets the Site Target Use Apps attribute value . |
17,314 | public function setDynamicCacheControl ( string $ dynamic_cache_control = "S" ) : CNabuDataObject { if ( $ dynamic_cache_control === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$dynamic_cache_control" ) ) ; } $ this -> setValue ( 'nb_site_target_dynamic_cache_control' , $ dynamic_cache_control ) ; return $ this ; } | Sets the Site Target Dynamic Cache Control attribute value . |
17,315 | public function getActiveServices ( bool $ force = false ) : CNabuMessagingServiceList { if ( $ this -> nb_messaging_service_list -> isEmpty ( ) || $ force ) { $ this -> nb_messaging_service_list -> clear ( ) ; if ( ( $ nb_messaging = $ this -> getMessaging ( ) ) instanceof CNabuMessaging && ! ( $ nb_services_list = $ nb_messaging -> getActiveServices ( ) ) -> isEmpty ( ) ) { $ nb_services_list -> iterate ( function ( $ key , CNabuMessagingService $ nb_service ) { if ( $ nb_service -> isTemplateConnected ( $ this -> getId ( ) ) ) { $ this -> nb_messaging_service_list -> addItem ( $ nb_service ) ; } return true ; } ) ; } } return $ this -> nb_messaging_service_list ; } | Get the list of active Service instances connected to this Template . |
17,316 | public static function getAllMessagingServiceStacks ( CNabuMessaging $ nb_messaging ) { $ nb_messaging_id = nb_getMixedValue ( $ nb_messaging , 'nb_messaging_id' ) ; if ( is_numeric ( $ nb_messaging_id ) ) { $ retval = forward_static_call ( array ( get_called_class ( ) , 'buildObjectListFromSQL' ) , 'nb_messaging_service_stack_id' , 'select * ' . 'from nb_messaging_service_stack ' . 'where nb_messaging_id=%messaging_id$d' , array ( 'messaging_id' => $ nb_messaging_id ) , $ nb_messaging ) ; } else { $ retval = new CNabuMessagingServiceStackList ( ) ; } return $ retval ; } | Get all items in the storage as an associative array where the field nb_messaging_service_stack_id is the index and each value is an instance of class CNabuMessagingServiceStackBase . |
17,317 | public function setMessagingId ( int $ nb_messaging_id ) : CNabuDataObject { if ( $ nb_messaging_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_messaging_id" ) ) ; } $ this -> setValue ( 'nb_messaging_id' , $ nb_messaging_id ) ; return $ this ; } | Sets the Messaging Id attribute value . |
17,318 | public function setMessagingServiceId ( int $ nb_messaging_service_id ) : CNabuDataObject { if ( $ nb_messaging_service_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_messaging_service_id" ) ) ; } $ this -> setValue ( 'nb_messaging_service_id' , $ nb_messaging_service_id ) ; return $ this ; } | Sets the Messaging Service Id attribute value . |
17,319 | public function setMessagingTemplateId ( int $ nb_messaging_template_id ) : CNabuDataObject { if ( $ nb_messaging_template_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_messaging_template_id" ) ) ; } $ this -> setValue ( 'nb_messaging_template_id' , $ nb_messaging_template_id ) ; return $ this ; } | Sets the Messaging Template Id attribute value . |
17,320 | public static function getAllProjectVersions ( CNabuProject $ nb_project ) { $ nb_project_id = nb_getMixedValue ( $ nb_project , 'nb_project_id' ) ; if ( is_numeric ( $ nb_project_id ) ) { $ retval = forward_static_call ( array ( get_called_class ( ) , 'buildObjectListFromSQL' ) , 'nb_project_version_id' , 'select * ' . 'from nb_project_version ' . 'where nb_project_id=%project_id$d' , array ( 'project_id' => $ nb_project_id ) , $ nb_project ) ; } else { $ retval = new CNabuProjectVersionList ( ) ; } return $ retval ; } | Get all items in the storage as an associative array where the field nb_project_version_id is the index and each value is an instance of class CNabuProjectVersionBase . |
17,321 | public static function getFilteredProjectVersionList ( $ nb_project = null , $ q = null , $ fields = null , $ order = null , $ offset = 0 , $ num_items = 0 ) { $ nb_project_id = nb_getMixedValue ( $ nb_customer , NABU_PROJECT_FIELD_ID ) ; if ( is_numeric ( $ nb_project_id ) ) { $ fields_part = nb_prefixFieldList ( CNabuProjectVersionBase :: getStorageName ( ) , $ fields , false , true , '`' ) ; $ order_part = nb_prefixFieldList ( CNabuProjectVersionBase :: getStorageName ( ) , $ fields , false , false , '`' ) ; if ( $ num_items !== 0 ) { $ limit_part = ( $ offset > 0 ? $ offset . ', ' : '' ) . $ num_items ; } else { $ limit_part = false ; } $ nb_item_list = CNabuEngine :: getEngine ( ) -> getMainDB ( ) -> getQueryAsArray ( "select " . ( $ fields_part ? $ fields_part . ' ' : '* ' ) . 'from nb_project_version ' . 'where ' . NABU_PROJECT_FIELD_ID . '=%project_id$d ' . ( $ order_part ? "order by $order_part " : '' ) . ( $ limit_part ? "limit $limit_part" : '' ) , array ( 'project_id' => $ nb_project_id ) ) ; } else { $ nb_item_list = null ; } return $ nb_item_list ; } | Gets a filtered list of Project Version 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,322 | public function setProjectId ( int $ nb_project_id ) : CNabuDataObject { if ( $ nb_project_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_project_id" ) ) ; } $ this -> setValue ( 'nb_project_id' , $ nb_project_id ) ; return $ this ; } | Sets the Project Id attribute value . |
17,323 | public static function hydrateCollection ( array $ logs ) { $ hydrated = [ ] ; foreach ( $ logs as $ log ) { $ hydrated [ ] = self :: hydrate ( $ log ) ; } return $ hydrated ; } | Hydrate a collection of log objects into a collection of LogEntity objects |
17,324 | public static function hydrate ( stdClass $ log ) { $ hydrated = new LogEntity ( ) ; if ( isset ( $ log -> id ) ) { $ hydrated -> setId ( $ log -> id ) ; } if ( isset ( $ log -> text ) ) { $ hydrated -> setText ( $ log -> text ) ; } if ( isset ( $ log -> level ) ) { $ hydrated -> setLevel ( $ log -> level ) ; } if ( isset ( $ log -> channel ) ) { $ hydrated -> setChannel ( $ log -> channel ) ; } if ( isset ( $ log -> request_uri ) ) { $ hydrated -> setRequestUri ( $ log -> request_uri ) ; } if ( isset ( $ log -> request_method ) ) { $ hydrated -> setRequestMethod ( $ log -> request_method ) ; } if ( isset ( $ log -> ip ) ) { $ hydrated -> setIp ( $ log -> ip ) ; } if ( isset ( $ log -> created_by ) ) { $ hydrated -> setCreatedBy ( UserHydrator :: hydrate ( $ log -> created_by ) ) ; } if ( isset ( $ log -> email ) ) { $ hydrated -> setEmail ( $ log -> email ) ; } if ( isset ( $ log -> organization ) ) { $ hydrated -> setOrganization ( OrgHydrator :: hydrate ( $ log -> organization ) ) ; } if ( isset ( $ log -> organization_name ) ) { $ hydrated -> setOrganizationName ( $ log -> organization_name ) ; } if ( isset ( $ log -> context ) ) { $ hydrated -> setContext ( $ log -> context ) ; } if ( isset ( $ log -> created_at ) ) { $ hydrated -> setCreatedAt ( new DateTime ( $ log -> created_at ) ) ; } if ( isset ( $ log -> user_agent ) ) { $ hydrated -> setUserAgent ( $ log -> user_agent ) ; } return $ hydrated ; } | Hydrate a log object into a LogEntity object |
17,325 | public static function hydrateCollection ( array $ parts ) { $ hydrated = [ ] ; foreach ( $ parts as $ part ) { $ hydrated [ ] = self :: hydrate ( $ part ) ; } return $ hydrated ; } | Hydrate a collection of part objects into a collection of PartEntity objects |
17,326 | public static function hydrate ( stdClass $ part ) { $ hydrated = new PartEntity ( ) ; if ( isset ( $ part -> id ) ) { $ hydrated -> setId ( $ part -> id ) ; } if ( isset ( $ part -> type ) ) { $ hydrated -> setType ( $ part -> type ) ; } if ( isset ( $ part -> content ) ) { $ hydrated -> setContent ( $ part -> content ) ; } return $ hydrated ; } | Hydrate a part object into a PartEntity object |
17,327 | public function insert ( $ entity ) { $ eloquentModel = $ this -> getEloquentModel ( $ entity ) ; $ this -> updateRelations ( $ eloquentModel , 'insert' ) ; $ eloquentModel -> save ( ) ; $ eloquentModel -> afterSaving ( $ entity , 'insert' ) ; } | Create an entity object . |
17,328 | public function update ( $ entity ) { $ eloquentModel = $ this -> getEloquentModel ( $ entity , true ) ; $ this -> updateRelations ( $ eloquentModel , 'update' ) ; $ eloquentModel -> save ( ) ; $ eloquentModel -> afterSaving ( $ entity , 'update' ) ; } | Update an entity object . |
17,329 | protected function updateRelations ( $ eloquentModel , $ action ) { $ mapping = $ eloquentModel -> getMapping ( ) ; $ eloquentRelations = $ eloquentModel -> getRelations ( ) ; foreach ( $ mapping [ 'relations' ] as $ name => $ relationMapping ) { if ( isset ( $ eloquentRelations [ $ name ] ) ) { $ this -> updateRelation ( $ eloquentModel , $ name , $ relationMapping , $ action ) ; } } } | Update relations . |
17,330 | protected function updateRelation ( $ eloquentModel , $ name , $ relationMapping , $ action ) { if ( $ relationMapping [ 'type' ] == 'belongsTo' || $ relationMapping [ 'type' ] == 'morphTo' ) { $ this -> updateBelongsToRelation ( $ eloquentModel , $ name , $ action ) ; } if ( ( $ relationMapping [ 'type' ] == 'belongsToMany' || $ relationMapping [ 'type' ] == 'morphToMany' ) && ! $ relationMapping [ 'inverse' ] ) { $ this -> updateBelongsToManyRelation ( $ eloquentModel , $ name , $ action ) ; } } | Update a relation . |
17,331 | protected function updateBelongsToRelation ( $ eloquentModel , $ name , $ action ) { if ( $ action == 'insert' || $ action == 'update' ) { $ eloquentModel -> { $ name } ( ) -> associate ( $ eloquentModel -> getRelation ( $ name ) ) ; } } | Update a belongsTo or morphTo relation . |
17,332 | protected function updateBelongsToManyRelation ( $ eloquentModel , $ name , $ action ) { $ eloquentCollection = $ eloquentModel -> getRelation ( $ name ) ; if ( ! $ eloquentCollection instanceof \ Illuminate \ Database \ Eloquent \ Collection ) { throw new Exception ( "Many-to-many relation '" . $ name . "' is not a valid collection" ) ; } $ keys = [ ] ; foreach ( $ eloquentCollection as $ item ) { $ keys [ ] = $ item -> getKey ( ) ; } if ( $ action == 'insert' ) { $ eloquentModel -> { $ name } ( ) -> attach ( $ keys ) ; } if ( $ action == 'update' ) { $ eloquentModel -> { $ name } ( ) -> sync ( $ keys ) ; } if ( $ action == 'delete' ) { $ eloquentModel -> { $ name } ( ) -> detach ( $ keys ) ; } } | Update a belongsToMany or morphToMany relation . |
17,333 | public function getAll ( $ appId , $ scanId , $ issueId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> issues ( ) -> contexts ( ) -> getAll ( $ appId , $ scanId , $ issueId , $ queryParams ) ; return new ContextsResponse ( $ response ) ; } | Get all contexts for an issue |
17,334 | public function getById ( $ appId , $ scanId , $ issueId , $ contextId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> issues ( ) -> contexts ( ) -> getById ( $ appId , $ scanId , $ issueId , $ contextId , $ queryParams ) ; return new ContextResponse ( $ response ) ; } | Get context for an issue by id |
17,335 | protected function getResults ( $ method ) { if ( $ this -> schema ) { if ( isset ( $ this -> constraints [ $ this -> root ] ) ) { $ this -> constraints [ $ this -> root ] ( $ this -> eloquentQuery ) ; } $ this -> eloquentQuery -> setEagerLoads ( $ this -> parseRelationsFromSchema ( $ this -> schema , '' ) ) ; $ results = $ this -> eloquentQuery -> $ method ( ) ; if ( $ results ) { $ dtos = $ results -> toDataTransferObject ( $ this -> root , $ this -> schema , $ this -> transformations ) ; return [ $ this -> root => $ dtos ] ; } } return null ; } | Prepare query for execution . |
17,336 | protected function parseRelationsFromSchema ( array $ schema , $ path = '' ) { $ results = [ ] ; foreach ( $ schema as $ key => $ value ) { if ( ! is_numeric ( $ key ) ) { if ( substr ( $ key , 0 , 3 ) != '...' ) { $ childPath = ( $ path ) ? $ path . '.' . $ key : $ key ; $ results [ $ childPath ] = ( isset ( $ this -> constraints [ $ this -> root . '.' . $ childPath ] ) ) ? $ this -> constraints [ $ this -> root . '.' . $ childPath ] : function ( ) { } ; } else { $ childPath = $ path ; } $ results = array_merge ( $ results , $ this -> parseRelationsFromSchema ( $ value , $ childPath ) ) ; } } return $ results ; } | Parse relations from schema . |
17,337 | public function schema ( array $ schema ) { $ this -> root = key ( $ schema ) ; $ this -> schema = current ( $ schema ) ; return $ this ; } | Set the schema . |
17,338 | public static function hydrateCollection ( array $ resources ) { $ hydrated = [ ] ; foreach ( $ resources as $ resource ) { $ hydrated [ ] = self :: hydrate ( $ resource ) ; } return $ hydrated ; } | Hydrate a collection of resource objects into a collection of ResourceEntity objects |
17,339 | public static function hydrate ( stdClass $ resource ) { $ hydrated = new ResourceEntity ( ) ; if ( isset ( $ resource -> id ) ) { $ hydrated -> setId ( $ resource -> id ) ; } if ( isset ( $ resource -> title ) ) { $ hydrated -> setTitle ( $ resource -> title ) ; } if ( isset ( $ resource -> author ) ) { $ hydrated -> setAuthor ( $ resource -> author ) ; } if ( isset ( $ resource -> url ) ) { $ hydrated -> setUrl ( $ resource -> url ) ; } if ( isset ( $ resource -> published_at ) ) { $ hydrated -> setPublishedAt ( new DateTime ( $ resource -> published_at ) ) ; } if ( isset ( $ resource -> languages ) && is_array ( $ resource -> languages ) ) { $ hydrated -> setLanguages ( LanguageHydrator :: hydrateCollection ( $ resource -> languages ) ) ; } return $ hydrated ; } | Hydrate a resource object into a ResourceEntity object |
17,340 | public static function getAllSiteAliass ( CNabuSite $ nb_site ) { $ nb_site_id = nb_getMixedValue ( $ nb_site , 'nb_site_id' ) ; if ( is_numeric ( $ nb_site_id ) ) { $ retval = forward_static_call ( array ( get_called_class ( ) , 'buildObjectListFromSQL' ) , 'nb_site_alias_id' , 'select * ' . 'from nb_site_alias ' . 'where nb_site_id=%site_id$d' , array ( 'site_id' => $ nb_site_id ) , $ nb_site ) ; } else { $ retval = new CNabuSiteAliasList ( ) ; } return $ retval ; } | Get all items in the storage as an associative array where the field nb_site_alias_id is the index and each value is an instance of class CNabuSiteAliasBase . |
17,341 | public function setDomainZoneHostId ( int $ nb_domain_zone_host_id ) : CNabuDataObject { if ( $ nb_domain_zone_host_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_domain_zone_host_id" ) ) ; } $ this -> setValue ( 'nb_domain_zone_host_id' , $ nb_domain_zone_host_id ) ; return $ this ; } | Sets the Domain Zone Host Id attribute value . |
17,342 | public function setType ( string $ type = "F" ) : CNabuDataObject { if ( $ type === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$type" ) ) ; } $ this -> setValue ( 'nb_site_alias_type' , $ type ) ; return $ this ; } | Sets the Site Alias Type attribute value . |
17,343 | public static function hydrateCollection ( array $ types ) { $ hydrated = [ ] ; foreach ( $ types as $ type ) { $ hydrated [ ] = self :: hydrate ( $ type ) ; } return $ hydrated ; } | Hydrate a collection of type objects into a collection of TypeEntity objects |
17,344 | public function setVRId ( string $ vr_id ) : CNabuDataObject { if ( $ vr_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$vr_id" ) ) ; } $ this -> setValue ( 'nb_site_visual_editor_item_vr_id' , $ vr_id ) ; return $ this ; } | Sets the Site Visual Editor Item VR Id attribute value . |
17,345 | public function toDatamapperObject ( ) { if ( is_subclass_of ( $ this -> class , '\ProAI\Datamapper\Support\Entity' ) ) { $ class = $ this -> class ; return $ class :: newFromEloquentObject ( $ this ) ; } $ reflectionClass = new ReflectionClass ( $ this -> class ) ; $ entity = $ reflectionClass -> newInstanceWithoutConstructor ( ) ; foreach ( $ this -> mapping [ 'attributes' ] as $ attribute => $ column ) { $ this -> setProperty ( $ reflectionClass , $ entity , $ attribute , $ this -> attributes [ $ column ] ) ; } foreach ( $ this -> mapping [ 'embeddeds' ] as $ name => $ embedded ) { $ embeddedReflectionClass = new ReflectionClass ( $ embedded [ 'class' ] ) ; $ embeddedObject = $ embeddedReflectionClass -> newInstanceWithoutConstructor ( ) ; foreach ( $ embedded [ 'attributes' ] as $ attribute => $ column ) { $ this -> setProperty ( $ embeddedReflectionClass , $ embeddedObject , $ attribute , $ this -> attributes [ $ column ] ) ; } $ this -> setProperty ( $ reflectionClass , $ entity , $ name , $ embeddedObject ) ; } foreach ( $ this -> mapping [ 'relations' ] as $ name => $ relation ) { if ( ! empty ( $ this -> relations [ $ name ] ) ) { $ relationObject = $ this -> relations [ $ name ] -> toDatamapperObject ( ) ; } elseif ( in_array ( $ relation [ 'type' ] , $ this -> manyRelations ) ) { $ relationObject = new ProxyCollection ; } else { $ relationObject = new Proxy ; } $ this -> setProperty ( $ reflectionClass , $ entity , $ name , $ relationObject ) ; } return $ entity ; } | Convert model to entity object . |
17,346 | protected function setProperty ( & $ reflectionClass , $ entity , $ name , $ value ) { $ property = $ reflectionClass -> getProperty ( $ name ) ; $ property -> setAccessible ( true ) ; $ property -> setValue ( $ entity , $ value ) ; } | Set a private property of an entity . |
17,347 | public function toDataTransferObject ( $ root , $ schema , $ transformations , $ path = '' ) { $ dto = new DataTransferObject ( ) ; if ( $ this -> morphClass ) { $ morphKey = '...' . Str :: studly ( $ this -> morphClass ) ; if ( isset ( $ schema [ $ morphKey ] ) ) { $ schema = $ schema [ $ morphKey ] ; } } foreach ( $ schema as $ key => $ value ) { if ( is_numeric ( $ key ) ) { $ transformationKey = ( $ path ) ? $ root . '.' . $ path . '.' . $ value : $ root . '.' . $ value ; if ( $ value == '__type' ) { $ dto -> { $ value } = class_basename ( $ this -> class ) ; } elseif ( isset ( $ transformations [ $ transformationKey ] ) ) { $ node = new GraphNode ; $ transformations [ $ transformationKey ] ( $ node , $ this -> attributes ) ; $ dto -> { $ value } = $ node -> getValue ( ) ; } elseif ( isset ( $ transformations [ '*.' . $ value ] ) ) { $ node = new GraphNode ; $ transformations [ '*.' . $ value ] ( $ node , $ this -> attributes ) ; $ dto -> { $ value } = $ node -> getValue ( ) ; } else { $ columnName = $ this -> getColumnName ( $ value ) ; if ( isset ( $ this -> attributes [ $ columnName ] ) ) { $ dto -> { $ value } = $ this -> attributes [ $ columnName ] ; } } } if ( ! is_numeric ( $ key ) && isset ( $ this -> relations [ $ key ] ) ) { $ newPath = ( $ path ) ? $ path . '.' . $ key : $ key ; $ dto -> { $ key } = $ this -> relations [ $ key ] -> toDataTransferObject ( $ root , $ value , $ transformations , $ newPath ) ; } } return $ dto ; } | Convert model to data transfer object . |
17,348 | public static function newFromDatamapperObject ( EntityContract $ entity , $ lastObjectId = null , $ lastEloquentModel = null ) { if ( $ entity instanceof \ ProAI \ Datamapper \ Support \ Entity ) { return $ entity -> toEloquentObject ( $ lastObjectId , $ lastEloquentModel ) ; } $ class = get_mapped_model ( get_class ( $ entity ) ) ; $ eloquentModel = new $ class ; $ reflectionObject = new ReflectionObject ( $ entity ) ; $ mapping = $ eloquentModel -> getMapping ( ) ; foreach ( $ mapping [ 'attributes' ] as $ attribute => $ column ) { if ( ! $ eloquentModel -> isAutomaticallyUpdatedDate ( $ column ) ) { $ property = $ eloquentModel -> getProperty ( $ reflectionObject , $ entity , $ attribute ) ; $ eloquentModel -> setAttribute ( $ column , $ property ) ; } } foreach ( $ mapping [ 'embeddeds' ] as $ name => $ embedded ) { $ embeddedObject = $ eloquentModel -> getProperty ( $ reflectionObject , $ entity , $ name ) ; if ( ! empty ( $ embeddedObject ) ) { $ embeddedReflectionObject = new ReflectionObject ( $ embeddedObject ) ; foreach ( $ embedded [ 'attributes' ] as $ attribute => $ column ) { $ property = $ eloquentModel -> getProperty ( $ embeddedReflectionObject , $ embeddedObject , $ attribute ) ; $ eloquentModel -> setAttribute ( $ column , $ property ) ; } } } foreach ( $ mapping [ 'relations' ] as $ name => $ relation ) { $ relationObject = $ eloquentModel -> getProperty ( $ reflectionObject , $ entity , $ name ) ; if ( ! empty ( $ relationObject ) && ! $ relationObject instanceof \ ProAI \ Datamapper \ Contracts \ Proxy ) { if ( $ relationObject instanceof \ ProAI \ Datamapper \ Support \ Collection ) { $ value = EloquentCollection :: newFromDatamapperObject ( $ relationObject , $ this , $ eloquentModel ) ; } elseif ( spl_object_hash ( $ relationObject ) == $ lastObjectId ) { $ value = $ lastEloquentModel ; } else { $ value = EloquentModel :: newFromDatamapperObject ( $ relationObject , spl_object_hash ( $ this ) , $ eloquentModel ) ; } $ eloquentModel -> setRelation ( $ name , $ value ) ; } } return $ eloquentModel ; } | Convert model to plain old php object . |
17,349 | public function isAutomaticallyUpdatedDate ( $ attribute ) { if ( in_array ( 'Illuminate\Database\Eloquent\SoftDeletes' , class_uses ( static :: class ) ) && $ attribute == $ this -> getDeletedAtColumn ( ) ) { return true ; } if ( $ this -> timestamps && ( $ attribute == $ this -> getCreatedAtColumn ( ) || $ attribute == $ this -> getUpdatedAtColumn ( ) ) ) { return true ; } return false ; } | Check if attribute is auto generated and updated date . |
17,350 | protected function getProperty ( $ reflectionObject , $ entity , $ name ) { $ property = $ reflectionObject -> getProperty ( $ name ) ; $ property -> setAccessible ( true ) ; return $ property -> getValue ( $ entity ) ; } | Get a private property of an entity . |
17,351 | protected function getColumnName ( $ name ) { if ( isset ( $ this -> mapping [ 'attributes' ] [ $ name ] ) ) { return $ this -> mapping [ 'attributes' ] [ $ name ] ; } foreach ( $ this -> mapping [ 'embeddeds' ] as $ embedded ) { if ( isset ( $ embedded [ 'attributes' ] [ $ name ] ) ) { return $ embedded [ 'attributes' ] [ $ name ] ; } if ( $ embedded [ 'columnPrefix' ] && strpos ( $ name , $ embedded [ 'columnPrefix' ] ) === 0 ) { $ embeddedName = substr ( $ name , strlen ( $ embedded [ 'columnPrefix' ] ) ) ; if ( isset ( $ embedded [ 'attributes' ] [ $ embeddedName ] ) ) { return $ embedded [ 'attributes' ] [ $ embeddedName ] ; } } } } | Get column name of a schema name . |
17,352 | public function getMedioteca ( $ nb_medioteca ) { $ nb_medioteca_id = nb_getMixedValue ( $ nb_medioteca , NABU_MEDIOTECA_FIELD_ID ) ; return is_numeric ( $ nb_medioteca_id ) || nb_isValidGUID ( $ nb_medioteca_id ) ? $ this -> nb_medioteca_list -> getItem ( $ nb_medioteca_id ) : false ; } | Gets a Medioteca Instance . |
17,353 | public function getMediotecas ( $ force = false ) { if ( $ this -> nb_medioteca_list -> isEmpty ( ) || $ force ) { $ this -> nb_medioteca_list -> merge ( CNabuMedioteca :: getMediotecasForCustomer ( CNabuEngine :: getEngine ( ) -> getCustomer ( ) ) ) ; } return $ this -> nb_medioteca_list ; } | Gets the collection of Mediotecas |
17,354 | public function getLanguage ( $ nb_language ) { $ retval = false ; $ nb_language_id = nb_getMixedValue ( $ nb_language , NABU_LANG_FIELD_ID ) ; if ( is_numeric ( $ nb_language_id ) || nb_isValidGUID ( $ nb_language_id ) ) { $ this -> getLanguages ( ) ; if ( $ this -> languages_list -> containsKey ( $ nb_language_id ) ) { $ retval = $ this -> languages_list -> getItem ( $ nb_language_id ) ; } } return $ retval ; } | Gets the language object owned by this object that represents a language entity allowed for them |
17,355 | public function setLanguage ( CNabuLanguage $ nb_language ) { if ( $ nb_language -> isValueNumeric ( NABU_LANG_FIELD_ID ) || $ nb_language -> isValueGUID ( NABU_LANG_FIELD_ID ) ) { $ nb_language_id = $ nb_language -> getValue ( NABU_LANG_FIELD_ID ) ; $ this -> languages_list -> addItem ( $ nb_language ) ; } } | Add or replace a language object passed as parameter in the languages collection of this entity |
17,356 | public function getTranslation ( $ nb_language ) { $ retval = false ; $ nb_language_id = nb_getMixedValue ( $ nb_language , NABU_LANG_FIELD_ID ) ; if ( is_numeric ( $ nb_language_id ) || nb_isValidGUID ( $ nb_language_id ) ) { $ this -> getTranslations ( ) ; if ( $ this -> translations_list -> containsKey ( $ nb_language_id ) ) { $ retval = $ this -> translations_list -> getItem ( $ nb_language_id ) ; } } return $ retval ; } | Get the translation child object that represents the translated fields of this entity |
17,357 | public function hasTranslations ( bool $ force = false ) { $ this -> getTranslations ( $ force ) ; return $ this -> translations_list -> isFilled ( ) ; } | Check if the instance have at least one item in the translations collection . |
17,358 | public function setTranslation ( INabuTranslation $ nb_translation ) { if ( $ this -> checkForValidTranslationInstance ( $ nb_translation ) && ( $ nb_translation -> isValueNumeric ( NABU_LANG_FIELD_ID ) || $ nb_translation -> isValueGUID ( NABU_LANG_FIELD_ID ) ) ) { $ nb_translation -> setTranslatedObject ( $ this ) ; $ nb_language_id = $ nb_translation -> getValue ( NABU_LANG_FIELD_ID ) ; $ this -> translations_list -> addItem ( $ nb_translation ) ; if ( $ this -> translations_removed -> containsKey ( $ nb_language_id ) ) { $ this -> translations_removed -> removeItem ( $ nb_language_id ) ; } } return $ nb_translation ; } | Add or replace a translation child object that represents the translated fields of this entity |
17,359 | public function removeTranslation ( $ nb_translation ) { if ( $ this -> checkForValidTranslationInstance ( $ nb_translation ) && ( $ nb_translation -> isValueNumeric ( NABU_LANG_FIELD_ID ) || $ nb_translation -> isValueGUID ( NABU_LANG_FIELD_ID ) ) ) { $ nb_language_id = $ nb_translation -> getValue ( NABU_LANG_FIELD_ID ) ; $ this -> translations_removed -> addItem ( $ nb_translation ) ; if ( $ this -> translations_list -> containsKey ( $ nb_language_id ) ) { $ this -> translations_list -> removeItem ( $ nb_translation ) ; } } } | Remove a translation child object from the internal list of this entity . If after this action you calls updateTranslations method then it call the delete method to remove definitely this translation from the database |
17,360 | protected function getClasses ( ) { $ class = $ this -> argument ( 'class' ) ; if ( $ class ) { if ( class_exists ( $ class ) ) { $ classes = [ $ class ] ; } elseif ( class_exists ( $ this -> config [ 'models_namespace' ] . '\\' . $ class ) ) { $ classes = [ $ this -> config [ 'models_namespace' ] . '\\' . $ class ] ; } else { throw new UnexpectedValueException ( 'Classname is not valid.' ) ; } } else { $ classes = $ this -> finder -> getClassesFromNamespace ( $ this -> config [ 'models_namespace' ] ) ; } return $ classes ; } | Get classes by class argument or by app namespace . |
17,361 | protected function outputQueries ( $ statements ) { $ this -> info ( PHP_EOL . 'Outputting queries:' ) ; if ( empty ( $ statements ) ) { $ this -> info ( "No queries found." ) ; } else { $ this -> info ( implode ( ';' . PHP_EOL , $ statements ) ) ; } } | Output SQL queries . |
17,362 | protected function dumpFile ( string $ filename ) { if ( strlen ( $ filename ) > 0 && file_exists ( $ filename ) && is_file ( $ filename ) ) { echo file_get_contents ( $ filename ) ; return true ; } return false ; } | Basic functionality to dump a file to the output stream . |
17,363 | public function registerAll ( ) { foreach ( $ this -> files -> allFiles ( $ this -> path ) as $ file ) { AnnotationRegistry :: registerFile ( $ file -> getRealPath ( ) ) ; } } | Register all annotations . |
17,364 | public function populate ( int $ deep = 0 ) { $ nb_site = $ this -> getSite ( ) ; $ this -> merge ( CNabuSiteMap :: getMapsForSite ( $ nb_site ) ) ; $ translations = CNabuSiteMapLanguage :: getMapTranslationsForSite ( $ nb_site ) ; if ( is_array ( $ translations ) && count ( $ translations ) > 0 ) { foreach ( $ translations as $ translation ) { $ item = $ this -> getItem ( $ translation -> getSiteMapId ( ) ) ; $ item -> setTranslation ( $ translation ) ; } } $ roles = CNabuSiteMapRole :: getMapRolesForSite ( $ nb_site ) ; if ( is_array ( $ roles ) && count ( $ roles ) > 0 ) { foreach ( $ roles as $ role ) { $ item = $ this -> getItem ( $ role -> getSiteMapId ( ) ) ; $ item -> addRole ( $ role ) ; } } } | Populates the Site Map with all Items . |
17,365 | public function fillFromSite ( $ nb_site ) : int { $ this -> clear ( ) ; $ this -> merge ( CNabuRole :: getRolesForSite ( $ nb_site ) ) ; return $ this -> getSize ( ) ; } | Clear the list and fill it from Roles assigned to a Site . |
17,366 | public static function findByKey ( $ nb_commerce , $ key ) { $ nb_commerce_id = nb_getMixedValue ( $ nb_commerce , 'nb_commerce_id' ) ; if ( is_numeric ( $ nb_commerce_id ) ) { $ retval = CNabuCommerceProductCategory :: buildObjectFromSQL ( 'select * ' . 'from nb_commerce_product_category ' . 'where nb_commerce_id=%commerce_id$d ' . "and nb_commerce_product_category_key='%key\$s'" , array ( 'commerce_id' => $ nb_commerce_id , 'key' => $ key ) ) ; } else { $ retval = null ; } return $ retval ; } | Find an instance identified by nb_commerce_product_category_key field . |
17,367 | public static function getAllCommerceProductCategories ( 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_category_id' , 'select * ' . 'from nb_commerce_product_category ' . 'where nb_commerce_id=%commerce_id$d' , array ( 'commerce_id' => $ nb_commerce_id ) , $ nb_commerce ) ; } else { $ retval = new CNabuCommerceProductCategoryList ( ) ; } return $ retval ; } | Get all items in the storage as an associative array where the field nb_commerce_product_category_id is the index and each value is an instance of class CNabuCommerceProductCategoryBase . |
17,368 | public function setCommerceId ( int $ nb_commerce_id ) : CNabuDataObject { if ( $ nb_commerce_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_commerce_id" ) ) ; } $ this -> setValue ( 'nb_commerce_id' , $ nb_commerce_id ) ; return $ this ; } | Sets the Commerce Id attribute value . |
17,369 | public static function hydrateCollection ( array $ comparisons ) { $ hydrated = [ ] ; foreach ( $ comparisons as $ comparison ) { $ hydrated [ ] = self :: hydrate ( $ comparison ) ; } return $ hydrated ; } | Hydrate a collection of concat objects into a collection of ComparisonEntity objects |
17,370 | public static function hydrate ( stdClass $ comparison ) { $ hydrated = new ComparisonEntity ( ) ; if ( isset ( $ comparison -> id ) ) { $ hydrated -> setId ( $ comparison -> id ) ; } if ( isset ( $ comparison -> allowedMisses ) ) { $ hydrated -> setAllowedMisses ( $ comparison -> allowedMisses ) ; } if ( isset ( $ comparison -> filesThreshold ) ) { $ hydrated -> setFilesThreshold ( $ comparison -> filesThreshold ) ; } if ( isset ( $ comparison -> scannedOldFiles ) ) { $ hydrated -> setScannedOldFiles ( $ comparison -> scannedOldFiles ) ; } if ( isset ( $ comparison -> scannedNewFiles ) ) { $ hydrated -> setScannedNewFiles ( $ comparison -> scannedNewFiles ) ; } if ( isset ( $ comparison -> skippedOldFiles ) ) { $ hydrated -> setSkippedOldFiles ( $ comparison -> skippedOldFiles ) ; } if ( isset ( $ comparison -> skippedNewFiles ) ) { $ hydrated -> setSkippedNewFiles ( $ comparison -> skippedNewFiles ) ; } if ( isset ( $ comparison -> misses ) ) { $ hydrated -> setMisses ( $ comparison -> misses ) ; } return $ hydrated ; } | Hydrate a comparison object into a ComparisonEntity object |
17,371 | public function getTemplates ( $ force = false ) { if ( $ this -> nb_messaging_template_list === null ) { $ this -> nb_messaging_template_list = new CNabuMessagingTemplateList ( ) ; } if ( $ this -> nb_messaging_template_list -> isEmpty ( ) || $ force ) { $ this -> nb_messaging_template_list -> clear ( ) ; $ this -> nb_messaging_template_list -> merge ( CNabuMessagingTemplate :: getAllMessagingTemplates ( $ this ) ) ; $ this -> nb_messaging_template_list -> iterate ( function ( $ key , CNabuMessagingTemplate $ nb_template ) { $ nb_template -> setMessaging ( $ this ) ; return true ; } ) ; } return $ this -> nb_messaging_template_list ; } | Get Templates assigned to this Messaging instance . |
17,372 | public function getTemplate ( $ nb_template ) { $ retval = false ; if ( is_numeric ( $ nb_template_id = nb_getMixedValue ( $ nb_template , NABU_MESSAGING_TEMPLATE_FIELD_ID ) ) ) { $ retval = $ this -> nb_messaging_template_list -> getItem ( $ nb_template_id ) ; if ( $ retval instanceof CNabuMessagingTemplate && $ retval -> getMessaging ( ) === null ) { $ retval -> setMessaging ( $ this ) ; } } return $ retval ; } | Gets a Template by Id . |
17,373 | public function getTemplateByKey ( string $ key ) { $ retval = false ; if ( is_string ( $ key ) && strlen ( $ key ) > 0 ) { $ this -> getTemplates ( ) ; $ retval = $ this -> nb_messaging_template_list -> getItem ( $ key , CNabuMessagingTemplateList :: INDEX_KEY ) ; } return $ retval ; } | Gets a Template by Key . |
17,374 | public function getFactory ( ) { $ nb_engine = CNabuEngine :: getEngine ( ) ; if ( ! ( $ this -> nb_messaging_pool_manager instanceof CNabuMessagingPoolManager ) ) { $ this -> nb_messaging_pool_manager = CNabuEngine :: getEngine ( ) -> getMessagingPoolManager ( ) ; } if ( ! ( $ this -> nb_messaging_factory instanceof CNabuMessagingFactory ) ) { $ this -> nb_messaging_factory = $ this -> nb_messaging_pool_manager -> getFactory ( $ this ) ; } return $ this -> nb_messaging_factory ; } | Get the Factory to produce and send messages . If she is not instantiates then instantiates one and catches it . |
17,375 | protected function scanEntities ( ) { $ app = $ this -> app ; $ classes = $ app [ 'datamapper.classfinder' ] -> getClassesFromNamespace ( $ app [ 'config' ] [ 'datamapper.models_namespace' ] ) ; $ metadata = $ app [ 'datamapper.entity.scanner' ] -> scan ( $ classes , $ app [ 'config' ] [ 'datamapper.namespace_tablenames' ] , $ app [ 'config' ] [ 'datamapper.morphclass_abbreviations' ] ) ; $ app [ 'datamapper.eloquent.generator' ] -> generate ( $ metadata , false ) ; $ app [ 'datamapper.schema.builder' ] -> update ( $ metadata , false ) ; } | Scan entity annotations and update database . |
17,376 | protected function registerEloquentModels ( ) { $ files = $ this -> app [ 'files' ] -> files ( storage_path ( 'framework/entities' ) ) ; foreach ( $ files as $ file ) { if ( $ this -> app [ 'files' ] -> extension ( $ file ) == '' ) { require_once $ file ; } } } | Load the compiled eloquent entity models . |
17,377 | public function getSitesIndex ( ) { if ( $ this -> isValueNumeric ( 'nb_server_id' ) ) { $ retval = CNabuSite :: buildObjectListFromSQL ( 'nb_site_id' , "SELECT distinct si.* FROM nb_site si INNER JOIN nb_cluster_group cg ON si.nb_cluster_group_id=cg.nb_cluster_group_id INNER JOIN nb_cluster_group_service cgs ON cg.nb_cluster_group_id=cgs.nb_cluster_group_id INNER JOIN nb_server_host sh ON cgs.nb_cluster_group_service_id=sh.nb_cluster_group_service_id INNER JOIN nb_server se ON sh.nb_server_id=se.nb_server_id AND se.nb_server_id=%server_id\$d INNER JOIN nb_site_alias sa ON si.nb_site_id=sa.nb_site_id ORDER BY si.nb_site_mounting_order ASC" , array ( 'server_id' => $ this -> getValue ( 'nb_server_id' ) ) ) ; } else { $ retval = new CNabuSiteList ( ) ; } return $ retval ; } | Get all available sites to be indexed in the Web Server |
17,378 | public function getAdminUser ( $ force = false ) { if ( $ this -> nb_admin_user === null || $ force ) { $ this -> nb_admin_user = null ; if ( $ this -> isValueNumeric ( 'nb_server_admin_user_id' ) ) { $ nb_user = new CNabuUser ( $ this -> getAdminUserId ( ) ) ; if ( $ nb_user -> isFetched ( ) ) { $ this -> nb_admin_user = $ nb_user ; } } } return $ this -> nb_admin_user ; } | Gets the Admin User instance of this server instance . |
17,379 | public function getCountry ( ) { try { $ address = $ this -> remoteAddress -> getRemoteAddress ( ) ; return $ this -> getReader ( ) -> country ( $ address ) -> country -> isoCode ; } catch ( \ Exception $ e ) { return null ; } } | Gets country from remote address . |
17,380 | public function render ( ) { if ( $ this -> discoverInterface ( ) ) { $ this -> nb_interface -> render ( ) ; } else { throw new ENabuRenderException ( ENabuRenderException :: ERROR_RENDER_NOT_FOUND , array ( $ this -> nb_descriptor -> getKey ( ) ) ) ; } } | This method render the content passed as parameter and exposes the result in the default output stream . |
17,381 | public function setMIMEType ( string $ mimetype ) { if ( $ this -> discoverInterface ( ) ) { $ this -> nb_interface -> setMIMEType ( $ mimetype ) ; } else { throw new ENabuRenderException ( ENabuRenderException :: ERROR_RENDER_NOT_FOUND , array ( $ this -> nb_descriptor -> getKey ( ) ) ) ; } return $ this ; } | Pass MIME Type to Render Instance . |
17,382 | public function getAll ( $ appId , $ profileId , array $ queryParams ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> controllers ( ) -> getAll ( $ appId , $ profileId , $ queryParams ) ; return new ControllersResponse ( $ response ) ; } | Get all controllers for a profile profile |
17,383 | public function getById ( $ appId , $ profileId , $ controllerId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> controllers ( ) -> getById ( $ appId , $ profileId , $ controllerId , $ queryParams ) ; return new ControllerResponse ( $ response ) ; } | Get controller for profile profile by id |
17,384 | public function create ( $ appId , $ profileId , ControllerBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> controllers ( ) -> create ( $ appId , $ profileId , $ input -> toArray ( ) , $ queryParams ) ; return new ControllerResponse ( $ response ) ; } | Create controller for profile profile |
17,385 | public function getAll ( $ appId , $ scanId , $ issueId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> issues ( ) -> patches ( ) -> getAll ( $ appId , $ scanId , $ issueId , $ queryParams ) ; return new PatchesResponse ( $ response ) ; } | Get all patches for an issue |
17,386 | public function getById ( $ appId , $ scanId , $ issueId , $ patchId , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> scans ( ) -> issues ( ) -> patches ( ) -> getById ( $ appId , $ scanId , $ issueId , $ patchId , $ queryParams ) ; return new PatchResponse ( $ response ) ; } | Get patch for an issue by id |
17,387 | public static function hydrateCollection ( array $ reviews ) { $ hydrated = [ ] ; foreach ( $ reviews as $ review ) { $ hydrated [ ] = self :: hydrate ( $ review ) ; } return $ hydrated ; } | Hydrate a collection of review objects into a collection of ReviewEntity objects |
17,388 | public static function hydrate ( stdClass $ review ) { $ hydrated = new ReviewEntity ( ) ; if ( isset ( $ review -> id ) ) { $ hydrated -> setId ( $ review -> id ) ; } if ( isset ( $ review -> created_at ) ) { $ hydrated -> setCreatedAt ( new DateTime ( $ review -> created_at ) ) ; } if ( isset ( $ review -> type ) ) { $ hydrated -> setType ( ReviewTypeHydrator :: hydrate ( $ review -> type ) ) ; } if ( isset ( $ review -> created_by ) ) { $ hydrated -> setCreatedBy ( UserHydrator :: hydrate ( $ review -> created_by ) ) ; } if ( isset ( $ review -> source ) ) { $ hydrated -> setSource ( $ review -> source ) ; } if ( isset ( $ review -> issue ) ) { $ hydrated -> setIssue ( IssueHydrator :: hydrate ( $ review -> issue ) ) ; } return $ hydrated ; } | Hydrate a review object into a ReviewEntity object |
17,389 | public function getIContactProspect ( $ force = false ) { if ( $ this -> nb_icontact_prospect === null || $ force ) { $ this -> nb_icontact_prospect = null ; if ( $ this instanceof CNabuDataObject && ! $ this -> isBuiltIn ( ) && $ this -> isValueNumeric ( NABU_ICONTACT_PROSPECT_FIELD_ID ) ) { $ nb_icontact_prospect = new CNabuIContactProspect ( $ this -> getValue ( NABU_ICONTACT_PROSPECT_FIELD_ID ) ) ; if ( $ nb_icontact_prospect -> isFetched ( ) ) { $ this -> nb_icontact_prospect = $ nb_icontact_prospect ; } } } return $ this -> nb_icontact_prospect ; } | Gets the iContact Prospect instance that owns this object . |
17,390 | public function setIContactProspect ( CNabuIContactProspect $ nb_icontact_prospect ) { $ this -> nb_icontact_prospect = $ nb_icontact_prospect ; if ( $ this instanceof CNabuDataObject && $ nb_icontact_prospect -> contains ( NABU_ICONTACT_PROSPECT_FIELD_ID ) ) { $ this -> transferValue ( $ nb_icontact_prospect , NABU_ICONTACT_PROSPECT_FIELD_ID ) ; } return $ this ; } | Sets the iContact Prospect instance that onws this object . |
17,391 | static public function getCTARolesForSiteTarget ( $ nb_site_target ) { $ nb_site_target_id = nb_getMixedValue ( $ nb_site_target , NABU_SITE_TARGET_FIELD_ID ) ; if ( is_numeric ( $ nb_site_target_id ) ) { $ retval = CNabuEngine :: getEngine ( ) -> getMainDB ( ) -> getQueryAsObjectArray ( '\nabu\data\site\CNabuSiteTargetCTARole' , null , 'select stcr.* ' . 'from nb_site_target_cta stc, nb_site_target_cta_role stcr ' . 'where stc.nb_site_target_cta_id=stcr.nb_site_target_cta_id ' . 'and stc.nb_site_target_id=%target_id$d' , array ( 'target_id' => $ nb_site_target_id ) ) ; } else { $ retval = null ; } return $ retval ; } | Get all roles to be applied to all CTAs of a Site Target . |
17,392 | public function toDatamapperObject ( ) { $ entities = new DatamapperCollection ; foreach ( $ this -> items as $ name => $ item ) { $ entities -> put ( $ name , $ item -> toDatamapperObject ( ) ) ; } return $ entities ; } | Convert models to entity objects . |
17,393 | public function toDataTransferObject ( string $ root , array $ schema , array $ transformations , $ path = '' ) { $ entities = new DatamapperCollection ; foreach ( $ this -> items as $ name => $ item ) { $ entities -> put ( $ name , $ item -> toDataTransferObject ( $ root , $ schema , $ transformations , $ path ) ) ; } return $ entities ; } | Convert models to data transfer objects . |
17,394 | public static function newFromDatamapperObject ( $ entities , $ lastObjectId , $ lastEloquentModel ) { $ eloquentModels = new static ; foreach ( $ entities as $ name => $ item ) { if ( spl_object_hash ( $ item ) == $ lastObjectId ) { $ model = $ lastEloquentModel ; } else { $ model = Model :: newFromDatamapperObject ( $ item , $ lastObjectId , $ lastEloquentModel ) ; } $ eloquentModels -> put ( $ name , $ model ) ; } return $ eloquentModels ; } | Convert models to eloquent models . |
17,395 | public function setTemplatesStatus ( string $ templates_status = "D" ) : CNabuDataObject { if ( $ templates_status === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$templates_status" ) ) ; } $ this -> setValue ( 'nb_messaging_lang_templates_status' , $ templates_status ) ; return $ this ; } | Sets the Messaging Lang Templates Status attribute value . |
17,396 | public function getAll ( array $ queryParams = [ ] ) { $ response = $ this -> api -> logs ( ) -> getAll ( $ queryParams ) ; return new LogsResponse ( $ response ) ; } | Get all logs |
17,397 | public function getById ( $ logId , array $ queryParams = [ ] ) { $ response = $ this -> api -> logs ( ) -> getById ( $ logId , $ queryParams ) ; return new LogResponse ( $ response ) ; } | Get a log by id |
17,398 | public function create ( LogBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> logs ( ) -> create ( $ input -> toArray ( ) , $ queryParams ) ; return new LogResponse ( $ response ) ; } | Create a new log |
17,399 | public static function getAllRoles ( 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_role_id' , 'select * ' . 'from nb_role ' . 'where nb_customer_id=%cust_id$d' , array ( 'cust_id' => $ nb_customer_id ) , $ nb_customer ) ; } else { $ retval = new CNabuRoleList ( ) ; } return $ retval ; } | Get all items in the storage as an associative array where the field nb_role_id is the index and each value is an instance of class CNabuRoleBase . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.