idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
230,100
public function resolveParamName ( $ identifier ) { if ( ! isset ( $ this -> paramNames [ $ identifier ] ) ) { return $ identifier ; } return $ this -> paramNames [ $ identifier ] ; }
Resolve the parameter name
230,101
public function descendants ( $ includeSelf = false , $ depth = null ) { $ this -> getQuerySet ( ) -> descendants ( $ includeSelf , $ depth ) ; return $ this ; }
Named scope . Gets descendants for node .
230,102
public function ancestors ( $ includeSelf = false , $ depth = null ) { $ this -> getQuerySet ( ) -> ancestors ( $ includeSelf , $ depth ) ; return $ this ; }
Named scope . Gets ancestors for node .
230,103
public function rebuild ( ) { $ i = 0 ; $ skip = [ ] ; while ( 0 != $ this -> filter ( [ 'lft__isnull' => true ] ) -> count ( ) ) { ++ $ i ; $ fixed = 0 ; echo 'Iteration: ' . $ i . PHP_EOL ; $ clone = clone $ this ; $ models = $ clone -> exclude ( [ 'pk__in' => $ skip ] ) -> filter ( [ 'lft__isnull' => true ] ) -> ord...
Completely rebuild broken tree
230,104
public function detach ( string $ event , $ callback ) { if ( isset ( $ this -> listeners [ $ event ] ) ) { return $ this -> listeners [ $ event ] -> remove ( $ callback ) ; } return false ; }
Detaches a listener from an event
230,105
public function decorationTokens ( ) { if ( $ this -> decoration_tokens == null ) { $ dt = new DecorationTokenizer ( $ this -> label ) ; $ dt -> parse ( ) ; $ this -> decoration_tokens = $ dt -> tokens ; } return $ this -> decoration_tokens ; }
Returns an array of decoration tokens from the translation key
230,106
public function dataTokens ( ) { if ( $ this -> data_tokens == null ) { $ dt = new DataTokenizer ( $ this -> label ) ; $ this -> data_tokens = $ dt -> tokens ; } return $ this -> data_tokens ; }
Returns an array of data tokens from the translation key
230,107
protected function convertAmount ( OrderInterface $ order ) { $ amount = $ order -> getSummary ( ) -> getGrossAmount ( ) ; $ baseCurrency = $ order -> getCurrency ( ) ; return $ this -> getCurrencyHelper ( ) -> convert ( $ amount , $ baseCurrency ) ; }
Converts the order s gross total to target currency
230,108
private function cacheTranslations ( ) { $ this -> log ( "Downloading translations..." ) ; stream_wrapper_register ( "chdb" , '\Tr8n\Cache\Generators\ChdbStream' ) or die ( "Failed to register Chdb protocol for streaming Tr8n translation keys" ) ; $ fp = fopen ( "chdb://ChdbInMemory" , "r+" ) ; $ ch = curl_init ( ) ; $...
Caches translation keys
230,109
public function generateChdb ( ) { $ this -> extracted_at = new \ DateTime ( ) ; $ this -> log ( "Writing chdb file..." ) ; $ this -> log ( "File: " . $ this -> chdb_path ) ; $ success = chdb_create ( $ this -> chdb_path , $ this -> cache ) ; if ( ! $ success ) { fprintf ( STDERR , "Failed to create chdb file $this->ch...
Generates chdb database
230,110
public function search ( array $ filters ) { return $ this -> filter ( function ( CollectionableInterface $ entity ) use ( $ filters ) { $ res = true ; foreach ( $ filters as $ key => $ value ) { $ current = $ this -> getPropertyAccessor ( ) -> getValue ( $ entity , $ key ) ; $ res = $ res && ( is_array ( $ value ) ? i...
filter given collection on given fields .
230,111
public function sort ( \ Closure $ p ) { $ elements = $ this -> toArray ( ) ; if ( ! uasort ( $ elements , $ p ) ) { throw new \ InvalidArgumentException ( 'Sort failed.' ) ; } return new static ( array_values ( $ elements ) ) ; }
Sort collection with given closure .
230,112
public function reduce ( \ Closure $ p , $ initialValue = null ) { return array_reduce ( $ this -> toArray ( ) , $ p , $ initialValue ) ; }
Reduce collection with given closure .
230,113
public function indexBy ( $ field ) { $ elements = $ this -> toArray ( ) ; $ this -> clear ( ) ; foreach ( $ elements as $ element ) { $ this -> set ( $ this -> getFieldValue ( $ element , $ field ) , $ element ) ; } return $ this ; }
index collection by given object field .
230,114
public function column ( $ column ) { return $ this -> map ( function ( CollectionableInterface $ entity ) use ( $ column ) { return $ this -> getFieldValue ( $ entity , $ column ) ; } ) -> toArray ( ) ; }
Return value of inner objects given property as an array .
230,115
public function flatten ( $ indexColumn , $ valueColumn ) { return $ this -> reduce ( function ( $ carry , CollectionableInterface $ entity ) use ( $ indexColumn , $ valueColumn ) { $ carry [ $ this -> getFieldValue ( $ entity , $ indexColumn ) ] = $ this -> getFieldValue ( $ entity , $ valueColumn ) ; return $ carry ;...
Create a flattened view of collection as a key value array .
230,116
public function display ( $ column , $ slug = '", "' , $ format = '["%s"]' ) { return sprintf ( $ format , implode ( $ slug , $ this -> column ( $ column ) ) ) ; }
Returns a string representation of given column values .
230,117
public function totalPages ( ) { $ maxrows = ( ( $ m = $ this -> getParameter ( 'RowsPerPage' ) ) !== null ) ? $ m : $ this -> getLocal ( 'MaxRows' ) ; $ totalrecords = ( ( $ m = $ this -> getParameter ( 'TotalRecords' ) ) !== null ) ? $ m : $ this -> getLocal ( 'TotalRecords' ) ; if ( empty ( $ totalrecords ) ) return...
Returns the total number of pages
230,118
protected function _setCertConfigure ( ) { $ this -> certConfigure = [ 'config' => $ this -> typeConfigurations [ $ this -> type ] , 'x509_extensions' => $ this -> _getConfig ( 'x509_extensions' ) , 'private_key_bits' => $ this -> config [ 'default' ] [ 'private_key_bits' ] ] ; }
Load Default Configuration
230,119
public function getKeyPair ( $ file = false ) { $ pk = $ this -> _generatePK ( ) ; openssl_pkey_export ( $ pk , $ privKey , null , $ this -> certConfigure ) ; $ pubKey = openssl_pkey_get_details ( $ pk ) ; $ keys = new KeyPair ( ) ; $ keys -> setPrivateKey ( $ privKey ) -> setPublicKey ( $ pubKey [ 'key' ] ) ; if ( $ f...
Returns key pair
230,120
public function setType ( $ type , $ options = null ) { $ this -> type = $ type ; $ this -> _setCertConfigure ( ) ; return $ this ; }
Sets type of certificate
230,121
public function setCa ( $ name = null , $ password = null ) { $ this -> caName = $ name ; $ this -> caPassword = $ password ; return $ this ; }
Function SetCa Functions to set CA name to use for signing certificate
230,122
public function setName ( $ name = null ) { $ this -> fileName = $ this -> caDataRoot . $ name . DS ; if ( ! file_exists ( $ this -> fileName ) ) { mkdir ( $ this -> fileName , 0777 , true ) ; } return $ this ; }
Function SetName Set name of certificate file
230,123
public function sign ( ) { $ this -> crt = new SignedCertificate ( ) ; $ this -> _altConfiguration ( ) ; $ this -> crt -> setPrivateKey ( $ this -> _generatePK ( ) ) ; $ privKey = $ this -> crt -> getPrivateKey ( ) ; $ this -> crt -> setCsr ( openssl_csr_new ( $ this -> domainName ( ) -> get ( ) , $ privKey , $ this ->...
Sign certificate file and export tem to disk
230,124
public function createRequest ( ) { $ this -> crt = new SignedCertificate ( ) ; $ this -> crt -> setPrivateKey ( openssl_pkey_new ( $ this -> certConfigure ) ) ; $ privKey = $ this -> crt -> getPrivateKey ( ) ; $ this -> crt -> setCsr ( openssl_csr_new ( $ this -> domainName ( ) -> get ( ) , $ privKey , $ this -> certC...
Create request for server signing For Client App
230,125
public function signWithServer ( $ request ) { $ clientRequest = json_decode ( $ request ) ; $ this -> crt -> setSignedCert ( openssl_csr_sign ( $ clientRequest -> csr , $ this -> _getCaCert ( ) , $ this -> _getCaKey ( ) , $ this -> _getConfig ( 'daysvalid' ) , $ this -> certConfigure , time ( ) ) ) ; openssl_x509_expo...
Sign certificate from client request For Server app
230,126
public function getPrivateKey ( $ caName = null , $ caPassword = null ) { if ( $ caPassword !== null ) { return [ file_get_contents ( $ this -> caDataRoot . $ caName . DS . static :: PRIV_KEY_FILENAME ) , $ caPassword ] ; } return file_get_contents ( $ this -> caDataRoot . $ caName . DS . static :: PRIV_KEY_FILENAME ) ...
Method getCaKey Returns array for encrypted keys and string othervise
230,127
public static function fromString ( $ httpVersion ) : self { if ( empty ( $ httpVersion ) ) { throw new \ InvalidArgumentException ( 'Given HTTP version is empty' ) ; } $ major = null ; $ minor = null ; if ( 2 != sscanf ( $ httpVersion , 'HTTP/%d.%d' , $ major , $ minor ) ) { throw new \ InvalidArgumentException ( 'Giv...
parses http version from given string
230,128
public function equals ( $ httpVersion ) : bool { if ( empty ( $ httpVersion ) ) { return false ; } try { $ other = self :: castFrom ( $ httpVersion ) ; } catch ( \ InvalidArgumentException $ iae ) { return false ; } return $ this -> major ( ) === $ other -> major ( ) && $ this -> minor ( ) === $ other -> minor ( ) ; }
checks if given http version is equal to this http version
230,129
public function map ( Closure $ func ) { $ this -> guardAgainstInvalidGivenType ( ) ; $ elements = $ this -> collection -> map ( $ func ) -> toArray ( ) ; $ newCollection = $ this -> create ( ) ; foreach ( $ elements as $ key => $ element ) { try { $ newCollection -> set ( $ key , $ element ) ; } catch ( InvalidArgumen...
Applies the given public function to each element in the collection and returns a new collection with the elements returned by the function .
230,130
public function isSameAs ( Hstore $ compStore ) { $ thisArray = $ this -> jsonSerialize ( ) ; ksort ( $ thisArray ) ; $ compStore = $ compStore -> jsonSerialize ( ) ; ksort ( $ compStore ) ; return json_encode ( $ thisArray ) == json_encode ( $ compStore ) ; }
Compare two hstores
230,131
private function fromStringToArray ( $ str ) { $ p = 0 ; $ c = $ this -> charAfterSpaces ( $ str , $ p ) ; if ( $ c === false ) { return array ( ) ; } $ result = [ ] ; while ( true ) { $ c = $ this -> charAfterSpaces ( $ str , $ p ) ; if ( $ c === false ) { break ; } if ( $ c == ',' ) { $ p ++ ; continue ; } $ key = $ ...
Build a array from a postgres hstore string representation
230,132
private function readKeyValue ( $ str , & $ p ) { $ c = substr ( $ str , $ p , 1 ) ; if ( $ c != '"' ) { $ len = strcspn ( $ str , " \r\n\t,=>" , $ p ) ; $ value = substr ( $ str , $ p , $ len ) ; $ p += $ len ; $ value = str_replace ( '\\"' , '"' , $ value ) ; $ value = str_replace ( '\\\\' , '\\' , $ value ) ; return...
Read a key or value component from a hstore s string representation
230,133
public function reloadTableSchema ( ) { $ this -> columns = [ ] ; $ described = $ this -> describe ( ) -> execute ( ) ; while ( $ column = $ described -> get ( ) ) { $ this -> columns [ ] = $ column [ 'COLUMNS' ] [ 'Field' ] ; } return $ this ; }
Reload the table schema .
230,134
public function select ( $ fields = null ) { $ select = new Select ( $ this ) ; if ( $ fields !== null ) { $ select -> fields ( $ fields ) ; } return $ select ; }
Get a select object for the current table .
230,135
public function exists ( ) { $ quotedTable = \ Database \ DatabaseConnectionFactory :: get ( ) -> quote ( $ this -> getTable ( ) ) ; $ record = \ Database \ DatabaseConnectionFactory :: get ( ) -> query ( "show tables like {$quotedTable}" ) ; return ! is_a ( $ record , 'Database\DatabaseRecord\EmptyDatabaseRecord' ) &&...
Check if the table exists in the database .
230,136
public function put ( array $ values = [ ] ) { $ this -> qb -> setQueryClass ( PutItem :: class ) ; foreach ( $ values as $ attributeName => $ value ) { $ value = $ this -> value ( $ value ) ; if ( $ attributeName !== $ this -> qb -> class -> discriminatorAttribute ) { $ attribute = $ this -> attr ( $ attributeName ) ;...
Sets the query operation to put and optionally specifies an array of data to add to the put command .
230,137
public function publishPostEvent ( Request $ request ) { $ post = $ this -> model -> FindOrFail ( $ request -> input ( 'postID' ) ) -> toArray ( ) ; $ post [ 'listID' ] = $ request -> input ( 'listID' ) ; $ post [ 'eventDescription' ] = $ request -> input ( 'eventDescription' ) ; event ( new PublishThePost ( $ post ) )...
Fire the SendPostToLaSalleCRMemailList event .
230,138
public function setFetchMode ( $ fetchMode , $ fetchArgument = null , array $ fetchConstructorArgument = [ ] ) { $ this -> fetchMode = $ fetchMode ; $ this -> fetchArgument = $ fetchArgument ; $ this -> fetchConstructorArgument = $ fetchConstructorArgument ; }
Set the default fetch mode for the connection and optional arguments for the given fetch mode .
230,139
protected function access ( $ values , string $ field ) { return isset ( $ values [ $ field ] ) ? $ values [ $ field ] : null ; }
Gets a field from the values .
230,140
public function assert ( $ values ) { $ errors = $ this -> iterate ( $ values ) ; if ( ! empty ( $ errors ) ) { throw new Exception \ Invalid ( $ errors ) ; } }
Validates the provided value throwing an exception upon failure .
230,141
public function getLatinName ( ) { if ( $ this -> hasParent ( ) && ! $ this -> latin_name ) { return $ this -> getParent ( ) -> getLatinName ( ) ; } return $ this -> latin_name ; }
Get latinName .
230,142
public function getAlias ( ) { if ( $ this -> hasParent ( ) && ! $ this -> alias ) { return $ this -> getParent ( ) -> getAlias ( ) ; } return $ this -> alias ; }
Get alias .
230,143
public function getLifeCycle ( ) { if ( $ this -> hasParent ( ) && ! $ this -> life_cycle ) { return $ this -> getParent ( ) -> getLifeCycle ( ) ; } if ( ! $ this -> life_cycle && $ this -> getSpecies ( ) ) { return $ this -> getSpecies ( ) -> getLifeCycle ( ) ; } return $ this -> life_cycle ; }
Get lifeCycle .
230,144
public function getLegalGerminationRate ( ) { if ( ! $ this -> legal_germination_rate && $ this -> getSpecies ( ) ) { return $ this -> getSpecies ( ) -> getLegalGerminationRate ( ) ; } return $ this -> legal_germination_rate ; }
Get legalGerminationRate .
230,145
public function setSpecies ( \ Librinfo \ VarietiesBundle \ Entity \ Species $ species = null ) { $ this -> species = $ species ; return $ this ; }
Set species .
230,146
public function getSpecies ( ) { if ( $ this -> hasParent ( ) && ! $ this -> species ) { return $ this -> getParent ( ) -> getSpecies ( ) ; } return $ this -> species ; }
Get species .
230,147
public function addPlantCategory ( \ Librinfo \ VarietiesBundle \ Entity \ PlantCategory $ plantCategory ) { $ this -> plant_categories [ ] = $ plantCategory ; return $ this ; }
Add plantCategory .
230,148
public function removePlantCategory ( \ Librinfo \ VarietiesBundle \ Entity \ PlantCategory $ plantCategory ) { return $ this -> plant_categories -> removeElement ( $ plantCategory ) ; }
Remove plantCategory .
230,149
public function getPlantCategories ( ) { if ( ! $ this -> plant_categories && $ this -> getSpecies ( ) ) { return $ this -> getSpecies ( ) -> getPlantCategories ( ) ; } return $ this -> plant_categories ; }
Get plantCategories .
230,150
public function getTkw ( ) { if ( ! $ this -> tkw && $ this -> getSpecies ( ) ) { return $ this -> getSpecies ( ) -> getTkw ( ) ; } return $ this -> tkw ; }
Get tkw .
230,151
public function getSeedLifespan ( ) { if ( ! $ this -> seed_lifespan && $ this -> getSpecies ( ) ) { return $ this -> getSpecies ( ) -> getSeedLifeSpan ( ) ; } return $ this -> seed_lifespan ; }
Get seedLifespan .
230,152
public function getRaiseDuration ( ) { if ( ! $ this -> raise_duration && $ this -> getSpecies ( ) ) { return $ this -> getSpecies ( ) -> getRaiseDuration ( ) ; } return $ this -> raise_duration ; }
Get raiseDuration .
230,153
public function setVariety ( \ Librinfo \ VarietiesBundle \ Entity \ Variety $ variety = null ) { $ this -> variety = $ variety ; return $ this ; }
Set variety .
230,154
public function addProfessionalDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionProfessional $ professionalDescription ) { $ this -> professional_descriptions [ ] = $ professionalDescription ; return $ this ; }
Add professionalDescription .
230,155
public function removeProfessionalDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionProfessional $ professionalDescription ) { return $ this -> professional_descriptions -> removeElement ( $ professionalDescription ) ; }
Remove professionalDescription .
230,156
public function setProfessionalDescriptions ( $ descriptions ) { foreach ( $ descriptions as $ description ) { $ description -> setVariety ( $ this ) ; } $ this -> professional_descriptions = $ descriptions ; return $ this ; }
Set professional descriptions .
230,157
public function addAmateurDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionAmateur $ amateurDescription ) { $ this -> amateur_descriptions [ ] = $ amateurDescription ; return $ this ; }
Add amateurDescription .
230,158
public function removeAmateurDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionAmateur $ amateurDescription ) { return $ this -> amateur_descriptions -> removeElement ( $ amateurDescription ) ; }
Remove amateurDescription .
230,159
public function setAmateurDescriptions ( $ descriptions ) { foreach ( $ descriptions as $ description ) { $ description -> setVariety ( $ this ) ; } $ this -> amateur_descriptions = $ descriptions ; return $ this ; }
Set amateur descriptions .
230,160
public function addProductionDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionProduction $ productionDescription ) { $ this -> production_descriptions [ ] = $ productionDescription ; return $ this ; }
Add productionDescription .
230,161
public function removeProductionDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionProduction $ productionDescription ) { return $ this -> production_descriptions -> removeElement ( $ productionDescription ) ; }
Remove productionDescription .
230,162
public function setProductionDescriptions ( $ descriptions ) { foreach ( $ descriptions as $ description ) { $ description -> setVariety ( $ this ) ; } $ this -> production_descriptions = $ descriptions ; return $ this ; }
Set production descriptions .
230,163
public function addCommercialDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionCommercial $ commercialDescription ) { $ this -> commercial_descriptions [ ] = $ commercialDescription ; return $ this ; }
Add commercialDescription .
230,164
public function removeCommercialDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionCommercial $ commercialDescription ) { return $ this -> commercial_descriptions -> removeElement ( $ commercialDescription ) ; }
Remove commercialDescription .
230,165
public function setCommercialDescriptions ( $ descriptions ) { foreach ( $ descriptions as $ description ) { $ description -> setVariety ( $ this ) ; } $ this -> commercial_descriptions = $ descriptions ; return $ this ; }
Set commercial descriptions .
230,166
public function addPlantDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionPlant $ plantDescription ) { $ this -> plant_descriptions [ ] = $ plantDescription ; return $ this ; }
Add plantDescription .
230,167
public function removePlantDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionPlant $ plantDescription ) { return $ this -> plant_descriptions -> removeElement ( $ plantDescription ) ; }
Remove plantDescription .
230,168
public function setPlantDescriptions ( $ descriptions ) { foreach ( $ descriptions as $ description ) { $ description -> setVariety ( $ this ) ; } $ this -> plant_descriptions = $ descriptions ; return $ this ; }
Set plant descriptions .
230,169
public function addCultureDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionCulture $ cultureDescription ) { $ this -> culture_descriptions [ ] = $ cultureDescription ; return $ this ; }
Add cultureDescription .
230,170
public function removeCultureDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionCulture $ cultureDescription ) { return $ this -> culture_descriptions -> removeElement ( $ cultureDescription ) ; }
Remove cultureDescription .
230,171
public function setCultureDescriptions ( $ descriptions ) { foreach ( $ descriptions as $ description ) { $ description -> setVariety ( $ this ) ; } $ this -> culture_descriptions = $ descriptions ; return $ this ; }
Set culture descriptions .
230,172
public function addInnerDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionInner $ innerDescription ) { $ this -> inner_descriptions [ ] = $ innerDescription ; return $ this ; }
Add innerDescription .
230,173
public function removeInnerDescription ( \ Librinfo \ VarietiesBundle \ Entity \ VarietyDescriptionInner $ innerDescription ) { return $ this -> inner_descriptions -> removeElement ( $ innerDescription ) ; }
Remove innerDescription .
230,174
public function search ( string $ model , array $ fields ) : ? array { $ response = array ( ) ; foreach ( $ fields as $ param => $ value ) { $ check = $ model :: where ( $ param , $ value ) -> first ( ) ; if ( $ check != null ) { $ response = array_merge ( $ response , array ( $ param => "The $param has already been ta...
Check if a model value has already been used or not
230,175
public function isFeatureEnabled ( $ featureName ) { try { $ path = preg_split ( '/\./' , $ featureName ) ; $ foundValue = $ this -> findValueInMultiArray ( $ path , $ this -> features ) ; if ( is_array ( $ foundValue ) ) { return $ this -> checkEveryChild ( $ foundValue ) ; } else { return $ foundValue ; } } catch ( \...
Tests if given feature is enabled
230,176
protected function findValueInMultiArray ( array $ path , array $ reference ) { if ( count ( $ path ) == 0 || ! isset ( $ reference [ $ path [ 0 ] ] ) ) { throw new \ OutOfRangeException ( ) ; } $ currentElement = $ reference [ $ path [ 0 ] ] ; if ( ! isset ( $ path [ 1 ] ) ) { return $ currentElement ; } else if ( is_...
Find value in a multi - array
230,177
protected function checkEveryChild ( array $ features ) { foreach ( $ features as $ feature ) { $ result = is_array ( $ feature ) ? $ this -> checkEveryChild ( $ feature ) : $ feature ; if ( ! $ result ) { return false ; } } return true ; }
Checks every child of the array
230,178
public function add ( $ key , $ val ) { if ( ! isset ( $ this -> _attrs [ $ key ] ) ) { $ this -> _attrs [ $ key ] = [ ] ; } if ( ! strcasecmp ( $ key , 'id' ) ) { $ this -> _attrs [ $ key ] = $ val ; } else { array_push ( $ this -> _attrs [ $ key ] , $ val ) ; } return $ this ; }
Add attribute to tag
230,179
public function remove ( $ key ) { if ( isset ( $ this -> _attrs [ $ key ] ) ) { unset ( $ this -> _attrs [ $ key ] ) ; } return $ this ; }
Remove tag attribute
230,180
public function contains ( $ data , $ append = true ) { $ this -> _content = $ append ? $ this -> _content . $ data : $ data ; return $ this ; }
Set contents of tag
230,181
private function _format ( $ data ) { $ output_callback_function = '' ; if ( is_array ( $ data ) || is_object ( $ data ) ) { $ this -> header ( 'Content-type: application/json' ) ; $ output_callback_function = json_encode ( $ data ) ; } else { $ output_callback_function = $ data ; } $ output = $ output_callback_functio...
Return string value for data
230,182
public function get ( $ raw = false ) { return $ raw ? $ this -> _data : $ this -> _format ( $ this -> _data ) ; }
Get formatted responsed data
230,183
public function render ( ) { $ res = $ this -> get ( ) ; foreach ( $ this -> _headers as $ header ) { header ( $ header ) ; } foreach ( $ this -> _cookies as $ k => $ v ) { Cookie :: set ( $ k , $ v ) ; } print ( $ res ) ; }
Set response headers and print response text
230,184
protected function execUpload ( ) { $ this -> loadTranslations ( 'form' , sprintf ( 'private/global/locales/%s/form.ini' , LANGUAGE ) ) ; foreach ( $ this -> uploadFieldsDefinitions as $ fieldName => $ definition ) { $ validations = isset ( $ definition [ 'validations' ] ) ? $ definition [ 'validations' ] : null ; $ pr...
Execs upload action
230,185
protected function checkUpload ( ) { if ( ! isset ( $ this -> uploadFields [ $ this -> uploadedField ] ) ) { $ this -> uploadMessages [ ] = sprintf ( 'No definition set for POST uploadField field "%s"' , $ this -> uploadedField ) ; return false ; } foreach ( $ this -> uploadFieldsDefinitions [ $ this -> uploadedField ]...
Checks whether an upload has been tried
230,186
protected function handleUpload ( ) { $ this -> uploadedField = array_keys ( $ _FILES ) [ 0 ] ; $ this -> uploadOk = $ this -> checkUpload ( ) ; if ( ! $ this -> uploadOk ) { return ; } $ this -> uploadOk = $ this -> uploadFields [ $ this -> uploadedField ] -> handleUpload ( $ this -> uploader ) ; if ( ! $ this -> uplo...
Executes the upload action
230,187
protected function outputUploadOutcome ( ) { $ json = new \ stdClass ( ) ; if ( ! $ this -> uploadOk ) { if ( $ this -> uploader -> getMessages ( ) ) { $ this -> uploadMessages [ ] = implode ( '\n' , $ this -> uploader -> getMessages ( ) ) ; } $ json -> error = implode ( '\n' , $ this -> uploadMessages ) ; $ this -> ht...
Outputs to browser upload outcome in json format for ajax calls benefit
230,188
protected function purgeFiles ( ) { $ input = $ this -> processSaveInput ( filter_input_array ( INPUT_POST , $ this -> configuration [ 'subjects' ] [ $ this -> name ] [ 'CRUD' ] [ 'inputFields' ] ) ) ; $ primaryKeyValue = $ this -> extractPrimaryKeyValue ( $ input , 'a' ) ; $ record = $ this -> getByPrimaryKey ( $ prim...
Checks in case of CRUD update or delete if any file is to be deleted
230,189
public function extractFieldsOutputs ( & $ record , $ fieldsOutputs , $ propertyName = '_files' ) { foreach ( $ fieldsOutputs as $ field => $ outputs ) { $ this -> extractFieldOutputs ( $ record , $ field , $ outputs , $ propertyName ) ; } }
extracts for a record for one or more upload fields one or more outputs paths
230,190
public function extractFieldsOutputsList ( & $ records , $ fieldsOutputs , $ propertyName = '_files' ) { foreach ( $ records as $ record ) { $ this -> extractFieldsOutputs ( $ record , $ fieldsOutputs , $ propertyName ) ; } }
extracts for a list of records for one or more upload fields one or more outputs paths
230,191
public function toSQL ( Parameters $ params , bool $ inner_clause ) { $ drv = $ params -> getDriver ( ) ; $ lhs = $ this -> getLHS ( ) === null ? null : $ drv -> toSQL ( $ params , $ this -> getLHS ( ) , true ) ; $ rhs = $ drv -> toSQL ( $ params , $ this -> getRHS ( ) , true ) ; $ op = $ this -> getOperator ( ) ; if (...
Write an operator expression as SQL query syntax
230,192
protected function prepareValue ( $ value ) { $ value = $ this -> asDateTime ( $ value ) -> startOfDay ( ) ; return $ value -> format ( $ this -> getDateFormat ( ) ) ; }
Prepare the value to be stored .
230,193
public function bind ( $ id , $ concrete , $ singleton = false ) { $ concrete = $ concrete ? : $ id ; if ( ! $ concrete instanceof Closure ) { $ concrete = function ( Container $ container ) use ( $ id , $ concrete ) { $ method = ( $ id == $ concrete ) ? 'build' : 'resolve' ; return $ container -> $ method ( $ concrete...
Register a binding
230,194
public function enableInjecterDetection ( array $ blacklist = array ( ) , $ version = PHP_VERSION ) { if ( version_compare ( $ version , '5.4.0' ) <= 0 ) { throw new RunTimeException ( 'This feature requires PHP 5.4 or higher' ) ; } if ( $ this -> detector === null ) { $ this -> setDetector ( new SimpleDetector ) ; } $...
Enable the powerful injector method detection .
230,195
public function onResolving ( Closure $ callback , $ priority = 0 ) { if ( ! isset ( $ this -> callbacks [ $ priority ] ) ) { $ this -> callbacks [ $ priority ] = array ( ) ; } $ this -> callbacks [ $ priority ] [ ] = $ callback ; }
Register a listener for the resolving event . This is only fired on the main resolve not internal dependency resolves .
230,196
protected function isSingelton ( $ id ) { return ( isset ( $ this -> binds [ $ id ] [ 'singleton' ] ) && $ this -> binds [ $ id ] [ 'singleton' ] === true ) ; }
Checks whether the binding is a singelton
230,197
protected function buildDimdBlacklist ( array $ blacklist ) { if ( ! empty ( $ blacklist ) ) { return $ blacklist ; } elseif ( ! empty ( $ this -> dimbBlacklist ) ) { return $ this -> dimbBlacklist ; } else { return array ( ) ; } }
Just a wrapper for some basic control structured
230,198
public function loadSitesList ( $ user ) { if ( ! is_super_admin ( ) ) { return ; } if ( ! is_network_admin ( ) ) { return ; } if ( file_exists ( MSROLEPROPAGINATION_TEMPLATE_PATH . 'profile.php' ) ) { $ data = array ( 'sites' => array_chunk ( get_sites ( ) , 3 ) , 'savedState' => $ this -> getUserRoles ( $ user -> ID ...
Fetch the view
230,199
public function saveUserPofile ( $ user_id ) { if ( ! is_super_admin ( ) ) { return ; } if ( ! is_network_admin ( ) ) { return ; } if ( isset ( $ _POST [ 'userEnabled' ] ) && is_array ( $ _POST [ 'userEnabled' ] ) && ! empty ( $ _POST [ 'userEnabled' ] ) ) { foreach ( ( array ) $ _POST [ 'userEnabled' ] as $ site_key =...
Handle save data