idx
int64
0
60.3k
question
stringlengths
101
6.21k
target
stringlengths
7
803
17,100
protected function getDataTablesURL ( DataTablesProviderInterface $ dtProvider ) { $ this -> getLogger ( ) -> debug ( sprintf ( "DataTables controller search for an URL with name \"%s\"" , $ dtProvider -> getName ( ) ) ) ; if ( false === ( $ dtProvider instanceof DataTablesRouterInterface ) ) { return $ this -> getRouter ( ) -> generate ( "jquery_datatables_index" , [ "name" => $ dtProvider -> getName ( ) ] ) ; } $ this -> getLogger ( ) -> debug ( sprintf ( "DataTables controller found for an URL with name \"%s\"" , $ dtProvider -> getName ( ) ) ) ; return $ dtProvider -> getUrl ( ) ; }
Get an URL .
17,101
protected function getDataTablesWrapper ( DataTablesProviderInterface $ dtProvider ) { $ url = $ this -> getDataTablesURL ( $ dtProvider ) ; $ dtWrapper = DataTablesFactory :: newWrapper ( $ url , $ dtProvider , $ this -> getKernelEventListener ( ) -> getUser ( ) ) ; foreach ( $ dtProvider -> getColumns ( ) as $ dtColumn ) { $ this -> getLogger ( ) -> debug ( sprintf ( "DataTables provider \"%s\" add a column \"%s\"" , $ dtProvider -> getName ( ) , $ dtColumn -> getData ( ) ) ) ; $ dtWrapper -> addColumn ( $ dtColumn ) ; } if ( null !== $ dtProvider -> getOptions ( ) ) { $ dtWrapper -> setOptions ( $ dtProvider -> getOptions ( ) ) ; } return $ dtWrapper ; }
Get a wrapper .
17,102
protected function prepareActionResponse ( $ status , $ notificationId ) { $ response = new ActionResponse ( ) ; $ response -> setStatus ( $ status ) ; $ response -> setNotify ( $ this -> getDataTablesNotification ( $ notificationId ) ) ; return $ response ; }
Prepare an action response .
17,103
public function PaginatedGalleries ( ) { $ children = $ this -> AllChildren ( ) ; $ limit = $ this -> ThumbnailsPerPage ; $ list = ArrayList :: create ( ) ; foreach ( $ children as $ child ) { $ image = $ child -> SortedImages ( ) -> first ( ) ; $ child_data = $ child -> toMap ( ) ; $ child_data [ "Link" ] = $ child -> Link ( ) ; if ( $ image ) { $ child_data [ "GalleryThumbnail" ] = $ this -> ScaledImage ( $ image , true ) ; } else { $ child_data [ "GalleryThumbnail" ] = null ; } $ list -> add ( ArrayData :: create ( $ child_data ) ) ; } $ pages = PaginatedList :: create ( $ list , $ this -> getRequest ( ) ) ; $ pages -> setPageLength ( $ limit ) ; return $ pages ; }
Get a custom list of children with resized gallery images
17,104
protected function setParam ( $ key , $ value , $ trimLeadingSlashes = true ) { $ this -> params [ $ key ] = $ trimLeadingSlashes ? ltrim ( $ value , '/' ) : $ value ; return $ this ; }
Sets loader parameter .
17,105
public function limit ( $ limit , $ markerFile = '' ) { return $ this -> setParam ( 'limit' , intval ( $ limit ) , false ) -> setParam ( 'marker' , $ markerFile , false ) ; }
Sets files limit . If you need to paginate through results pass markerFile argument with latest filename from previous request as value . If you re working within a directory its path will be appended to markerFile .
17,106
public function find ( $ path ) { $ file = $ this -> findFileAt ( $ path ) ; if ( is_null ( $ file ) ) { throw new FileNotFoundException ( 'File "' . $ path . '" was not found.' ) ; } return new File ( $ this -> api , $ this -> containerName ( ) , $ file ) ; }
Finds single file at given path .
17,107
protected function findFileAt ( $ path ) { try { $ files = $ this -> fromDirectory ( '' ) -> withPrefix ( $ path ) -> withDelimiter ( '' ) -> limit ( 1 ) -> get ( ) ; } catch ( ApiRequestFailedException $ e ) { return ; } return $ files -> get ( 0 ) ; }
Loads file from path .
17,108
public function get ( ) { $ response = $ this -> api -> request ( 'GET' , $ this -> containerUrl , [ 'query' => $ this -> buildParams ( ) , ] ) ; if ( $ response -> getStatusCode ( ) !== 200 ) { throw new ApiRequestFailedException ( 'Unable to list container files.' , $ response -> getStatusCode ( ) ) ; } $ files = json_decode ( $ response -> getBody ( ) , true ) ; if ( $ this -> asFileObjects === true ) { $ this -> asFileObjects = false ; return $ this -> getFilesCollectionFromArrays ( $ files ) ; } $ files = array_map ( function ( $ file ) { $ path = explode ( '/' , $ file [ 'name' ] ) ; $ file [ 'filename' ] = array_pop ( $ path ) ; return $ file ; } , $ files ) ; return new Collection ( $ files ) ; }
Loads files .
17,109
protected function formatEmailBody ( $ rawEmailBody ) { if ( ! $ this -> enableFormatting ) { return $ rawEmailBody ; } $ body = str_replace ( [ CRLF , CR ] , LF , $ rawEmailBody ) ; $ body = preg_replace ( '/\\n{2,}/' , LF . LF , $ body ) ; return trim ( $ body ) ; }
Formats the e - mail body if this is enabled .
17,110
private function getAvailableLanguages ( ) { if ( $ this -> availableLanguages === null ) { $ this -> availableLanguages = [ ] ; if ( ! empty ( $ this -> LLkey ) ) { $ this -> availableLanguages [ ] = $ this -> LLkey ; } $ this -> availableLanguages = str_replace ( 'en' , 'default' , $ this -> availableLanguages ) ; $ this -> availableLanguages = array_unique ( $ this -> availableLanguages ) ; foreach ( $ this -> availableLanguages as $ index => $ code ) { if ( ! isset ( $ this -> LOCAL_LANG [ $ code ] ) ) { unset ( $ this -> availableLanguages [ $ index ] ) ; } } } return $ this -> availableLanguages ; }
Compiles a list of language keys for which localizations have been loaded .
17,111
private function getSuffixesToTry ( ) { if ( $ this -> suffixesToTry === null ) { $ this -> suffixesToTry = [ ] ; if ( isset ( $ this -> conf [ 'salutation' ] ) ) { if ( $ this -> conf [ 'salutation' ] === 'informal' ) { $ this -> suffixesToTry [ ] = '_informal' ; } $ this -> suffixesToTry [ ] = '_formal' ; } $ this -> suffixesToTry [ ] = '' ; } return $ this -> suffixesToTry ; }
Gets an ordered list of language label suffixes that should be tried to get localizations in the preferred order of formality .
17,112
private function buildTreeFromArray ( array $ treeStructure , \ Tx_Oelib_Visibility_Node $ parentNode ) { foreach ( $ treeStructure as $ nodeKey => $ nodeContents ) { $ childNode = GeneralUtility :: makeInstance ( \ Tx_Oelib_Visibility_Node :: class ) ; $ parentNode -> addChild ( $ childNode ) ; if ( is_array ( $ nodeContents ) ) { $ this -> buildTreeFromArray ( $ nodeContents , $ childNode ) ; } elseif ( $ nodeContents === true ) { $ childNode -> markAsVisible ( ) ; } $ this -> nodes [ $ nodeKey ] = $ childNode ; } }
Builds the node tree from the given structure .
17,113
public function getKeysOfHiddenSubparts ( ) { $ keysToHide = [ ] ; foreach ( $ this -> nodes as $ key => $ node ) { if ( ! $ node -> isVisible ( ) ) { $ keysToHide [ ] = $ key ; } } return $ keysToHide ; }
Creates a numeric array of all subparts that still are hidden .
17,114
public function makeNodesVisible ( array $ nodeKeys ) { foreach ( $ nodeKeys as $ nodeKey ) { if ( isset ( $ this -> nodes [ $ nodeKey ] ) ) { $ this -> nodes [ $ nodeKey ] -> markAsVisible ( ) ; } } }
Makes nodes in the tree visible .
17,115
public static function submit ( $ url , $ params ) { $ Config = GiroCheckout_SDK_Config :: getInstance ( ) ; $ ch = curl_init ( ) ; curl_setopt ( $ ch , CURLOPT_URL , $ url ) ; curl_setopt ( $ ch , CURLOPT_POST , true ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ params ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ ch , CURLOPT_HEADER , 1 ) ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , array ( 'Expect:' ) ) ; if ( defined ( '__GIROSOLUTION_SDK_CERT__' ) ) { curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , 1 ) ; curl_setopt ( $ ch , CURLOPT_CAINFO , str_replace ( '\\' , '/' , __GIROSOLUTION_SDK_CERT__ ) ) ; } if ( defined ( '__GIROSOLUTION_SDK_SSL_VERIFY_OFF__' ) && __GIROSOLUTION_SDK_SSL_VERIFY_OFF__ ) { curl_setopt ( $ ch , CURLOPT_SSL_VERIFYHOST , 0 ) ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , 0 ) ; } if ( $ Config -> getConfig ( 'CURLOPT_SSL_VERIFYPEER' ) ) { curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , $ Config -> getConfig ( 'CURLOPT_SSL_VERIFYPEER' ) ) ; } if ( $ Config -> getConfig ( 'CURLOPT_CAINFO' ) ) { curl_setopt ( $ ch , CURLOPT_CAINFO , $ Config -> getConfig ( 'CURLOPT_CAINFO' ) ) ; } if ( $ Config -> getConfig ( 'CURLOPT_SSL_VERIFYHOST' ) ) { curl_setopt ( $ ch , CURLOPT_SSL_VERIFYHOST , $ Config -> getConfig ( 'CURLOPT_SSL_VERIFYHOST' ) ) ; } if ( $ Config -> getConfig ( 'CURLOPT_CONNECTTIMEOUT' ) ) { curl_setopt ( $ ch , CURLOPT_CONNECTTIMEOUT , $ Config -> getConfig ( 'CURLOPT_CONNECTTIMEOUT' ) ) ; } if ( $ Config -> getConfig ( 'CURLOPT_PROXY' ) && $ Config -> getConfig ( 'CURLOPT_PROXYPORT' ) ) { curl_setopt ( $ ch , CURLOPT_PROXY , $ Config -> getConfig ( 'CURLOPT_PROXY' ) ) ; curl_setopt ( $ ch , CURLOPT_PROXYPORT , $ Config -> getConfig ( 'CURLOPT_PROXYPORT' ) ) ; if ( $ Config -> getConfig ( 'CURLOPT_PROXYUSERPWD' ) ) { curl_setopt ( $ ch , CURLOPT_PROXYUSERPWD , $ Config -> getConfig ( 'CURLOPT_PROXYUSERPWD' ) ) ; } } if ( $ Config -> getConfig ( 'DEBUG_MODE' ) ) { curl_setopt ( $ ch , CURLINFO_HEADER_OUT , 1 ) ; } $ result = curl_exec ( $ ch ) ; if ( $ Config -> getConfig ( 'DEBUG_MODE' ) ) { GiroCheckout_SDK_Debug_helper :: getInstance ( ) -> logRequest ( curl_getinfo ( $ ch ) , $ params ) ; } if ( $ Config -> getConfig ( 'DEBUG_MODE' ) ) { GiroCheckout_SDK_Debug_helper :: getInstance ( ) -> logReply ( $ result , curl_error ( $ ch ) ) ; } if ( $ result === false ) { throw new Exception ( 'cURL: submit failed.' ) ; } curl_close ( $ ch ) ; return self :: getHeaderAndBody ( $ result ) ; }
submits data by using curl to a given url
17,116
public static function getJSONResponseToArray ( $ string ) { $ json = json_decode ( $ string , true ) ; if ( $ json !== NULL ) { return $ json ; } else { throw new \ Exception ( 'Response is not a valid json string.' ) ; } }
Decodes a json string and returns an array
17,117
private static function getHeaderAndBody ( $ response ) { $ header = self :: http_parse_headers ( substr ( $ response , 0 , strrpos ( $ response , "\r\n\r\n" ) ) ) ; $ body = substr ( $ response , strrpos ( $ response , "\r\n\r\n" ) + 4 ) ; return array ( $ header , $ body ) ; }
Strip header content
17,118
public function getLoggedInUser ( $ mapperName = \ Tx_Oelib_Mapper_BackEndUser :: class ) { if ( $ mapperName === '' ) { throw new \ InvalidArgumentException ( '$mapperName must not be empty.' , 1331318483 ) ; } if ( ! $ this -> isLoggedIn ( ) ) { return null ; } if ( $ this -> loggedInUser ) { return $ this -> loggedInUser ; } $ mapper = \ Tx_Oelib_MapperRegistry :: get ( $ mapperName ) ; $ user = $ mapper -> find ( $ this -> getBackEndUserAuthentication ( ) -> user [ 'uid' ] ) ; return $ user ; }
Gets the currently logged - in back - end user .
17,119
public function boot ( \ Neos \ Flow \ Core \ Bootstrap $ bootstrap ) { $ dispatcher = $ bootstrap -> getSignalSlotDispatcher ( ) ; $ dispatcher -> connect ( ConfigurationManager :: class , 'configurationManagerReady' , function ( ConfigurationManager $ configurationManager ) use ( $ dispatcher ) { $ enabled = $ configurationManager -> getConfiguration ( ConfigurationManager :: CONFIGURATION_TYPE_SETTINGS , 'MOC.Varnish.enabled' ) ; if ( ( boolean ) $ enabled === true ) { $ dispatcher -> connect ( 'Neos\Neos\Service\PublishingService' , 'nodePublished' , 'MOC\Varnish\Service\ContentCacheFlusherService' , 'flushForNode' ) ; $ dispatcher -> connect ( 'Neos\Flow\Mvc\Dispatcher' , 'afterControllerInvocation' , 'MOC\Varnish\Service\CacheControlService' , 'addHeaders' ) ; } } ) ; }
Register slots for sending correct headers and BANS to varnish
17,120
public static function defaultPanel ( ) { $ argCount = func_num_args ( ) ; $ args = func_get_args ( ) ; $ sections = array ( ) ; for ( $ i = 0 ; $ i < $ argCount ; ++ $ i ) { $ sections [ $ args [ $ i ] [ 'id' ] ] = $ args [ $ i ] ; } return array ( 'sections' => $ sections ) ; }
Set all sections which will go to the default customizer panel . The function accepts more than 0 arguments . All arguments will define the sections of the panel .
17,121
public static function panel ( $ title , $ description ) { $ argCount = func_num_args ( ) ; $ args = func_get_args ( ) ; $ sections = array ( ) ; for ( $ i = 2 ; $ i < $ argCount ; ++ $ i ) { $ sections [ $ args [ $ i ] [ 'id' ] ] = $ args [ $ i ] ; } return array ( 'title' => $ title , 'description' => $ description , 'sections' => $ sections ) ; }
Define a customizer panel . The function accepts more than 2 arguments . All arguments passed after the description will define the sections of the panel .
17,122
private function loadEntityMapping ( ) : array { $ mapping = [ ] ; $ builder = $ this -> getContainerBuilder ( ) ; $ repositories = $ builder -> findByType ( IRepository :: class ) ; foreach ( $ repositories as $ repository ) { $ repositoryClass = $ repository -> getEntity ( ) ; if ( ! class_exists ( $ repositoryClass ) ) { throw new ServiceCreationException ( sprintf ( "Repository class '%s' not found" , $ repositoryClass ) ) ; } if ( ! method_exists ( $ repositoryClass , 'getEntityClassNames' ) ) continue ; foreach ( $ repositoryClass :: getEntityClassNames ( ) as $ entity ) { $ mapping [ $ entity ] = $ repositoryClass ; } } return $ mapping ; }
Load entity mapping
17,123
public function Gallery ( ) { if ( $ this -> Images ( ) -> exists ( ) ) { $ images = ArrayList :: create ( ) ; $ pages = $ this -> PaginatedImages ( ) ; foreach ( $ this -> PaginatedImages ( ) as $ image ) { $ image_data = $ image -> toMap ( ) ; $ image_data [ "GalleryImage" ] = $ this -> GalleryImage ( $ image ) ; $ image_data [ "GalleryThumbnail" ] = $ this -> GalleryThumbnail ( $ image ) ; $ images -> add ( ArrayData :: create ( $ image_data ) ) ; } $ vars = [ 'PaginatedImages' => $ pages , 'Images' => $ images , 'Width' => $ this -> getFullWidth ( ) , 'Height' => $ this -> getFullHeight ( ) ] ; return $ this -> renderWith ( [ 'Gallery' , 'ilateral\SilverStripe\Gallery\Includes\Gallery' ] , $ vars ) ; } else { return "" ; } }
Generate an image gallery from the Gallery template if no images are available then return an empty string .
17,124
public function addItem ( $ p_strName , $ p_iQuantity , $ p_iGrossAmt , $ p_strEAN = "" ) { if ( empty ( $ p_strName ) || empty ( $ p_iQuantity ) || ! isset ( $ p_iGrossAmt ) ) { throw new GiroCheckout_SDK_Exception_helper ( 'Name, quantity and amount are mandatory for cart items' ) ; } $ aItem = array ( "name" => $ p_strName , "quantity" => $ p_iQuantity , "grossAmount" => $ p_iGrossAmt ) ; if ( ! empty ( $ p_strEAN ) ) { $ aItem [ "ean" ] = $ p_strEAN ; } $ this -> m_aItems [ ] = $ aItem ; }
Add item to cart .
17,125
public function getAllItems ( ) { if ( version_compare ( phpversion ( ) , '5.3.0' , '<' ) ) { return json_encode ( $ this -> m_aItems ) ; } else { return json_encode ( $ this -> m_aItems , JSON_UNESCAPED_UNICODE ) ; } }
Returns all items as a JSON string .
17,126
public function notifyConditions ( $ type , $ condValues = array ( ) ) { if ( ! is_array ( $ condValues ) ) { $ condValues = array ( $ condValues ) ; } $ context = new \ Orion \ Context \ ContextFactory ( ) ; $ context -> put ( "type" , $ type ) ; $ context -> put ( "condValues" , $ condValues ) ; $ this -> _notifyConditions [ ] = $ context -> get ( ) ; return $ this ; }
Build notifyCondition object
17,127
public function removeColumn ( DataTablesColumnInterface $ column ) { if ( true === array_key_exists ( $ column -> getData ( ) , $ this -> columns ) ) { $ this -> columns [ $ column -> getData ( ) ] -> getMapping ( ) -> setPrefix ( null ) ; unset ( $ this -> columns [ $ column -> getData ( ) ] ) ; } return $ this ; }
Remove a column .
17,128
public static function sanitizeJsVarName ( $ str ) { $ out = preg_replace ( "/ /" , '_' , trim ( $ str ) ) ; $ out = preg_replace ( "/[^A-Za-z_]/" , '' , $ out ) ; return $ out ; }
Turn an arbitrary string into a usable javascript variable name
17,129
public function addAttribute ( $ name , $ value , $ type = "Integer" , $ metadata = null ) { $ attr = ( object ) [ "value" => $ value , "type" => $ type ] ; if ( null != $ metadata ) { $ attr -> metadata = ( object ) $ metadata ; } $ this -> put ( $ name , $ attr ) ; }
This convenience method create a Entity NGSIv2 attribute format .
17,130
public function setParent ( \ Tx_Oelib_Visibility_Node $ parentNode ) { if ( $ this -> parentNode !== null ) { throw new \ InvalidArgumentException ( 'This node already has a parent node.' , 1331488668 ) ; } $ this -> parentNode = $ parentNode ; }
Sets the parent node of this node .
17,131
public function textualDateFilter ( $ date ) { if ( ! $ date instanceof \ DateTime ) { throw new \ InvalidArgumentException ( 'Textual Date Filter expects input to be a instance of DateTime' ) ; } $ now = new \ DateTime ( 'now' ) ; $ diff = $ now -> diff ( $ date ) ; $ diffUnit = $ this -> getHighestDiffUnitAndValue ( $ diff ) ; $ temporalModifier = ( $ diff -> invert ) ? 'ago' : 'next' ; $ translationString = $ temporalModifier . '.' . $ diffUnit [ 'unit' ] ; if ( $ diffUnit [ 'unit' ] == 'd' && $ diffUnit [ 'value' ] == 1 ) { $ translationString = ( $ diff -> invert ) ? 'date.yesterday' : 'date.tomorrow' ; } if ( $ diffUnit [ 'unit' ] == 'now' ) { $ translationString = 'date.just_now' ; } return $ this -> translator -> transChoice ( $ translationString , $ diffUnit [ 'value' ] , array ( '%value%' => $ diffUnit [ 'value' ] ) , 'date' ) ; }
Converts dates into relative textual dates
17,132
protected function getHighestDiffUnitAndValue ( $ diff ) { $ properties = array ( 'y' , 'm' , 'd' , 'h' , 'i' , 's' ) ; foreach ( $ properties as $ prop ) { if ( $ diff -> $ prop > 0 ) { return array ( 'unit' => $ prop , 'value' => $ diff -> $ prop ) ; } } return array ( 'unit' => 'now' , 'value' => 0 ) ; }
Returns the highest unit and its value in a diff .
17,133
public static function getMessage ( $ code , $ lang = 'EN' ) { if ( $ code < 0 ) { return null ; } $ lang = strtoupper ( $ lang ) ; if ( ! array_key_exists ( $ lang , self :: $ code ) ) { $ lang = 'EN' ; } if ( array_key_exists ( $ code , self :: $ code [ $ lang ] ) ) { return self :: $ code [ $ lang ] [ $ code ] ; } return null ; }
Returns the message string of an given code in the given language
17,134
protected function registerHooks ( ) { if ( is_admin ( ) ) { switch ( $ this -> accessType ) { case 'guest' : Hooks :: action ( 'wp_ajax_nopriv_' . static :: $ ACTION , $ this , 'doAjax' ) ; break ; case 'logged' : Hooks :: action ( 'wp_ajax_' . static :: $ ACTION , $ this , 'doAjax' ) ; break ; case 'any' : Hooks :: action ( 'wp_ajax_nopriv_' . static :: $ ACTION , $ this , 'doAjax' ) ; Hooks :: action ( 'wp_ajax_' . static :: $ ACTION , $ this , 'doAjax' ) ; break ; default : throw new \ InvalidArgumentException ( "Invalid value for the Ajax access type parameter: " . $ this -> accessType ) ; } } Hooks :: filter ( 'baobab/ajax/global_data' , $ this , 'addGlobalVariables' ) ; }
Hook into WordPress to execute our ajax callback
17,135
public function addGlobalVariables ( $ vars ) { $ globalVars = $ this -> getGlobalVariables ( ) ; if ( $ globalVars == null || empty ( $ globalVars ) ) { return $ vars ; } return array_merge ( $ vars , $ this -> getGlobalVariables ( ) ) ; }
Add our variables to the global namespace object
17,136
public function getByFileName ( $ fileName ) { if ( ! isset ( $ this -> templates [ $ fileName ] ) ) { $ template = GeneralUtility :: makeInstance ( \ Tx_Oelib_Template :: class ) ; if ( $ fileName !== '' ) { $ template -> processTemplateFromFile ( $ fileName ) ; } $ this -> templates [ $ fileName ] = $ template ; } return clone $ this -> templates [ $ fileName ] ; }
Creates a new template for a provided template file name with an already parsed the template file .
17,137
public function setConfig ( $ key , $ value ) { switch ( $ key ) { case 'CURLOPT_CAINFO' : case 'CURLOPT_SSL_VERIFYPEER' : case 'CURLOPT_SSL_VERIFYHOST' : case 'CURLOPT_CONNECTTIMEOUT' : case 'CURLOPT_PROXY' : case 'CURLOPT_PROXYPORT' : case 'CURLOPT_PROXYUSERPWD' : case 'DEBUG_LOG_PATH' : case 'DEBUG_MODE' : $ this -> config [ $ key ] = $ value ; return true ; break ; default : return false ; } }
Setter for config values
17,138
protected function encodeOptions ( array $ options ) { if ( 0 === count ( $ options ) ) { return "{}" ; } ksort ( $ options ) ; $ output = json_encode ( $ options , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) ; return str_replace ( "\n" , "\n " , $ output ) ; }
Encode the options .
17,139
protected function jQueryDataTablesStandalone ( $ selector , $ language , array $ options ) { if ( null !== $ language ) { $ options [ "language" ] = [ "url" => DataTablesWrapperHelper :: getLanguageURL ( $ language ) ] ; } $ searches = [ "%selector%" , "%options%" ] ; $ replaces = [ $ selector , $ this -> encodeOptions ( $ options ) ] ; $ javascript = StringHelper :: replace ( self :: JQUERY_DATATABLES_STANDALONE , $ searches , $ replaces ) ; return $ this -> getRendererTwigExtension ( ) -> coreScriptFilter ( $ javascript ) ; }
Displays a jQuery DataTables standalone .
17,140
private function renderDataTablesColumn ( DataTablesColumnInterface $ dtColumn , $ rowScope = false ) { $ attributes = [ ] ; $ attributes [ "scope" ] = true === $ rowScope ? "row" : null ; $ attributes [ "class" ] = $ dtColumn -> getClassname ( ) ; $ attributes [ "width" ] = $ dtColumn -> getWidth ( ) ; return static :: coreHTMLElement ( "th" , $ dtColumn -> getTitle ( ) , $ attributes ) ; }
Render a column .
17,141
private function renderDataTablesRow ( DataTablesWrapperInterface $ dtWrapper , $ wrapper ) { $ innerHTML = "" ; $ count = count ( $ dtWrapper -> getColumns ( ) ) ; for ( $ i = 0 ; $ i < $ count ; ++ $ i ) { $ dtColumn = array_values ( $ dtWrapper -> getColumns ( ) ) [ $ i ] ; $ th = $ this -> renderDataTablesColumn ( $ dtColumn , ( "thead" === $ wrapper && 0 === $ i ) ) ; if ( "" === $ th ) { continue ; } $ innerHTML .= $ th . "\n" ; } $ tr = static :: coreHTMLElement ( "tr" , "\n" . $ innerHTML ) ; return static :: coreHTMLElement ( $ wrapper , "\n" . $ tr . "\n" ) ; }
Render a row .
17,142
private function rebuildUidCache ( ) { $ this -> hasItemWithoutUid = false ; foreach ( $ this as $ item ) { if ( $ item -> hasUid ( ) ) { $ uid = $ item -> getUid ( ) ; $ this -> uids [ $ uid ] = $ uid ; } else { $ this -> hasItemWithoutUid = true ; } } }
Rebuilds the UID cache .
17,143
public function sort ( $ callbackFunction ) { $ items = iterator_to_array ( $ this , false ) ; usort ( $ items , $ callbackFunction ) ; foreach ( $ items as $ item ) { $ this -> detach ( $ item ) ; $ this -> attach ( $ item ) ; } $ this -> markAsDirty ( ) ; }
Sorts this list by using the given callback function .
17,144
public function purgeCurrent ( ) { if ( ! $ this -> valid ( ) ) { return ; } if ( $ this -> current ( ) -> hasUid ( ) ) { $ uid = $ this -> current ( ) -> getUid ( ) ; if ( isset ( $ this -> uids [ $ uid ] ) ) { unset ( $ this -> uids [ $ uid ] ) ; } } $ this -> detach ( $ this -> current ( ) ) ; $ this -> markAsDirty ( ) ; }
Drops the current element from the list and sets the pointer to the next element .
17,145
public function resetData ( array $ data ) { $ this -> data = $ data ; if ( $ this -> existsKey ( 'uid' ) ) { if ( ! $ this -> hasUid ( ) ) { $ this -> setUid ( ( int ) $ this -> data [ 'uid' ] ) ; } unset ( $ this -> data [ 'uid' ] ) ; } $ this -> markAsLoaded ( ) ; if ( $ this -> hasUid ( ) ) { $ this -> markAsClean ( ) ; } else { $ this -> markAsDirty ( ) ; } }
Sets the complete data for this model .
17,146
public function setUid ( $ uid ) { if ( $ this -> hasUid ( ) ) { throw new \ BadMethodCallException ( 'The UID of a model cannot be set a second time.' , 1331489260 ) ; } if ( $ this -> isVirgin ( ) ) { $ this -> setLoadStatus ( self :: STATUS_GHOST ) ; } $ this -> uid = $ uid ; }
Sets this model s UID .
17,147
private function load ( ) { if ( $ this -> isVirgin ( ) ) { throw new \ BadMethodCallException ( get_class ( $ this ) . '#' . $ this -> getUid ( ) . ': Please call setData() directly after instantiation first.' , 1331489395 ) ; } if ( $ this -> isGhost ( ) ) { if ( ! $ this -> hasLoadCallBack ( ) ) { throw new \ BadMethodCallException ( 'Ghosts need a load callback function before their data can be accessed.' , 1331489414 ) ; } $ this -> markAsLoading ( ) ; call_user_func ( $ this -> loadCallback , $ this ) ; } }
Makes sure this model has some data by loading the data for ghost models .
17,148
public function setToDeleted ( ) { if ( $ this -> isLoaded ( ) ) { $ this -> data [ 'deleted' ] = true ; $ this -> markAsDirty ( ) ; } else { $ this -> markAsDead ( ) ; } }
Sets the deleted property for the current model .
17,149
public function isEmpty ( ) { if ( $ this -> isGhost ( ) ) { $ this -> load ( ) ; $ this -> markAsLoaded ( ) ; } return empty ( $ this -> data ) ; }
Checks whether this model is empty .
17,150
public static function enumParameters ( ) { return [ DataTablesRequestInterface :: DATATABLES_PARAMETER_COLUMNS , DataTablesRequestInterface :: DATATABLES_PARAMETER_DRAW , DataTablesRequestInterface :: DATATABLES_PARAMETER_LENGTH , DataTablesRequestInterface :: DATATABLES_PARAMETER_ORDER , DataTablesRequestInterface :: DATATABLES_PARAMETER_SEARCH , DataTablesRequestInterface :: DATATABLES_PARAMETER_START , ] ; }
Enumerates parameters .
17,151
public static function enumTypes ( ) { return [ DataTablesColumnInterface :: DATATABLES_TYPE_DATE , DataTablesColumnInterface :: DATATABLES_TYPE_HTML , DataTablesColumnInterface :: DATATABLES_TYPE_HTML_NUM , DataTablesColumnInterface :: DATATABLES_TYPE_NUM , DataTablesColumnInterface :: DATATABLES_TYPE_NUM_FMT , DataTablesColumnInterface :: DATATABLES_TYPE_STRING , ] ; }
Enumerates types .
17,152
public function add ( \ Tx_Oelib_Model $ model ) { if ( ! $ model -> hasUid ( ) ) { throw new \ InvalidArgumentException ( 'Add() requires a model that has a UID.' , 1331488748 ) ; } $ this -> items [ $ model -> getUid ( ) ] = $ model ; $ this -> highestUid = max ( $ this -> highestUid , $ model -> getUid ( ) ) ; }
Adds a model to the identity map .
17,153
public function get ( $ uid ) { if ( $ uid <= 0 ) { throw new \ InvalidArgumentException ( '$uid must be > 0.' , 1331488761 ) ; } if ( ! isset ( $ this -> items [ $ uid ] ) ) { throw new \ Tx_Oelib_Exception_NotFound ( 'This map currently does not contain a model with the UID ' . $ uid . '.' ) ; } return $ this -> items [ $ uid ] ; }
Retrieves a model from the map by UID .
17,154
public function getKeyAuthClient ( $ forceNew = false ) { if ( ! isset ( $ this -> instances [ self :: CLIENT_KEY ] ) || $ forceNew ) { $ this -> instances [ self :: CLIENT_KEY ] = MeetupKeyAuthClient :: factory ( $ this -> config ) ; } return $ this -> instances [ self :: CLIENT_KEY ] ; }
Get a new instance of a Key Auth Client for Meetup API
17,155
public function getOauthClient ( $ forceNew = false ) { if ( ! isset ( $ this -> instances [ self :: CLIENT_OAUTH ] ) || $ forceNew ) { $ this -> instances [ self :: CLIENT_OAUTH ] = MeetupOAuthClient :: factory ( $ this -> getUpdatedOauthConfig ( ) ) ; } return $ this -> instances [ self :: CLIENT_OAUTH ] ; }
Get a new instance of a Oauth Client for Meetup API
17,156
public function getUpdatedOauthConfig ( ) { $ token = $ this -> session -> has ( self :: SESSION_TOKEN_KEY ) ? $ this -> session -> get ( self :: SESSION_TOKEN_KEY ) : false ; $ tokenSecret = $ this -> session -> has ( self :: SESSION_TOKEN_SECRET_KEY ) ? $ this -> session -> get ( self :: SESSION_TOKEN_SECRET_KEY ) : false ; return array_merge ( array ( 'token' => $ token , 'token_secret' => $ tokenSecret ) , $ this -> config ) ; }
Loads Oauth token and secret from session and adds to configuration
17,157
public function setSessionTokens ( $ token , $ tokenSecret = null ) { $ this -> session -> set ( self :: SESSION_TOKEN_KEY , $ token ) ; $ this -> session -> set ( self :: SESSION_TOKEN_SECRET_KEY , $ tokenSecret ) ; }
Set the necessary token in the session for future OAuth Clients
17,158
public function clearSessionTokens ( ) { $ this -> session -> remove ( self :: SESSION_TOKEN_KEY ) ; $ this -> session -> remove ( self :: SESSION_TOKEN_SECRET_KEY ) ; }
Removes tokens from session
17,159
public function hasSessionTokens ( ) { return ( $ this -> session -> has ( self :: SESSION_TOKEN_KEY ) && $ this -> session -> has ( self :: SESSION_TOKEN_SECRET_KEY ) ) ; }
Checks if there is a token in the session
17,160
private function createTweet ( array $ tweet , User $ user ) { $ this -> fields = [ 'id' => $ this -> getValue ( 'id' , $ tweet ) , 'text' => $ this -> getValue ( 'text' , $ tweet ) , 'source' => $ this -> getValue ( 'source' , $ tweet ) , 'url' => $ this -> getValue ( 'url' , $ tweet ) , 'retweet_count' => $ this -> getValue ( 'retweet_count' , $ tweet ) , 'favorite_count' => $ this -> getValue ( 'favorite_count' , $ tweet ) , 'created_at' => $ this -> getValue ( 'created_at' , $ tweet ) , 'hashtags' => $ this -> listHashTags ( $ tweet ) , 'user' => $ user ] ; }
Set most used tweet properties
17,161
private function listHashTags ( array $ tweet ) { $ list = [ ] ; if ( array_key_exists ( 'entities' , $ tweet ) and array_key_exists ( 'hashtags' , $ tweet [ 'entities' ] ) ) { $ hashTags = $ tweet [ 'entities' ] [ 'hashtags' ] ; foreach ( $ hashTags as $ hashTag ) { if ( array_key_exists ( 'text' , $ hashTag ) ) { $ list [ ] = $ hashTag [ 'text' ] ; } } } return $ list ; }
List all tweet hash tags
17,162
public function getHeaderProxy ( ) { if ( $ this -> isTestMode ) { $ className = \ Tx_Oelib_HeaderCollector :: class ; } else { $ className = \ Tx_Oelib_RealHeaderProxy :: class ; } if ( ! is_object ( $ this -> headerProxy ) || ( get_class ( $ this -> headerProxy ) !== $ className ) ) { $ this -> headerProxy = GeneralUtility :: makeInstance ( $ className ) ; } return $ this -> headerProxy ; }
Retrieves the singleton header proxy instance . Depending on the mode this instance is either a header collector or a real header proxy .
17,163
public function read ( $ key ) { $ query = $ this -> _table -> find ( 'kv' ) ; if ( $ key !== '*' ) { $ query -> where ( [ $ this -> _table -> aliasField ( 'namespace' ) . ' IS' => $ key ] ) ; } return $ query -> cache ( function ( $ q ) { return md5 ( serialize ( $ q -> clause ( 'where' ) ) ) ; } , $ this -> _cacheConfig ) -> toArray ( ) ; }
Read method is used for reading configuration information from sources . These sources can either be static resources like files or dynamic ones like a database or other datasource .
17,164
private function addImageSizes ( ) { $ data = $ this -> getData ( ) ; foreach ( $ data as $ slug => $ props ) { add_image_size ( $ slug , $ props [ 'width' ] , $ props [ 'height' ] , $ props [ 'crop' ] ) ; } }
Loop through the registered image sizes and add them .
17,165
public function addSizesToDropDownList ( $ sizes ) { $ new = array ( ) ; $ data = $ this -> getData ( ) ; foreach ( $ data as $ slug => $ props ) { if ( ! isset ( $ props [ 'media' ] ) || false == $ props [ 'media' ] ) { continue ; } $ new [ $ slug ] = isset ( $ props [ 'mediaLabel' ] ) ? $ props [ 'mediaLabel' ] : Strings :: labelizeSlug ( $ slug ) ; $ new [ $ slug ] = Strings :: translate ( $ new [ $ slug ] ) ; } return array_merge ( $ sizes , $ new ) ; }
Add image sizes to the media size dropdown list .
17,166
public function calculateDistanceInKilometers ( \ Tx_Oelib_Interface_Geo $ object1 , \ Tx_Oelib_Interface_Geo $ object2 ) { if ( $ object1 -> hasGeoError ( ) ) { throw new \ InvalidArgumentException ( '$object1 has a geo error.' ) ; } if ( $ object2 -> hasGeoError ( ) ) { throw new \ InvalidArgumentException ( '$object2 has a geo error.' ) ; } if ( ! $ object1 -> hasGeoCoordinates ( ) ) { throw new \ InvalidArgumentException ( '$object1 needs to have coordinates, but has none.' ) ; } if ( ! $ object2 -> hasGeoCoordinates ( ) ) { throw new \ InvalidArgumentException ( '$object2 needs to have coordinates, but has none.' ) ; } $ coordinates1 = $ object1 -> getGeoCoordinates ( ) ; $ latitude1 = \ deg2rad ( $ coordinates1 [ 'latitude' ] ) ; $ longitude1 = \ deg2rad ( $ coordinates1 [ 'longitude' ] ) ; $ coordinates2 = $ object2 -> getGeoCoordinates ( ) ; $ latitude2 = \ deg2rad ( $ coordinates2 [ 'latitude' ] ) ; $ longitude2 = \ deg2rad ( $ coordinates2 [ 'longitude' ] ) ; return \ acos ( \ sin ( $ latitude1 ) * \ sin ( $ latitude2 ) + \ cos ( $ latitude1 ) * \ cos ( $ latitude2 ) * \ cos ( $ longitude2 - $ longitude1 ) ) * self :: EARTH_RADIUS_IN_KILOMETERS ; }
Calculates the great - circle distance in kilometers between two geo objects using the haversine formula .
17,167
public function filterByDistance ( \ Tx_Oelib_List $ unfilteredObjects , \ Tx_Oelib_Interface_Geo $ center , $ distance ) { $ objectsWithinDistance = new \ Tx_Oelib_List ( ) ; foreach ( $ unfilteredObjects as $ object ) { if ( $ this -> calculateDistanceInKilometers ( $ center , $ object ) <= $ distance ) { $ objectsWithinDistance -> add ( $ object ) ; } } return $ objectsWithinDistance ; }
Filters a list of geo objects by distance around another geo object .
17,168
protected function addRoutes ( ) { return [ "Route::delete('" . $ this -> routeName . "/arr-delete', '" . $ this -> controller . "@arrDelete')->name('" . $ this -> myAddrName . ".arrDelete');\nRoute::resource('" . $ this -> routeName . "', '" . $ this -> controller . "');" ] ; }
Add routes .
17,169
protected function processJSONFields ( $ file ) { $ json = File :: get ( $ file ) ; $ fields = json_decode ( $ json ) ; $ fieldsString = '' ; foreach ( $ fields -> fields as $ field ) { if ( $ field -> type === 'select' || $ field -> type === 'enum' ) { $ fieldsString .= $ field -> name . '#' . $ field -> type . '#options=' . json_encode ( $ field -> options ) . ';' ; } else { $ fieldsString .= $ field -> name . '#' . $ field -> type . ';' ; } } $ fieldsString = rtrim ( $ fieldsString , ';' ) ; return $ fieldsString ; }
Process the JSON Fields .
17,170
public function columns ( $ itemType = 'Pages' ) { $ columns = [ 'Title' => [ 'title' => _t ( __CLASS__ . '.Name' , 'Name' ) , 'link' => true , ] , 'Created' => [ 'title' => _t ( __CLASS__ . '.Created' , 'Date created' ) , 'formatting' => function ( $ value , $ item ) { return $ item -> dbObject ( 'Created' ) -> Nice ( ) ; } , ] , 'LastEdited' => [ 'title' => _t ( __CLASS__ . '.LastEdited' , 'Date last edited' ) , 'formatting' => function ( $ value , $ item ) { return $ item -> dbObject ( 'LastEdited' ) -> Nice ( ) ; } , ] , ] ; if ( $ itemType === 'Pages' ) { $ columns [ 'i18n_singular_name' ] = _t ( __CLASS__ . '.PageType' , 'Page type' ) ; $ columns [ 'StageState' ] = [ 'title' => _t ( __CLASS__ . '.Stage' , 'Stage' ) , 'formatting' => function ( $ value , $ item ) { if ( ! $ item -> isPublished ( ) ) { return _t ( __CLASS__ . '.Draft' , 'Draft' ) ; } if ( $ item -> isModifiedOnDraft ( ) ) { return _t ( __CLASS__ . '.PublishedWithChanges' , 'Published (with changes)' ) ; } return _t ( __CLASS__ . '.Published' , 'Published' ) ; } , ] ; $ columns [ 'RelativeLink' ] = _t ( __CLASS__ . '.Link' , 'Link' ) ; $ columns [ 'MetaDescription' ] = [ 'title' => _t ( __CLASS__ . '.MetaDescription' , 'Description' ) , 'printonly' => true , ] ; } else { $ columns [ 'FileType' ] = [ 'title' => _t ( __CLASS__ . '.FileType' , 'File type' ) , 'datasource' => function ( $ record ) { if ( $ record instanceof Folder ) { return $ record -> i18n_singular_name ( ) ; } return $ record -> getFileType ( ) ; } ] ; $ columns [ 'Size' ] = _t ( __CLASS__ . '.Size' , 'Size' ) ; $ columns [ 'Filename' ] = _t ( __CLASS__ . '.Directory' , 'Directory' ) ; } $ this -> extend ( 'updateColumns' , $ itemType , $ columns ) ; return $ columns ; }
Returns columns for the grid fields on this report .
17,171
public function getPrintExportColumns ( $ gridField , $ itemType , $ exportColumns ) { $ exportColumns [ 'AbsoluteLink' ] = _t ( __CLASS__ . '.Link' , 'Link' ) ; unset ( $ exportColumns [ 'RelativeLink' ] ) ; $ this -> extend ( 'updatePrintExportColumns' , $ gridField , $ itemType , $ exportColumns ) ; return $ exportColumns ; }
Returns the columns for the export and print functionality .
17,172
public function checkUnicodeSupport ( ) { if ( null === self :: $ unicodeEnabled ) { self :: $ unicodeEnabled = ( @ preg_match ( '/\pL/u' , 'a' ) ) ? true : false ; } return self :: $ unicodeEnabled ; }
Verifies that Regular Expression functions support unicode
17,173
protected function generateJavaScript ( $ mapId , array $ mapPoints , $ initializeFunctionName ) { $ centerCoordinates = $ mapPoints [ 0 ] -> getGeoCoordinates ( ) ; return 'var mapMarkersByUid = mapMarkersByUid || {};' . LF . 'function ' . $ initializeFunctionName . '() {' . LF . 'var center = new google.maps.LatLng(' . \ number_format ( $ centerCoordinates [ 'latitude' ] , 6 , '.' , '' ) . ', ' . \ number_format ( $ centerCoordinates [ 'longitude' ] , 6 , '.' , '' ) . ');' . LF . 'var mapOptions = {' . LF . ' mapTypeId: google.maps.MapTypeId.ROADMAP,' . LF . ' scrollwheel: false, ' . LF . ' zoom: ' . self :: DEFAULT_ZOOM_LEVEL . ', ' . LF . ' center: center' . LF . '};' . LF . 'mapMarkersByUid.' . $ mapId . ' = {};' . LF . 'var map = new google.maps.Map(document.getElementById("' . $ mapId . '"), mapOptions);' . LF . 'var bounds = new google.maps.LatLngBounds();' . LF . $ this -> createMapMarkers ( $ mapPoints , $ mapId ) . '}' ; }
Generates the JavaScript for the Google Map .
17,174
public function scopeOlderThanOrBetween ( Builder $ query , $ until = null , $ from = null ) { if ( is_null ( $ until ) ) { $ until = Carbon :: now ( ) ; } $ query -> where ( 'created_at' , '<' , $ until ) ; if ( ! is_null ( $ from ) ) { $ query -> where ( 'created_at' , '>=' , $ from ) ; } return $ query ; }
Scope for choosing by date
17,175
function convertGrammar ( $ word , $ case ) { global $ wgGrammarForms ; if ( isset ( $ wgGrammarForms [ 'la' ] [ $ case ] [ $ word ] ) ) { return $ wgGrammarForms [ 'la' ] [ $ case ] [ $ word ] ; } switch ( $ case ) { case 'genitive' : $ in = array ( '/u[ms]$/' , '/ommunia$/' , '/a$/' , '/libri$/' , '/nuntii$/' , '/tio$/' , '/ns$/' , '/as$/' , '/es$/' ) ; $ out = array ( 'i' , 'ommunium' , 'ae' , 'librorum' , 'nuntiorum' , 'tionis' , 'ntis' , 'atis' , 'ei' ) ; return preg_replace ( $ in , $ out , $ word ) ; case 'accusative' : $ in = array ( '/u[ms]$/' , '/a$/' , '/ommuniam$/' , '/libri$/' , '/nuntii$/' , '/tio$/' , '/ns$/' , '/as$/' , '/es$/' ) ; $ out = array ( 'um' , 'am' , 'ommunia' , 'libros' , 'nuntios' , 'tionem' , 'ntem' , 'atem' , 'em' ) ; return preg_replace ( $ in , $ out , $ word ) ; case 'ablative' : $ in = array ( '/u[ms]$/' , '/ommunia$/' , '/a$/' , '/libri$/' , '/nuntii$/' , '/tio$/' , '/ns$/' , '/as$/' , '/es$/' ) ; $ out = array ( 'o' , 'ommunibus' , 'a' , 'libris' , 'nuntiis' , 'tione' , 'nte' , 'ate' , 'e' ) ; return preg_replace ( $ in , $ out , $ word ) ; default : return $ word ; } }
Convert from the nominative form of a noun to some other case
17,176
public function getLibrary ( $ sName ) { try { $ library = $ this -> di [ $ sName ] ; } catch ( \ Exception $ e ) { $ library = null ; } return $ library ; }
Get a library adapter by its name .
17,177
protected function getModalLibrary ( ) { if ( ( $ this -> sModalLibrary ) && ( $ library = $ this -> getLibrary ( $ this -> sModalLibrary ) ) && ( $ library instanceof Modal ) ) { return $ library ; } if ( ( $ sName = $ this -> getOption ( 'dialogs.default.modal' , '' ) ) && ( $ library = $ this -> getLibrary ( $ sName ) ) && ( $ library instanceof Modal ) ) { return $ library ; } return null ; }
Get the library adapter to use for modals .
17,178
protected function getAlertLibrary ( $ bReturnDefault = false ) { if ( ( $ this -> sAlertLibrary ) && ( $ library = $ this -> getLibrary ( $ this -> sAlertLibrary ) ) && ( $ library instanceof Alert ) ) { return $ library ; } if ( ( $ sName = $ this -> getOption ( 'dialogs.default.alert' , '' ) ) && ( $ library = $ this -> getLibrary ( $ sName ) ) && ( $ library instanceof Alert ) ) { return $ library ; } return ( $ bReturnDefault ? $ this -> getPluginManager ( ) -> getDefaultAlert ( ) : null ) ; }
Get the library adapter to use for alerts .
17,179
protected function getConfirmLibrary ( $ bReturnDefault = false ) { if ( ( $ this -> sConfirmLibrary ) && ( $ library = $ this -> getLibrary ( $ this -> sConfirmLibrary ) ) && ( $ library instanceof Confirm ) ) { return $ library ; } if ( ( $ sName = $ this -> getOption ( 'dialogs.default.confirm' , '' ) ) && ( $ library = $ this -> getLibrary ( $ sName ) ) && ( $ library instanceof Confirm ) ) { return $ library ; } return ( $ bReturnDefault ? $ this -> getPluginManager ( ) -> getDefaultConfirm ( ) : null ) ; }
Get the library adapter to use for confirmation .
17,180
protected function getLibrariesInUse ( ) { $ aNames = $ this -> getOption ( 'dialogs.libraries' , array ( ) ) ; if ( ! is_array ( $ aNames ) ) { $ aNames = array ( ) ; } $ libraries = array ( ) ; foreach ( $ aNames as $ sName ) { if ( ( $ library = $ this -> getLibrary ( $ sName ) ) ) { $ libraries [ $ library -> getName ( ) ] = $ library ; } } if ( ( $ library = $ this -> getModalLibrary ( ) ) ) { $ libraries [ $ library -> getName ( ) ] = $ library ; } if ( ( $ library = $ this -> getAlertLibrary ( ) ) ) { $ libraries [ $ library -> getName ( ) ] = $ library ; } if ( ( $ library = $ this -> getConfirmLibrary ( ) ) ) { $ libraries [ $ library -> getName ( ) ] = $ library ; } return $ libraries ; }
Get the list of library adapters that are present in the configuration .
17,181
public function getJs ( ) { if ( ! $ this -> includeAssets ( ) ) { return '' ; } $ libraries = $ this -> getLibrariesInUse ( ) ; $ code = '' ; foreach ( $ libraries as $ library ) { $ code .= "\n" . $ library -> getJs ( ) . "\n" ; } return $ code ; }
Return the javascript header code and file includes
17,182
public function getCss ( ) { if ( ! $ this -> includeAssets ( ) ) { return '' ; } $ libraries = $ this -> getLibrariesInUse ( ) ; $ code = '' ; foreach ( $ libraries as $ library ) { $ code .= $ library -> getCss ( ) . "\n" ; } return $ code ; }
Return the CSS header code and file includes
17,183
public function success ( $ message , $ title = null ) { return $ this -> getAlertLibrary ( true ) -> success ( ( string ) $ message , ( string ) $ title ) ; }
Print a success message .
17,184
public function info ( $ message , $ title = null ) { return $ this -> getAlertLibrary ( true ) -> info ( ( string ) $ message , ( string ) $ title ) ; }
Print an information message .
17,185
public function warning ( $ message , $ title = null ) { return $ this -> getAlertLibrary ( true ) -> warning ( ( string ) $ message , ( string ) $ title ) ; }
Print a warning message .
17,186
public function error ( $ message , $ title = null ) { return $ this -> getAlertLibrary ( true ) -> error ( ( string ) $ message , ( string ) $ title ) ; }
Print an error message .
17,187
public function setIcontactProspectStatusTypeId ( int $ nb_icontact_prospect_status_type_id ) : CNabuDataObject { if ( $ nb_icontact_prospect_status_type_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_icontact_prospect_status_type_id" ) ) ; } $ this -> setValue ( 'nb_icontact_prospect_status_type_id' , $ nb_icontact_prospect_status_type_id ) ; return $ this ; }
Sets the Icontact Prospect Status Type Id attribute value .
17,188
public function setLanguageId ( int $ nb_language_id ) : CNabuDataObject { if ( $ nb_language_id === null ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_NULL_VALUE_NOT_ALLOWED_IN , array ( "\$nb_language_id" ) ) ; } $ this -> setValue ( 'nb_language_id' , $ nb_language_id ) ; return $ this ; }
Sets the Language Id attribute value .
17,189
public function getAll ( array $ queryParams = [ ] ) { $ response = $ this -> api -> callbacks ( ) -> getAll ( $ queryParams ) ; return new CallbacksResponse ( $ response ) ; }
Get all callbacks
17,190
public function getById ( $ callbackId , array $ queryParams = [ ] ) { $ response = $ this -> api -> callbacks ( ) -> getById ( $ callbackId , $ queryParams ) ; return new CallbackResponse ( $ response ) ; }
Get callback by id
17,191
public function create ( CallbackBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> callbacks ( ) -> create ( $ input -> toArray ( ) , $ queryParams ) ; return new CallbackResponse ( $ response ) ; }
Create a new callback
17,192
public function update ( $ callbackId , CallbackBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> callbacks ( ) -> update ( $ callbackId , $ input -> toArray ( ) , $ queryParams ) ; return new CallbackResponse ( $ response ) ; }
Update an existing callback
17,193
public function deleteAll ( array $ queryParams = [ ] ) { $ response = $ this -> api -> callbacks ( ) -> deleteAll ( $ queryParams ) ; return new BaseResponse ( $ response ) ; }
Delete all callbacks
17,194
public function deleteById ( $ callbackId , array $ queryParams = [ ] ) { $ response = $ this -> api -> callbacks ( ) -> deleteById ( $ callbackId , $ queryParams ) ; return new BaseResponse ( $ response ) ; }
Delete callback by id
17,195
public function equals ( ValueObjectContract $ valueObject ) { foreach ( get_object_vars ( $ this ) as $ name => $ value ) { if ( $ this -> { $ name } !== $ valueObject -> { $ name } ) { return false ; } } return true ; }
Compare two value objects .
17,196
public function get ( $ appId , $ profileId , array $ queryParams ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> settings ( ) -> get ( $ appId , $ profileId , $ queryParams ) ; return new SettingResponse ( $ response ) ; }
Get settings for a profile profile
17,197
public function update ( $ appId , $ profileId , SettingBuilder $ input , array $ queryParams = [ ] ) { $ response = $ this -> api -> applications ( ) -> profiles ( ) -> settings ( ) -> update ( $ appId , $ profileId , $ input -> toArray ( ) , $ queryParams ) ; return new SettingResponse ( $ response ) ; }
Update settings for profile profile
17,198
public function withEntry ( string $ languageTag , string $ value ) : self { $ languageMap = clone $ this ; $ languageMap -> map [ $ languageTag ] = $ value ; return $ languageMap ; }
Creates a new language map based on the current map including the given entry .
17,199
public function getAll ( array $ queryParams = [ ] ) { $ response = $ this -> api -> activities ( ) -> getAll ( $ queryParams ) ; return new ActivitiesResponse ( $ response ) ; }
Get all activities