idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
54,100
public static function invokeSoap ( $ wsdlURL , $ method , array $ params = array ( ) , array $ options = array ( ) ) { try { $ soapClient = new \ SoapClient ( $ wsdlURL , $ options ) ; $ result = $ soapClient -> $ method ( $ params ) ; } catch ( \ SoapFault $ ex ) { $ result = false ; } return $ result ; }
Invoke SOAP method
54,101
public function fromUdb2Item ( CultureFeed_Cdb_Item_Base $ item ) { $ dutch = new Language ( 'nl' ) ; $ dutchDetail = $ item -> getDetails ( ) -> getDetailByLanguage ( 'nl' ) ; $ title = $ dutchDetail -> getTitle ( ) ; return $ this -> fromUdb2Media ( $ dutchDetail -> getMedia ( ) , new Description ( $ title ) , new Co...
Create an ImageCollection from the media in the Dutch details of on an UDB2 item .
54,102
protected function outputFormat ( $ data , $ default = null ) { switch ( $ this -> getParam ( array ( 'f' ) , $ default ) ) { case 'print-r' : $ this -> line ( print_r ( $ data , true ) ) ; break ; case 'var-export' : $ this -> line ( var_export ( $ data , true ) ) ; break ; case 'json' : $ this -> line ( json_encode (...
Output formatted data
54,103
protected function getLimit ( array $ default_limit = array ( ) ) { if ( empty ( $ default_limit ) ) { $ default_limit = $ this -> config -> get ( 'module_cli_limit' , array ( 0 , 100 ) ) ; } $ limit = $ this -> getParam ( 'l' ) ; if ( ! isset ( $ limit ) || ! is_numeric ( $ limit ) ) { return $ default_limit ; } $ exp...
Returns an array of limits form the limit option or a default value
54,104
protected function explodeList ( $ value , $ separator = null ) { if ( is_array ( $ value ) ) { return $ value ; } if ( $ value === '' || ! is_string ( $ value ) ) { return array ( ) ; } if ( ! isset ( $ separator ) ) { $ separator = $ this -> config -> get ( 'module_cli_list_separator' , '|' ) ; } return array_map ( '...
Explode a string using a separator character
54,105
protected function setSubmittedJson ( $ field ) { $ json = $ this -> getSubmitted ( $ field ) ; if ( isset ( $ json ) ) { $ decoded = json_decode ( $ json , true ) ; if ( json_last_error ( ) === JSON_ERROR_NONE ) { $ this -> setSubmitted ( $ field , $ decoded ) ; } else { $ decoded = json_decode ( base64_decode ( $ jso...
Convert a submitted JSON string into an array or FALSE on error
54,106
protected function setSubmittedList ( $ field ) { $ value = $ this -> getSubmitted ( $ field ) ; if ( isset ( $ value ) ) { $ this -> setSubmitted ( $ field , $ this -> explodeList ( $ value ) ) ; } }
Converts a submitted string into an array using a character as an separator
54,107
protected function validatePromptList ( $ field , $ label , $ validator , $ default = null ) { $ input = $ this -> prompt ( $ label , $ default ) ; if ( $ this -> isValidInput ( $ this -> explodeList ( $ input ) , $ field , $ validator ) ) { $ this -> setSubmitted ( $ field , $ input ) ; } else { $ this -> errors ( ) ;...
Validate prompt input when dealing with multiple values separated by a list character
54,108
public function fetch ( array $ params = [ ] , AssetManagerInterface $ assetManager = null ) { $ asset = $ this -> asset ; $ this -> set ( $ params ) ; return $ this -> validate ( $ asset ( $ this , $ assetManager ) ) ; }
Validate and retrieve an instantiated asset .
54,109
public function merge ( \ sndsgd \ Form ... $ forms ) : Form { foreach ( $ forms as $ form ) { $ fields = array_values ( $ form -> getFields ( ) ) ; $ this -> addFields ( ... $ fields ) ; } return $ this ; }
Merge the fields of one or more forms into this one
54,110
static public function isValidSelectionMode ( $ mode , $ throw = false ) { $ valid = in_array ( $ mode , [ static :: SELECTION_SINGLE , static :: SELECTION_MULTIPLE , ] , true ) ; if ( ! $ valid && $ throw ) { throw new Exception \ InvalidArgumentException ( "Invalid selection mode '{$mode}'." ) ; } return $ valid ; }
Returns whether the given selection mode is valid or not .
54,111
static public function validateName ( $ name ) { if ( null !== $ name && ! is_string ( $ name ) ) { throw new Exception \ UnexpectedTypeException ( $ name , 'string, integer or null' ) ; } if ( ! preg_match ( '/^[a-zA-Z0-9_]+$/' , $ name ) ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'The name "%s" co...
Validates whether the given variable is a valid name .
54,112
public function isThreat ( DataInterface $ data ) { $ response = $ this -> client -> post ( self :: API_ENDPOINT , [ 'secret' => $ this -> secret , 'response' => $ data -> getValue ( ) , ] ) ; if ( ! $ response -> isSuccess ( ) ) { return true ; } $ validation = json_decode ( $ response -> getBody ( ) ) ; if ( is_null ...
Flags if the used Control impl detected a threat
54,113
private function loadDelegates ( $ entity ) { if ( ! $ this instanceof LazyLoaderInterface ) { return $ entity ; } if ( ! $ entity instanceof LazyPropertiesInterface ) { throw new \ InvalidArgumentException ( sprintf ( '%s objects cannot be hydrated with properties loading delegates without implementing %s.' , get_clas...
Hydrate lazy loads delegate into given Collectionnable if enabled and if entity supports it .
54,114
public function get_large_object ( $ key ) { $ encoded = $ this -> get ( $ key ) ; if ( false === $ encoded ) { return false ; } $ uncompressed = @ \ gzdecode ( \ base64_decode ( $ encoded ) ) ; if ( false === $ uncompressed ) { return false ; } return $ this -> maybe_fix_object ( \ unserialize ( $ uncompressed ) ) ; }
Retrieves a cached large object .
54,115
public function set_large_object ( $ key , $ value , $ duration = 0 ) { $ compressed = \ gzencode ( \ serialize ( $ value ) ) ; if ( false === $ compressed ) { return false ; } return $ this -> set ( $ key , \ base64_encode ( $ compressed ) , $ duration ) ; }
Sets a transient for a large PHP object . The object will be stored in serialized and gzip encoded form using Base64 encoding to ensure binary safety .
54,116
protected function setFiles ( array $ files ) { foreach ( $ files as $ associativeName => $ details ) { foreach ( $ details as $ fileKey => $ detail ) { $ this -> files [ $ fileKey ] [ $ associativeName ] = $ detail ; } } }
store the request files in a nice way
54,117
public function getActionClassByName ( $ name ) { if ( method_exists ( $ this , 'actions' ) ) { $ actions = $ this -> actions ( ) ; if ( ! empty ( $ actions [ $ name ] ) && class_exists ( $ actions [ $ name ] ) && is_subclass_of ( $ actions [ $ name ] , '\Micro\Mvc\Action' ) ) { return $ actions [ $ name ] ; } } return...
Get action class by name
54,118
public function confirmDeletionMultipleRows ( Request $ request ) { $ checkboxes = $ request -> input ( 'checkbox' ) ; if ( ! $ checkboxes ) { Session :: flash ( 'status_code' , 400 ) ; $ message = 'You have not selected any rows for deletion.' ; Session :: flash ( 'message' , $ message ) ; return Redirect :: route ( '...
Confirm multiple row deletions
54,119
public function getFieldLIst ( ) { if ( ! isset ( $ this -> model -> field_list ) ) { return $ this -> model -> getFieldList ( ) ; } return $ this -> model -> field_list ; }
get the Model s Field List
54,120
protected function loadDefinitionFromFile ( $ file ) { $ this -> checkFileExistence ( $ file ) ; list ( $ type , $ class ) = $ this -> getFileTypeClass ( $ file ) ; $ data = $ class :: loadFromFile ( $ file ) ; return $ type ? [ $ type => $ data ] : $ data ; }
Load definitions from a file
54,121
protected function getFileTypeClass ( $ filename ) { $ parts = explode ( '.' , strtolower ( basename ( $ filename ) ) ) ; $ count = count ( $ parts ) ; $ suffix = $ count > 1 ? $ parts [ $ count - 1 ] : 'php' ; $ type = $ count > 2 ? $ parts [ $ count - 2 ] [ 0 ] : '_' ; $ types = [ 's' => 'services' , 'p' => 'paramete...
Get definition type and loader class
54,122
protected function checkFileExistence ( $ file ) { if ( ! file_exists ( $ file ) || ! is_readable ( $ file ) ) { throw new NotFoundException ( Message :: get ( Message :: DEFINITION_NOT_FOUND , $ file ) , Message :: DEFINITION_NOT_FOUND ) ; } }
Check file exists and readable
54,123
protected function getLoaderClass ( $ suffix , $ filename ) { $ class = __NAMESPACE__ . '\\Loader' . ucfirst ( $ suffix ) ; if ( ! class_exists ( $ class ) ) { throw new LogicException ( Message :: get ( Message :: FILE_SUFFIX_UNKNOWN , $ filename ) , Message :: FILE_SUFFIX_UNKNOWN ) ; } return $ class ; }
Get loader class name base on suffix
54,124
public function setName ( $ name ) { $ this -> name = $ name ; if ( $ this -> node ) { $ this -> node -> name = $ name ; } }
Set the node name .
54,125
public function getInfo ( $ path = '.' ) { if ( ! $ this -> svnEnabled ) return false ; $ user = escapeshellarg ( $ this -> svnUsername ) ; $ pw = escapeshellarg ( $ this -> svnPassword ) ; $ creds = ! empty ( $ this -> svnUsername ) && ! empty ( $ this -> svnPassword ) ? "--username {$user} --password {$pw}" : "" ; $ ...
Performs an svn info on the provided path . Returns an array of SVN commit data or false on failure .
54,126
public function update ( $ path = '.' ) { if ( ! $ this -> svnEnabled ) return false ; $ user = escapeshellarg ( $ this -> svnUsername ) ; $ pw = escapeshellarg ( $ this -> svnPassword ) ; $ creds = ! empty ( $ this -> svnUsername ) && ! empty ( $ this -> svnPassword ) ? "--username {$user} --password {$pw}" : "" ; $ c...
performs an svn update of the path provided
54,127
public function copyPath ( $ fromPath , $ toPath , $ commitMessage ) { $ this -> _validateSvnConfig ( ) ; $ user = escapeshellarg ( $ this -> svnUsername ) ; $ pw = escapeshellarg ( $ this -> svnPassword ) ; $ fromPath = trim ( $ fromPath , '/' ) ; $ toPath = trim ( $ toPath , '/' ) ; $ fromPath = "{$this->svnRepositor...
Performs an svn copy of a repository path to another svn path in the same repository
54,128
protected function _validateSvnConfig ( ) { if ( ! $ this -> svnEnabled ) throw new SubversionToolsException ( "Subversion support must be enabled for this action!" ) ; if ( empty ( $ this -> svnUsername ) ) throw new SubversionToolsException ( "Property svn.username is required" ) ; if ( empty ( $ this -> svnPassword ...
validates that all properties needed to work with the svn repository are populated
54,129
final public function socketAccept ( $ socket = null ) { if ( is_resource ( $ socket ) ) { $ this -> socket = socket_accept ( $ socket ) ; return $ this -> socket ; } else { throw new InvalidArgumentException ( __METHOD__ . ' expects $socket to be an instance of resource. ' . gettype ( $ resource ) . ' given instead' )...
Creates a client side sockets from a server side one
54,130
final public function socketWrite ( $ message = '' , $ length = null ) { return @ socket_write ( $ this -> socket , "{$message}" , is_int ( $ length ) ? $ length : strlen ( $ message ) ) ; }
Write to client socket
54,131
public function toSQL ( Parameters $ params , bool $ inner_clause ) { $ scope = $ params -> getSubScope ( $ this -> scope_id ) ; $ this -> scope_id = $ scope -> getScopeID ( ) ; $ q = $ this -> getQuery ( ) ; return '(' . $ params -> getDriver ( ) -> toSQL ( $ scope , $ q , false ) . ')' ; }
Write a sub query as SQL query syntax
54,132
public function getViewEngine ( ) { if ( $ this -> app -> exists ( ViewEngineInterface :: class ) ) { return $ this -> app -> get ( ViewEngineInterface :: class ) ; } $ view = View :: forge ( $ this -> web -> view_dir ) ; $ this -> app -> set ( ViewEngineInterface :: class , $ view , true ) ; return $ view ; }
get shared view engine Renderer as default .
54,133
public function getErrorView ( ) { if ( $ this -> app -> exists ( ErrorView :: class ) ) { return $ this -> app -> get ( ErrorView :: class ) ; } $ error_files = ( array ) $ this -> app -> get ( Web :: ERROR_VIEWS ) ; if ( empty ( $ error_files ) ) { $ this -> app -> set ( ErrorView :: class , null , true ) ; return nu...
get error view render ErrorView
54,134
protected function registerManager ( ) { $ this -> app -> singleton ( 'afroware.jwT.manager' , function ( $ app ) { $ instance = new Manager ( $ app [ 'afroware.jwT.provider.jwT' ] , $ app [ 'afroware.jwT.blacklist' ] , $ app [ 'afroware.jwT.payload.factory' ] ) ; return $ instance -> setBlacklistEnabled ( ( bool ) $ t...
Register the bindings for the JwT Manager .
54,135
protected function registerClaimFactory ( ) { $ this -> app -> singleton ( 'afroware.jwT.claim.factory' , function ( $ app ) { $ factory = new ClaimFactory ( $ app [ 'request' ] ) ; $ app -> refresh ( 'request' , $ factory , 'setRequest' ) ; return $ factory -> setTTL ( $ this -> config ( 'ttl' ) ) ; } ) ; }
Register the bindings for the Claim Factory .
54,136
public function isAuthenticatedByRole ( Role $ role ) { return ! isset ( $ this -> auth ) || $ this -> auth === $ role -> getRoleName ( ) ; }
check whether a role matches the auth attribute of the menu entry
54,137
public function getHref ( ) { if ( is_null ( $ this -> href ) ) { if ( $ this -> localPage ) { $ pathSegments = [ ] ; $ e = $ this ; do { $ pathSegments [ ] = $ e -> path ; } while ( $ e = $ e -> menu -> getParentEntry ( ) ) ; if ( Application :: getInstance ( ) -> getRouter ( ) -> getServerSideRewrite ( ) ) { if ( ( $...
get href attribute value of menu entry
54,138
public function arrayToJson ( $ content = null ) { if ( $ this -> getJsonEncodeArray ( ) && is_array ( $ content ) ) { $ this -> header ( 'Content-Type: application/json' ) ; return json_encode ( $ content ) ; } return $ content ; }
Encode array to json if configured
54,139
public function objectToJson ( $ content = null ) { if ( $ this -> getJsonEncodeObject ( ) && is_object ( $ content ) ) { if ( method_exists ( $ content , '__toString' ) ) { return ( string ) $ content ; } if ( method_exists ( $ content , 'toJson' ) ) { $ this -> header ( 'Content-Type: application/json' ) ; return jso...
Encode object to json if configured
54,140
public function printRecursiveNonAlphaNum ( $ content = null ) { if ( is_array ( $ content ) || is_object ( $ content ) ) { ob_start ( ) ; if ( php_sapi_name ( ) != 'cli' && ! defined ( 'STDIN' ) ) { d ( $ content ) ; } else { var_dump ( $ content ) ; } $ content = ob_get_contents ( ) ; ob_end_clean ( ) ; } return $ co...
Does a print_r with objects and array recursive
54,141
public function getReport ( ) { if ( isset ( $ this -> centrifuge ) && $ this -> centrifuge ) { $ this -> report -> setCentrifuge ( $ this -> centrifuge ) ; } return $ this -> report ; }
Returns report object providing various functions to work with detected results . Also the centrifuge data is being set as property of the report object .
54,142
public function getReplacedCount ( ) : int { return intval ( array_reduce ( $ this -> fieldResultList , function ( int $ count , FieldReplaceResult $ fieldResult ) { return $ count + $ fieldResult -> getReplacedCount ( ) ; } , 0 ) ) ; }
Get the number of replacements in all fields in this row .
54,143
public function getErrorList ( ) : array { $ errorList = $ this -> errorList ; foreach ( $ this -> fieldResultList as $ fieldResult ) { foreach ( $ fieldResult -> getErrorList ( ) as $ error ) { $ errorList [ ] = $ error ; } } return $ errorList ; }
Get any replacement errors .
54,144
public function get ( $ key , $ default = '' ) { if ( ! is_null ( $ this -> _env ) ) { $ item = ( $ this -> has ( $ key ) ) ? getenv ( $ key ) : $ default ; if ( is_numeric ( $ item ) ) { if ( strrpos ( $ item , '.' ) !== false ) { return floatval ( $ item ) ; } else { return intval ( $ item ) ; } } switch ( $ item ) {...
Gets an environment variable .
54,145
protected function getPath ( $ key ) { if ( ( $ pos = strrpos ( $ key , '/' ) ) !== false ) { $ dir = $ this -> dir_root . DIRECTORY_SEPARATOR . substr ( $ key , 0 , $ pos ) . DIRECTORY_SEPARATOR ; $ key = substr ( $ key , $ pos + 1 ) ; } else { $ dir = $ this -> dir_root . DIRECTORY_SEPARATOR ; } if ( is_callable ( $ ...
Get path base on key .
54,146
protected function hashIt ( $ key ) { $ md5 = md5 ( $ key ) ; $ hash = $ this -> file_pref . $ md5 . $ this -> file_suff ; if ( ! $ this -> hash_level ) { return $ hash ; } $ pref = '' ; for ( $ i = 0 ; $ i < $ this -> hash_level ; $ i ++ ) { $ pref .= $ md5 [ $ i ] . '/' ; } return $ pref . $ hash ; }
Get hashed filename
54,147
protected function deleteFromDir ( $ dir , $ maxlife = 0 , $ removeDir = false ) { $ now = time ( ) ; if ( is_dir ( $ dir ) ) { $ files = scandir ( $ dir ) ; foreach ( $ files as $ file ) { if ( $ file == "." || $ file == ".." ) { continue ; } $ sub = $ dir . DIRECTORY_SEPARATOR . $ file ; $ res = true ; if ( is_dir ( ...
Remove all contents under one directory
54,148
public function register ( ) { $ this -> app -> register ( \ Laravel \ Passport \ PassportServiceProvider :: class ) ; $ this -> app -> register ( \ Railken \ Amethyst \ Providers \ ApiServiceProvider :: class ) ; $ this -> app -> register ( \ Railken \ Amethyst \ Providers \ UserServiceProvider :: class ) ; $ this -> ...
Register any application services . so .
54,149
public static function getCountyID ( $ county ) { if ( in_array ( $ county , self :: $ counties ) ) { $ names = array_keys ( self :: $ counties , $ county ) ; return $ names [ 0 ] ; } return false ; }
Returns the id of a given county name
54,150
public static function getCountyName ( $ id ) { if ( is_numeric ( $ id ) && array_key_exists ( intval ( $ id ) , self :: $ counties ) ) { return self :: $ counties [ intval ( $ id ) ] ; } return false ; }
Returns the county name of a given county id
54,151
protected function metaString ( ) : string { if ( ! $ this -> meta ) { return '' ; } return \ join ( ' ' , \ array_map ( function ( string $ key , $ value ) : string { return $ this -> slugify ( $ key ) . '="' . $ this -> escape -> attr ( $ value ) . '"' ; } , \ array_keys ( $ this -> meta ) , \ array_values ( $ this -...
Convert meta to string
54,152
protected function equiv ( $ a , $ b ) : bool { if ( \ is_array ( $ a ) && \ is_scalar ( $ b ) ) { return \ in_array ( $ b , $ a ) ; } if ( \ is_array ( $ b ) && \ is_scalar ( $ a ) ) { return \ in_array ( $ a , $ b ) ; } return ( $ a == $ b ) ; }
Are two values equivalent .
54,153
public function addRunner ( $ name , WorkerRunnerInterface $ runner , array $ options = array ( ) ) { $ this -> runners [ $ name ] = array ( 'runner' => $ runner , 'options' => $ options , ) ; }
Register runner .
54,154
public function run ( $ name , OutputInterface $ output = null ) { if ( ! $ this -> has ( $ name ) ) { throw new InvalidArgumentException ( "No runner service registered for provided name." ) ; } $ runner = $ this -> runners [ $ name ] [ 'runner' ] ; $ runner -> run ( $ this -> runners [ $ name ] [ 'options' ] , $ outp...
Run worker .
54,155
public function insertSnippet ( Plugin $ plugin , $ text , & $ log = '' ) { $ snippetProperties = $ this -> readProperties ( $ text ) ; $ configContents = file_get_contents ( $ this -> configFileLocation ) ; if ( stripos ( $ configContents , "BEGIN PLUGIN CONFIG: {$plugin->Slug}" ) === false ) { $ configContents .= "\n...
Write the specified text to the config file
54,156
public function readProperties ( $ config = null , $ filter = null ) { if ( is_null ( $ config ) ) $ config = file_get_contents ( $ this -> configFileLocation ) ; $ props = preg_match_all ( '/\s*\$properties\[[\'\"]([^\"^\']+)[\'\"]\]\s*=\s*(.*?);[\n\r\t]?/s' , $ config , $ m ) ; $ config = array ( ) ; foreach ( $ m [ ...
Parses the properties file .
54,157
public function saveContents ( $ contents ) { $ path = pathinfo ( $ this -> configFileLocation ) ; $ backup = $ this -> backupPath . '/pluginconfig.' . date ( 'Y_m_d_His' ) . '.php' ; FileSystemUtils :: safeCopy ( $ this -> configFileLocation , $ backup ) ; FileSystemUtils :: safeFilePutContents ( $ this -> configFileL...
Writes the contents to the config file after first backing up the current config
54,158
public function header ( ) { $ args = func_get_args ( ) ; $ name = $ args [ 0 ] ; if ( count ( $ args ) == 2 ) { $ this -> headers [ $ name ] = $ args [ 1 ] ; } return $ this -> headers [ $ name ] ; }
Get and optionally set a header .
54,159
public function url ( ) { $ url = $ this -> client -> endpoint ( ) . $ this -> resource . '.json' ; if ( in_array ( $ this -> method , [ 'GET' , 'DELETE' ] ) && $ this -> params !== null ) { $ url .= '?' . http_build_query ( $ this -> params ) ; } return $ url ; }
Return the request url .
54,160
public function send ( ) { $ url = $ this -> url ( ) ; $ this -> curl = curl_init ( ) ; curl_setopt ( $ this -> curl , CURLOPT_CUSTOMREQUEST , $ this -> method ) ; if ( in_array ( $ this -> method , [ 'POST' , 'PUT' ] ) ) { $ this -> buildBody ( ) ; } else { $ this -> header ( 'Content-Type' , null ) ; } curl_setopt ( ...
Make a request and return the response data if successful .
54,161
protected function buildBody ( ) { if ( count ( $ this -> files ( ) ) ) { $ body = [ ] ; foreach ( $ this -> params as $ key => $ value ) { $ body [ ] = implode ( "\r\n" , [ "Content-Disposition: form-data; name=\"{$key}\"" , "" , $ value ] ) ; } foreach ( $ this -> files as $ key => $ path ) { $ file = new File ( $ pa...
Build the request body .
54,162
public function cmdGetTrigger ( ) { $ result = $ this -> getListTrigger ( ) ; $ this -> outputFormat ( $ result ) ; $ this -> outputFormatTableTrigger ( $ result ) ; $ this -> output ( ) ; }
Callback for trigger - get command
54,163
public function cmdUpdateTrigger ( ) { $ params = $ this -> getParam ( ) ; if ( empty ( $ params [ 0 ] ) || count ( $ params ) < 2 ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid command' ) ) ; } if ( ! is_numeric ( $ params [ 0 ] ) ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid argument' ) ) ; } $ this ...
Callback for trigger - update command
54,164
protected function addTrigger ( ) { if ( ! $ this -> isError ( ) ) { $ state_id = $ this -> trigger -> add ( $ this -> getSubmitted ( ) ) ; if ( empty ( $ state_id ) ) { $ this -> errorAndExit ( $ this -> text ( 'Unexpected result' ) ) ; } $ this -> line ( $ state_id ) ; } }
Add a new trigger
54,165
protected function submitAddTrigger ( ) { $ this -> setSubmitted ( null , $ this -> getParam ( ) ) ; $ this -> setSubmitted ( 'data.conditions' , $ this -> getSubmitted ( 'conditions' ) ) ; $ this -> setSubmittedList ( 'data.conditions' ) ; $ this -> validateComponent ( 'trigger' ) ; $ this -> addTrigger ( ) ; }
Add a new trigger at once
54,166
protected function wizardAddTrigger ( ) { $ this -> validatePrompt ( 'name' , $ this -> text ( 'Name' ) , 'trigger' ) ; $ this -> validatePrompt ( 'store_id' , $ this -> text ( 'Store' ) , 'trigger' ) ; $ this -> validatePromptList ( 'data.conditions' , $ this -> text ( 'Conditions' ) , 'trigger' ) ; $ this -> validate...
Add a trigger step by step
54,167
public function getIdentity ( ) { if ( $ this -> hasIdentity ( ) ) { if ( $ this -> identity === null ) { $ identity = $ this -> authenticationService -> getIdentity ( ) ; $ identity = array_merge ( $ identity , $ this -> getOption ( 'identity' ) ) ; if ( $ this -> getServiceBroker ( ) -> exists ( 'User' ) ) { $ userSe...
Returns the identity or null if no identity is available
54,168
public function getStorage ( ) { if ( ! $ this -> storage && $ this -> getServiceLocator ( ) -> has ( self :: STORAGE_LOCATOR_KEY ) ) { $ this -> setStorage ( $ this -> getServiceLocator ( ) -> get ( self :: STORAGE_LOCATOR_KEY ) ) ; } return $ this -> storage ; }
Retrieve storage instance
54,169
protected function getAuthenticationService ( ) { if ( $ this -> authenticationService === null ) { $ this -> authenticationService = new AuthenticationService ( $ this -> getStorage ( ) ) ; } return $ this -> authenticationService ; }
Retrieve AuthenticationService instance
54,170
protected function expectNumberNotZeroForDivision ( $ number , $ message = '' ) { $ this -> expectValidNumber ( $ number , $ message ) ; if ( $ number == 0 ) { throw new DivideByZeroException ( $ message ) ; } }
Expects a number not to be zero when using for division .
54,171
public function addHash ( $ options ) { if ( is_string ( $ options ) ) { $ options = array ( $ options ) ; } else if ( ! is_array ( $ options ) ) { throw new Zend_Validate_Exception ( "False parameter given" ) ; } $ known = hash_algos ( ) ; if ( ! isset ( $ options [ 'algorithm' ] ) ) { $ algorithm = 'crc32' ; } else {...
Adds the hash for one or multiple files
54,172
public function index ( ) { $ this -> authorize ( DashboardPolicy :: PERMISSION_STATS ) ; $ this -> setTitle ( trans ( 'blog::dashboard.titles.statistics' ) ) ; return $ this -> view ( 'admin.dashboard' ) ; }
Get the dashboard page .
54,173
public function flash ( $ message = null , $ type = null ) { if ( $ message !== null ) $ this -> attributes [ 'message' ] = ( array ) $ message ; if ( $ type !== null ) $ this -> attributes [ 'type' ] = $ type ; $ this -> session -> flash ( 'notifier' , $ this -> attributes ) ; }
Save the setup to a session flash .
54,174
protected function runQuery ( $ raw_query , $ id ) { $ query = str_replace ( ':id' , $ id , $ raw_query ) ; $ start = microtime ( true ) ; $ results = DB :: getReadPdo ( ) -> query ( $ query ) -> fetchAll ( \ PDO :: FETCH_OBJ ) ; DB :: logQuery ( $ raw_query , [ $ id ] , round ( ( microtime ( true ) - $ start ) * 1000 ...
Execute the query with the current PDO connection . Will log the time taken manually
54,175
protected function assembleQuery ( $ initial , $ recursive ) { $ tmp_tbl = 'name_tree' ; $ recursive = str_replace ( ':tmp_tbl' , $ tmp_tbl , $ recursive ) ; $ final = "select distinct * from $tmp_tbl" ; if ( DB :: connection ( ) -> getDriverName ( ) == 'mysql' ) { return "Call WITH_EMULATOR('$tmp_tbl', '$initial', '$r...
Prepare the complete query to run on the DB to get the data recursively .
54,176
public function getConfig ( ) { $ config = false ; if ( file_exists ( realpath ( __DIR__ . "/../ExactTargetLaravelConfig.php" ) ) ) { $ config = include __DIR__ . "/../ExactTargetLaravelConfig.php" ; return $ config ; } return $ config ; }
Gets the Configuration
54,177
public function refreshToken ( $ forceRefresh = false ) { if ( property_exists ( $ this , "sdl" ) && $ this -> sdl == 0 ) { parent :: __construct ( $ this -> xmlLoc , array ( 'trace' => 1 , 'exceptions' => 0 ) ) ; } try { $ currentTime = new DateTime ( ) ; if ( is_null ( $ this -> getAuthTokenExpiration ( $ this -> ten...
Gets the refresh token using the authentication URL .
54,178
public function setAuthToken ( $ tenantKey , $ authToken , $ authTokenExpiration ) { if ( $ this -> tenantTokens [ $ tenantKey ] == null ) { $ this -> tenantTokens [ $ tenantKey ] = array ( ) ; } $ this -> tenantTokens [ $ tenantKey ] [ 'authToken' ] = $ authToken ; $ this -> tenantTokens [ $ tenantKey ] [ 'authTokenEx...
Set the authentication token in the tenantTokens array .
54,179
public function getAuthTokenExpiration ( $ tenantKey ) { $ tenantKey = $ tenantKey == null ? $ this -> tenantKey : $ tenantKey ; if ( $ this -> tenantTokens [ $ tenantKey ] == null ) { $ this -> tenantTokens [ $ tenantKey ] = array ( ) ; } return isset ( $ this -> tenantTokens [ $ tenantKey ] [ 'authTokenExpiration' ] ...
Get the Auth Token Expiration .
54,180
public function setInternalAuthToken ( $ tenantKey , $ internalAuthToken ) { if ( $ this -> tenantTokens [ $ tenantKey ] == null ) { $ this -> tenantTokens [ $ tenantKey ] = array ( ) ; } $ this -> tenantTokens [ $ tenantKey ] [ 'internalAuthToken' ] = $ internalAuthToken ; }
Set the internal auth tokan .
54,181
public function setRefreshToken ( $ tenantKey , $ refreshToken ) { if ( $ this -> tenantTokens [ $ tenantKey ] == null ) { $ this -> tenantTokens [ $ tenantKey ] = array ( ) ; } $ this -> tenantTokens [ $ tenantKey ] [ 'refreshToken' ] = $ refreshToken ; }
Set the refresh authentication token .
54,182
public function getRefreshToken ( $ tenantKey ) { $ tenantKey = $ tenantKey == null ? $ this -> tenantKey : $ tenantKey ; if ( $ this -> tenantTokens [ $ tenantKey ] == null ) { $ this -> tenantTokens [ $ tenantKey ] = array ( ) ; } return isset ( $ this -> tenantTokens [ $ tenantKey ] [ 'refreshToken' ] ) ? $ this -> ...
Get the refresh token for the tenant .
54,183
public function AddSubscriberToList ( $ emailAddress , $ listIDs , $ subscriberKey = null ) { $ newSub = new ET_Subscriber ; $ newSub -> authStub = $ this ; $ lists = array ( ) ; foreach ( $ listIDs as $ key => $ value ) { $ lists [ ] = array ( "ID" => $ value ) ; } $ newSub -> props = array ( "EmailAddress" => $ email...
Add subscriber to list .
54,184
public function CreateDataExtensions ( $ dataExtensionDefinitions ) { $ newDEs = new ET_DataExtension ( ) ; $ newDEs -> authStub = $ this ; $ newDEs -> props = $ dataExtensionDefinitions ; $ postResponse = $ newDEs -> post ( ) ; return $ postResponse ; }
Create a new data extension based on the definition passed
54,185
public function SendTriggeredSends ( $ arrayOfTriggeredRecords ) { $ sendTS = new ET_TriggeredSend ( ) ; $ sendTS -> authStub = $ this ; $ sendTS -> props = $ arrayOfTriggeredRecords ; $ sendResponse = $ sendTS -> send ( ) ; return $ sendResponse ; }
Starts an send operation for the TriggerredSend records
54,186
public function SendEmailToDataExtension ( $ emailID , $ sendableDataExtensionCustomerKey , $ sendClassficationCustomerKey ) { $ email = new ET_Email_SendDefinition ( ) ; $ email -> props = array ( "Name" => uniqid ( ) , "CustomerKey" => uniqid ( ) , "Description" => "Created with FuelSDK" ) ; $ email -> props [ "SendC...
Create an email send definition send the email based on the definition and delete the definition .
54,187
public function CreateProfileAttributes ( $ allAttributes ) { $ attrs = new ET_ProfileAttribute ( ) ; $ attrs -> authStub = $ this ; $ attrs -> props = $ allAttributes ; return $ attrs -> post ( ) ; }
Create a profile attribute
54,188
public function CreateContentAreas ( $ arrayOfContentAreas ) { $ postC = new ET_ContentArea ( ) ; $ postC -> authStub = $ this ; $ postC -> props = $ arrayOfContentAreas ; $ sendResponse = $ postC -> post ( ) ; return $ sendResponse ; }
Create one or more content areas
54,189
public static function Create ( string $ folder , int $ mode = 0700 ) { if ( \ is_dir ( $ folder ) ) { return ; } if ( ! static :: CanCreate ( $ folder ) ) { throw new FolderAccessError ( 'IO' , $ folder , FolderAccessError :: ACCESS_CREATE , 'Creation of folder fails cause base folder is not writable!' ) ; } try { if ...
Creates a new folder with defined mode . The mode only works on unixoid systems .
54,190
public static function ListFilteredFiles ( string $ folder , $ filter , bool $ recursive = false ) : array { $ files = array ( ) ; if ( ! \ is_dir ( $ folder ) ) { return $ files ; } if ( ! $ recursive ) { $ d = \ dir ( $ folder ) ; while ( false !== ( $ entry = $ d -> read ( ) ) ) { if ( $ entry == '.' || $ entry == '...
Returns all files matching the defined filter .
54,191
final public function slice ( $ offset , $ length = null , $ preserve_keys = false ) { $ arr = array_unshift ( $ this -> { self :: MAGIC_PROPERTY } , $ offset , $ length , $ preserve_keys ) ; return static :: createFromArray ( $ arr ) ; }
Extract a slice of the array
54,192
final public function chunk ( $ size , $ preserve_keys = false ) { $ arr = array_chunk ( $ this -> { self :: MAGIC_PROPERTY } , $ size , $ preserve_keys ) ; return static :: createFromArray ( $ arr ) ; }
Split an array into chunks
54,193
final public function search ( $ needle , $ strict = false ) { return array_search ( $ needle , $ this -> { self :: MAGIC_PROPERTY } , $ strict ) ; }
Searches the array for a given value and returns the corresponding key if successful
54,194
final public function keys ( $ search_value = null , $ strict = false ) { if ( isset ( $ search_value ) ) { return static :: createFromArray ( array_keys ( $ this -> { self :: MAGIC_PROPERTY } , $ search_value , $ strict ) ) ; } else { return static :: createFromArray ( array_keys ( $ this -> { self :: MAGIC_PROPERTY }...
Return all the keys or a subset of the keys of an array
54,195
final public function replace ( ) { $ args = func_get_args ( ) ; array_unshift ( $ this -> { self :: MAGIC_PROPERTY } , $ args ) ; $ arr = call_user_func_array ( 'array_replace' , $ args ) ; return static :: createFromArray ( $ arr ) ; }
Replaces elements from passed arrays into the first array
54,196
final public function pad ( $ size , $ value ) { return static :: createFromArray ( array_pad ( $ this -> { self :: MAGIC_PROPERTY } , $ size , $ value ) ) ; }
Pad array to the specified length with a value
54,197
final public function multisort ( $ array1_sort_order = SORT_ASC , $ array1_sort_flags = SORT_REGULAR ) { return array_multisort ( $ this -> { self :: MAGIC_PROPERTY } , $ array1_sort_order , $ array1_sort_flags ) ; }
Sort multiple or multi - dimensional arrays
54,198
final public function unique ( $ sort_flags = SORT_STRING ) { $ arr = array_unique ( $ this -> { self :: MAGIC_PROPERTY } , $ sort_flags ) ; return static :: createFromArray ( $ arr ) ; }
Removes duplicate values from an array
54,199
final public function map ( Callable $ callback ) { $ arr = array_map ( $ callback , array_values ( $ this -> { self :: MAGIC_PROPERTY } ) , array_keys ( $ this -> { self :: MAGIC_PROPERTY } ) ) ; return static :: createFromArray ( $ arr ) ; }
Applies the callback to the elements of the array