idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
57,300
public function getInterfaceSlug ( ) : string { $ path = $ this -> getBasePath ( ) ; $ subDir = App :: $ Properties -> get ( 'basePath' ) ; if ( $ subDir !== '/' ) { $ offset = ( int ) Str :: length ( $ subDir ) ; $ path = Str :: sub ( $ path , -- $ offset ) ; } return $ path ; }
Get base path from current environment without basePath of subdirectories
57,301
private function setTemplexFeatures ( ) : void { $ url = $ this -> getSchemeAndHttpHost ( ) ; $ sub = null ; if ( $ this -> getInterfaceSlug ( ) && Str :: length ( $ this -> getInterfaceSlug ( ) ) > 0 ) { $ sub = $ this -> getInterfaceSlug ( ) . '/' ; } if ( $ this -> languageInPath ( ) ) { $ sub .= $ this -> getLangua...
Set templex template engine URL features
57,302
public static function build ( string $ fullPath , int $ uploadStatus , string $ clientFileName = null , string $ clientMimeType = null ) : \ Dms \ Core \ File \ IUploadedFile { if ( $ clientMimeType && stripos ( $ clientMimeType , 'image' ) === 0 ) { return new UploadedImage ( $ fullPath , $ uploadStatus , $ clientFil...
Builds a new uploaded file instance based on the given mime type .
57,303
public function get ( int $ address = null ) : int { if ( $ address == null ) { $ temp = $ this -> value ++ ; $ this -> memory [ $ this -> lenght ] = $ temp ; $ this -> lenght ++ ; return $ temp ; } else { if ( $ address > - 1 ) { return $ this -> memory [ $ address ] ; } } }
Autogenera un numero entero de forma correlativa .
57,304
public function findByName ( $ name ) { $ call = sprintf ( "findBy%s" , ( false !== strpos ( $ name , '.' ) ) ? 'FullyQualifiedName' : 'Name' ) ; $ found = $ this -> persistedGet ( ) -> $ call ( $ name ) ; switch ( $ count = count ( $ found ) ) { case 0 : return null ; case 1 : return $ found -> pop ( ) ; default : thr...
Return a index from it s name
57,305
public function getDepth ( ) : int { $ depth = parent :: getDepth ( ) ; $ paths = array_filter ( array_map ( function ( Invalid $ error ) { return $ error -> getPath ( ) ; } , $ this -> errors ) ) ; if ( $ paths && ( $ max = max ( array_map ( 'count' , $ paths ) ) ) > $ depth ) { $ depth = $ max ; } return $ depth ; }
Calculate the maximum depth between its errors .
57,306
public function getFlatErrors ( ) : array { $ reduce = function ( array $ carry , Invalid $ item ) use ( & $ reduce ) { if ( $ item instanceof self ) { $ carry = array_merge ( $ carry , $ item -> getFlatErrors ( ) ) ; } else { $ carry [ ] = $ item ; } if ( $ item -> getPrevious ( ) ) { $ carry = $ reduce ( $ carry , $ ...
Retrieve a list of Invalid errors . The returning array will have one level deep only .
57,307
protected function _invokeCallable ( $ callable , $ args ) { if ( ! is_callable ( $ callable ) ) { throw $ this -> _createInvalidArgumentException ( $ this -> __ ( 'Callable is not callable' ) , null , null , $ callable ) ; } $ args = $ this -> _normalizeArray ( $ args ) ; try { $ reflection = $ this -> _createReflecti...
Invokes a callable .
57,308
public static function diskFullPath ( $ path ) { $ path = self :: diskPath ( $ path ) ; if ( ! Str :: startsWith ( root , $ path ) ) { $ path = root . DIRECTORY_SEPARATOR . ltrim ( $ path , '\\/' ) ; } return $ path ; }
Normalize local disk - based ABSOLUTE path .
57,309
public function cmdGetCategory ( ) { $ result = $ this -> getListCategory ( ) ; $ this -> outputFormat ( $ result ) ; $ this -> outputFormatTableCategory ( $ result ) ; $ this -> output ( ) ; }
Callback for category - get command
57,310
public function cmdUpdateCategory ( ) { $ 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 category - update command
57,311
protected function getListCategory ( ) { $ id = $ this -> getParam ( 0 ) ; if ( ! isset ( $ id ) ) { return $ this -> category -> getList ( array ( 'limit' => $ this -> getLimit ( ) ) ) ; } if ( ! is_numeric ( $ id ) ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid argument' ) ) ; } if ( $ this -> getParam ( 'gro...
Returns an array of categories
57,312
protected function addCategory ( ) { if ( ! $ this -> isError ( ) ) { $ id = $ this -> category -> add ( $ this -> getSubmitted ( ) ) ; if ( empty ( $ id ) ) { $ this -> errorAndExit ( $ this -> text ( 'Unexpected result' ) ) ; } $ this -> line ( $ id ) ; } }
Add a new category
57,313
protected function submitAddCategory ( ) { $ this -> setSubmitted ( null , $ this -> getParam ( ) ) ; $ this -> validateComponent ( 'category' ) ; $ this -> addCategory ( ) ; }
Add a new category at once
57,314
protected function wizardAddCategory ( ) { $ this -> validatePrompt ( 'title' , $ this -> text ( 'Title' ) , 'category' ) ; $ this -> validatePrompt ( 'category_group_id' , $ this -> text ( 'Category group ID' ) , 'category' ) ; $ this -> validatePrompt ( 'parent_id' , $ this -> text ( 'Parent category ID' ) , 'categor...
Add a new category step by step
57,315
public static function baseToDec ( $ input , $ Chars ) { if ( preg_match ( '/^[' . $ Chars . ']+$/' , $ input ) ) { $ Result = ( string ) '0' ; for ( $ i = 0 ; $ i < strlen ( $ input ) ; $ i ++ ) { if ( $ i != 0 ) $ Result = bcmul ( $ Result , strlen ( $ Chars ) , 0 ) ; $ Result = bcadd ( $ Result , strpos ( $ Chars , ...
convert character string with arbitrary base to decimal string
57,316
public static function baseFromDec ( $ input , $ Chars ) { if ( preg_match ( '/^[0-9]+$/' , $ input ) ) { $ Result = '' ; do { $ Result .= $ Chars [ bcmod ( $ input , strlen ( $ Chars ) ) ] ; $ input = bcdiv ( $ input , strlen ( $ Chars ) , 0 ) ; } while ( bccomp ( $ input , '0' ) != 0 ) ; return strrev ( $ Result ) ; ...
convert character string with decimal base to arbitrary base
57,317
public function updateIndex ( ) { $ this -> startLogging ( ) ; $ this -> addLog ( 'Indexing start.' ) ; $ this -> addLog ( 'Clearing index.' ) ; $ this -> resetIndex ( ) ; $ this -> addLog ( 'Cleaning Published Deleted Documents' ) ; $ this -> storage -> getDocuments ( ) -> cleanPublishedDeletedDocuments ( ) ; $ this -...
Creates a new temporary search db cleans it if it exists then calculates and stores the search index in this db and finally if indexing completed replaces the current search db with the temporary one . Returns the log in string format .
57,318
public function createDocumentTermCount ( $ documents ) { $ termCount = new TermCount ( $ this -> getSearchDbHandle ( ) , $ documents , $ this -> filters , $ this -> storage ) ; $ termCount -> execute ( ) ; }
Count how often a term is used in a document
57,319
public function createInverseDocumentFrequency ( ) { $ documentCount = $ this -> getTotalDocumentCount ( ) ; $ inverseDocumentFrequency = new InverseDocumentFrequency ( $ this -> getSearchDbHandle ( ) , $ documentCount ) ; $ inverseDocumentFrequency -> execute ( ) ; }
Calculates the inverse document frequency for each term . This is a representation of how often a certain term is used in comparison to all terms .
57,320
private function startLogging ( ) { $ this -> loggingStart = round ( microtime ( true ) * 1000 ) ; $ this -> lastLog = $ this -> loggingStart ; }
Stores the time the indexing started in memory
57,321
private function addLog ( $ string ) { $ currentTime = round ( microtime ( true ) * 1000 ) ; $ this -> log .= date ( 'd-m-Y H:i:s - ' ) . str_pad ( $ string , 50 , " " , STR_PAD_RIGHT ) . "\t" . ( $ currentTime - $ this -> lastLog ) . 'ms since last log. ' . "\t" . ( $ currentTime - $ this -> loggingStart ) . 'ms since...
Adds a logline with the time since last log
57,322
protected function getSearchDbHandle ( ) { if ( $ this -> searchDbHandle === null ) { $ path = $ this -> storageDir . DIRECTORY_SEPARATOR ; $ this -> searchDbHandle = new \ PDO ( 'sqlite:' . $ path . self :: SEARCH_TEMP_DB ) ; } return $ this -> searchDbHandle ; }
Creates the SQLite \ PDO object if it doesnt exist and returns it .
57,323
public function replaceOldIndex ( ) { $ this -> searchDbHandle = null ; $ path = $ this -> storageDir . DIRECTORY_SEPARATOR ; rename ( $ path . self :: SEARCH_TEMP_DB , $ path . 'search.db' ) ; }
Replaces the old search index database with the new one .
57,324
public function isPublic ( $ status = null ) { $ this -> is_public = $ status !== null ? $ status : $ this -> is_public ; return $ this -> is_public ; }
Is an public class
57,325
public function isStatic ( $ status = null ) { $ this -> is_static = $ status !== null ? $ status : $ this -> is_static ; return $ this -> is_static ; }
Is an static class
57,326
public function renderProfile ( ) { $ this -> checkIsLogin ( ) ; $ name = $ this -> di -> get ( 'session' ) -> get ( "user" ) ; $ user = $ this -> getUserDetails ( $ name ) ; $ views = [ [ "comment/user/profile/profile" , [ "user" => $ user ] , "main" ] ] ; if ( $ user -> authority == "admin" ) { $ views = [ [ "comment...
Render profile page
57,327
public function getName ( Crawler $ crawler ) { $ headers = $ crawler -> filter ( 'table.borderNoOpac th.raceheader b' ) ; $ values = $ headers -> extract ( array ( '_text' , 'b' ) ) ; $ name = @ $ values [ 0 ] [ 0 ] ; if ( $ name === false ) { return 'Naam kon niet worden opgehaald. Vul zelf in.' ; } return trim ( $ n...
Naam van de uitslag .
57,328
static function getDownloadUrl ( $ videoUrl ) { $ toplevelDomain = parse_url ( $ videoUrl ) ; $ toplevelDomain = $ toplevelDomain [ 'host' ] ; if ( ! is_dir ( __DIR__ . DIRECTORY_SEPARATOR . 'ProviderHandler' . DIRECTORY_SEPARATOR . $ toplevelDomain ) ) { throw new \ Exception ( 'There is no special implementation for ...
Get the download url of a video url
57,329
public static function hydrate ( array $ data , ByConfigBuilder $ config ) { if ( $ config -> getEntity ( ) === false ) { return $ config -> getCollectionEntity ( $ data ) ; } if ( $ config -> isCollection ( ) === false ) { $ data = array ( $ data ) ; } $ rows = array ( ) ; foreach ( $ data as $ index => $ row ) { $ ro...
Hydrate array data to an object based on the configuration given
57,330
public function createValidator ( $ validatorType , array $ validatorOptions = [ ] ) { try { $ validatorObjectName = $ this -> resolveValidatorObjectName ( $ validatorType ) ; $ validator = $ this -> objectManager -> get ( $ validatorObjectName , $ validatorOptions ) ; if ( ! ( $ validator instanceof \ TYPO3 \ CMS \ Ex...
Get a validator for a given data type . Returns a validator implementing the \ TYPO3 \ CMS \ Extbase \ Validation \ Validator \ ValidatorInterface or NULL if no validator could be resolved .
57,331
protected function resolveValidatorObjectName ( $ validatorName ) { if ( strpos ( $ validatorName , ':' ) !== false || strpbrk ( $ validatorName , '_\\' ) === false ) { list ( $ extensionName , $ extensionValidatorName ) = explode ( ':' , $ validatorName ) ; if ( $ validatorName !== $ extensionName && $ extensionValida...
Returns an object of an appropriate validator for the given class . If no validator is available FALSE is returned
57,332
public static function decode ( $ string ) { if ( ! $ string ) { return new ArrayObject ( ) ; } $ array = json_decode ( $ string , true ) ; static :: checkLastError ( ) ; if ( ! is_array ( $ array ) ) { $ array = [ ] ; } return ArrayObject :: make ( $ array ) ; }
Convert a JSON string to an array .
57,333
public function detect ( & $ controller ) { $ this -> controller = & $ controller ; $ this -> name = Inflector :: singularize ( $ this -> controller -> name ) ; $ path = get_include_path ( ) ; set_include_path ( VENDORS . 'phpids/' ) ; vendor ( 'phpids/IDS/Init' ) ; $ _REQUEST [ 'IDS_request_uri' ] = $ _SERVER [ 'REQUE...
This function includes the IDS vendor parts and runs the detection routines on the request array .
57,334
private function react ( IDS_Report $ result ) { $ new = $ this -> controller -> Session -> read ( 'IDS.Impact' ) + $ result -> getImpact ( ) ; $ this -> controller -> Session -> write ( 'IDS.Impact' , $ new ) ; $ impact = $ this -> controller -> Session -> read ( 'IDS.Impact' ) ; if ( $ impact >= $ this -> threshold [...
This function rects on the values in the incoming results array .
57,335
static function register ( string $ name , CaptchaInterface $ captcha ) { if ( isset ( self :: $ _captchaList [ $ name ] ) ) Console :: warning ( "Overwriting captcha generator \"$name\"." ) ; self :: $ _captchaList [ $ name ] = $ captcha ; self :: enable ( $ name ) ; }
Register a new captcha generator .
57,336
static function enable ( string $ name ) { if ( ! isset ( self :: $ _captchaList [ $ name ] ) ) { Console :: warning ( "Captcha generator \"$name\" do not exist." ) ; return ; } self :: $ _enableList = self :: $ _enableList + [ $ name ] ; }
Mark a captcha generator as enabled .
57,337
static function disable ( string $ name ) { $ pos = array_search ( $ name , self :: $ _enableList ) ; if ( $ pos === false ) return ; unset ( self :: $ _enableList [ $ pos ] ) ; }
Mark a captcha generator as disabled .
57,338
static function init ( ) { mt_srand ( ) ; foreach ( self :: $ _captchaList as $ captcha ) $ captcha -> init ( ) ; if ( ! is_resource ( self :: $ _queue ) ) self :: _initQueue ( ) ; self :: $ _timer_id = Timer :: add ( Config :: get ( 'CAPTCHA_TIMER_INTERVAL' ) , function ( ) { $ obj = self :: _chooseOne ( ) ; if ( $ ob...
Initialize all registered captcha generators and start generating captcha .
57,339
static function destroy ( ) { Timer :: del ( self :: $ _timer_id ) ; foreach ( self :: $ _captchaList as $ captcha ) $ captcha -> destroy ( ) ; self :: $ _captchaList = self :: $ _enableList = [ ] ; msg_remove_queue ( self :: $ _queue ) ; }
Destroy captcha generators .
57,340
public function register_routes ( $ routes ) { $ route = JP_API_ROUTE ; $ routes [ ] = array ( "/{$route}/tax-query" => array ( array ( array ( $ this , 'tax_query' ) , WP_JSON_Server :: READABLE | WP_JSON_Server :: ACCEPT_JSON ) , ) , ) ; return $ routes ; }
Register the post - related routes
57,341
static public function getNotifiableStates ( ) { $ states = [ ] ; foreach ( static :: getConfig ( ) as $ state => $ config ) { if ( $ config [ 2 ] ) { $ states [ ] = $ state ; } } return $ states ; }
Returns the notifiable states .
57,342
protected function getSpressSiteDir ( ) { $ rootPackage = $ this -> composer -> getPackage ( ) ; $ extras = $ rootPackage -> getExtra ( ) ; return isset ( $ extras [ self :: EXTRA_SPRESS_SITE_DIR ] ) ? $ extras [ self :: EXTRA_SPRESS_SITE_DIR ] . '/' : '' ; }
Returns the Spress site directory . If the extra attributte spress_site_dir is not presents in the extra section of the root package .
57,343
private function store ( $ data ) { $ enc_data = Text :: lock ( json_encode ( $ data ) ) ; HTTPCookie :: set ( $ this -> name , $ enc_data , 0 , $ this -> path , $ this -> domain ) ; }
Store session into cookie
57,344
private function restore ( ) { if ( ! HTTPCookie :: exists ( $ this -> name ) ) return ( object ) [ ] ; return json_decode ( Text :: unlock ( HTTPCookie :: get ( $ this -> name ) ) ) ; }
Restore session from cookie
57,345
public function route ( $ request ) { if ( ! self :: $ _cli ) { $ router = $ this -> get ( 'routing' ) ; $ router -> route ( $ request ) ; } }
Handles routing for all incoming requests .
57,346
protected function setRequestProperties ( Request $ request ) { $ this [ "basePath" ] = $ request -> getBasePath ( ) ; $ this [ "baseUrl" ] = $ request -> getSchemeAndHttpHost ( ) . $ this [ "basePath" ] ; }
Set application properties
57,347
protected function addMemcacheServers ( $ cache , $ servers ) { $ class = new \ ReflectionClass ( $ cache ) ; $ paramCount = $ class -> getMethod ( 'addServer' ) -> getNumberOfParameters ( ) ; foreach ( $ servers as $ server ) { $ timeout = ( int ) ( $ server -> timeout / 1000 ) + ( ( $ server -> timeout % 1000 > 0 ) ?...
Add servers to the server pool of the cache specified Used for memcache PECL extension .
57,348
public function getProvider ( $ key ) { if ( ! isset ( $ this -> providers [ $ key ] ) ) { return null ; } return $ this -> providers [ $ key ] ; }
Get provider by key
57,349
public function login ( string $ login , string $ password ) { $ user = $ this -> auth_repository -> login ( $ login , $ password ) ; if ( null === $ user ) { return null ; } if ( $ this -> container -> has ( 'user' ) ) { unset ( $ this -> container [ 'user' ] ) ; } $ this -> container [ 'user' ] = $ user ; return $ th...
Log in user .
57,350
public function reset ( string $ code , string $ new_password ) : bool { return $ this -> auth_repository -> reset ( $ code , $ new_password ) ; }
Reset user password by code .
57,351
public function module ( $ module ) { if ( is_object ( $ module ) ) { if ( ! ( $ module instanceof ModuleInterface ) ) { $ moduleType = get_class ( $ module ) ; throw new InvalidArgumentException ( "Given module object '$moduleType' does not implement 'Depend\\Abstraction\\ModuleInterface'" ) ; } $ module -> register (...
Register a module object or class to register it s own dependencies .
57,352
public function add ( DescriptorInterface $ descriptor ) { $ key = $ this -> makeKey ( $ descriptor -> getName ( ) ) ; $ descriptor -> setManager ( $ this ) ; $ this -> descriptors [ $ key ] = $ descriptor ; }
Add a class descriptor to the managers collection .
57,353
public function resolveParams ( $ params ) { $ resolved = array ( ) ; foreach ( $ params as $ param ) { if ( $ param instanceof DescriptorInterface ) { $ resolved [ ] = $ this -> get ( $ param -> getName ( ) ) ; continue ; } $ resolved [ ] = $ param ; } return $ resolved ; }
Resolve an array of mixed parameters and possible Descriptors .
57,354
public function set ( $ name , $ instance ) { $ key = $ this -> makeKey ( $ name ) ; $ this -> alias ( $ name , $ this -> describe ( get_class ( $ instance ) ) ) ; $ this -> instances [ $ key ] = $ instance ; return $ this ; }
Store an instance for injection by class name or alias .
57,355
public function connectAction ( ) { $ scope = $ this -> getParameter ( 'scope_auth' ) ; if ( ! isset ( $ scope ) ) { $ scope = [ ] ; } return $ this -> get ( 'oauth2.registry' ) -> getClient ( 'google_main' ) -> redirect ( $ scope ) ; }
Link to this controller to start the connect process
57,356
public function setResponseIsJson ( $ responseIsJson = '' ) { $ this -> responseIsJson = $ responseIsJson ; $ this -> debug -> info ( __FUNCTION__ , 'setResponseIsJson: ' , $ this -> responseIsJson ) ; return $ this ; }
Function setResponseIsJson Return Response is Json if value = true
57,357
public function setCurrentAction ( $ action , array $ actionArgs = array ( ) ) { $ action = ( string ) $ action ; if ( array_key_exists ( $ action , $ this -> actions ) ) { $ this -> action = $ action ; $ this -> configureAction ( $ this -> action , $ actionArgs ) ; } return $ this ; }
Set the current action taking place on the Model
57,358
protected function configureAction ( $ action , array $ arguments = array ( ) ) { $ this -> setProperty ( self :: PROPERTY_HTTP_METHOD , $ this -> actions [ $ action ] ) ; }
Update any properties or data based on the current action - Called when setting the Current Action
57,359
protected function updateModel ( ) { $ body = $ this -> Response -> getBody ( ) ; switch ( $ this -> action ) { case self :: MODEL_ACTION_CREATE : case self :: MODEL_ACTION_UPDATE : case self :: MODEL_ACTION_RETRIEVE : if ( is_array ( $ body ) ) { $ this -> update ( $ body ) ; } break ; case self :: MODEL_ACTION_DELETE...
Called after Execute if a Request Object exists and Request returned 200 response
57,360
protected function _rewind ( ) { try { $ this -> _setIteration ( $ this -> _reset ( ) ) ; } catch ( RootException $ exception ) { $ this -> _throwIteratorException ( $ this -> __ ( 'An error occurred while rewinding' ) , null , $ exception ) ; } }
Resets the iterator .
57,361
protected function _next ( ) { try { $ this -> _setIteration ( $ this -> _loop ( ) ) ; } catch ( RootException $ exception ) { $ this -> _throwIteratorException ( $ this -> __ ( 'An error occurred while iterating' ) , null , $ exception ) ; } }
Advances the iterator to the next element .
57,362
public function checkIdPSettings ( $ settings ) { assert ( 'is_array($settings)' ) ; if ( ! is_array ( $ settings ) || empty ( $ settings ) ) { return array ( 'invalid_syntax' ) ; } $ errors = array ( ) ; if ( ! isset ( $ settings [ 'idp' ] ) || empty ( $ settings [ 'idp' ] ) ) { $ errors [ ] = 'idp_not_found' ; } else...
Checks the IdP settings info .
57,363
public function getSPMetadata ( ) { $ metadata = OneLogin_Saml2_Metadata :: builder ( $ this -> _sp , $ this -> _security [ 'authnRequestsSigned' ] , $ this -> _security [ 'wantAssertionsSigned' ] , null , null , $ this -> getContacts ( ) , $ this -> getOrganization ( ) ) ; $ certNew = $ this -> getSPcertNew ( ) ; if (...
Gets the SP metadata . The XML representation .
57,364
public static function hms ( $ h , $ m = 0 , $ s = 0 , $ f = 0 ) { $ sec = static :: hmsf2sec ( $ h , $ m , $ s , $ f ) ; return static :: sec ( $ sec ) ; }
Creates a new Time instance from hour minute and second components .
57,365
public function readFile ( string $ file_name ) { $ file_handle = @ fopen ( $ file_name , "r" ) ; if ( ! is_resource ( $ file_handle ) ) throw new IOException ( "Failed to read file: " . $ file_name ) ; return $ this -> readFileHandle ( $ file_handle ) ; }
Read YAML from a file
57,366
public function readFileHandle ( $ file_handle ) { if ( ! is_resource ( $ file_handle ) ) throw new \ InvalidArgumentException ( "No file handle was provided" ) ; $ contents = "" ; while ( ! feof ( $ file_handle ) ) $ contents .= fread ( $ file_handle , 8192 ) ; return $ this -> readString ( $ contents ) ; }
Read YAML from an open resource
57,367
public function readString ( string $ data ) { $ interceptor = new ErrorInterceptor ( function ( $ data ) { return yaml_parse ( $ data ) ; } ) ; $ interceptor -> registerError ( E_WARNING , "yaml_parse" ) ; $ result = $ interceptor -> execute ( $ data ) ; foreach ( $ interceptor -> getInterceptedErrors ( ) as $ error )...
Read YAML from a string
57,368
public function addAttribute ( Attribute $ attribute ) : ComplexEntity { $ this -> attributesCollection = $ this -> getAttributes ( ) -> addAttribute ( $ attribute ) ; return $ this ; }
Add attribute definition
57,369
public function toRestResponse ( int $ status = 200 , array $ headers = [ ] ) : RestResponseContract { return ( new Response ( ) ) -> setData ( $ this -> toArray ( ) ) -> setStatus ( $ status ) -> setHeaders ( $ headers ) ; }
Create REST response from entity
57,370
public function parseInto ( Query $ query , $ str , $ urlEncoding = true ) { if ( $ str === '' ) { return ; } $ result = [ ] ; $ this -> duplicates = false ; $ this -> numericIndices = true ; $ decoder = self :: getDecoder ( $ urlEncoding ) ; foreach ( explode ( '&' , $ str ) as $ kvp ) { $ parts = explode ( '=' , $ kv...
Parse a query string into a Query object .
57,371
private static function getDecoder ( $ type ) { if ( $ type === true ) { return function ( $ value ) { return rawurldecode ( str_replace ( '+' , ' ' , $ value ) ) ; } ; } elseif ( $ type == Query :: RFC3986 ) { return 'rawurldecode' ; } elseif ( $ type == Query :: RFC1738 ) { return 'urldecode' ; } else { return functi...
Returns a callable that is used to URL decode query keys and values .
57,372
private function parsePhpValue ( $ key , $ value , array & $ result ) { $ node = & $ result ; $ keyBuffer = '' ; for ( $ i = 0 , $ t = strlen ( $ key ) ; $ i < $ t ; $ i ++ ) { switch ( $ key [ $ i ] ) { case '[' : if ( $ keyBuffer ) { $ this -> prepareNode ( $ node , $ keyBuffer ) ; $ node = & $ node [ $ keyBuffer ] ;...
Parses a PHP style key value pair .
57,373
private function prepareNode ( & $ node , $ key ) { if ( ! isset ( $ node [ $ key ] ) ) { $ node [ $ key ] = null ; } elseif ( ! is_array ( $ node [ $ key ] ) ) { $ node [ $ key ] = [ $ node [ $ key ] ] ; } }
Prepares a value in the array at the given key .
57,374
private function cleanKey ( $ node , $ key ) { if ( $ key === '' ) { $ key = $ node ? ( string ) count ( $ node ) : 0 ; $ this -> numericIndices = false ; } return $ key ; }
Returns the appropriate key based on the node and key .
57,375
public function append ( NodeDefinition $ node ) { if ( $ node instanceof ParentNodeDefinitionInterface ) { $ builder = clone $ this ; $ builder -> setParent ( null ) ; $ node -> setBuilder ( $ builder ) ; } if ( null !== $ this -> parent ) { $ this -> parent -> append ( $ node ) ; $ node -> setParent ( $ this ) ; } re...
Appends a node definition .
57,376
protected function getRefillAttr ( $ field , ItemEntity $ item = null ) { if ( $ item instanceof ItemEntity && $ item -> getName ( ) && ( $ plugins = $ this -> chain -> getPluginsThatCanFillItem ( $ item , $ field ) ) ) { foreach ( $ plugins as $ key => $ plugin ) { $ plugins [ $ key ] = [ 'name' => $ plugin -> getName...
Get the field refill attributes .
57,377
public function isValid ( $ value ) { if ( version_compare ( VersionNumberUtility :: getCurrentTypo3Version ( ) , '7.6.0' , '<' ) ) { throw new UnsupportedVersionException ( 'The validator "' . self :: class . '" cannot be used in TYPO3 versions anterior to `7.6.0`.' , 1506281412 ) ; } $ value = ( string ) $ value ; if...
Checks that the given icon identifier exists in the TYPO3 icon registry .
57,378
private function findMedia ( $ path ) { $ media = $ this -> get ( 'ekyna_media.media.repository' ) -> findOneBy ( [ 'path' => $ path ] ) ; if ( null === $ media ) { throw new NotFoundHttpException ( 'Media not found' ) ; } $ fs = $ this -> get ( 'local_media_filesystem' ) ; if ( ! $ fs -> has ( $ media -> getPath ( ) )...
Finds the media by his path .
57,379
public function boot ( \ TYPO3 \ Flow \ Core \ Bootstrap $ bootstrap ) { $ dispatcher = $ bootstrap -> getSignalSlotDispatcher ( ) ; $ dispatcher -> connect ( 'Lightwerk\SurfCaptain\GitApi\ApiRequest' , 'apiCall' , 'Lightwerk\SurfCaptain\GitApi\RequestListener' , 'saveApiCall' ) ; $ dispatcher -> connect ( 'Lightwerk\S...
Boot the package . We wire some signals to slots here .
57,380
private function getPsrRequest ( Request $ symfonyRequest ) : ServerRequestInterface { $ psrRequest = $ this -> diactorosFactory -> createRequest ( $ symfonyRequest ) ; $ psrRequest = $ psrRequest -> withAttribute ( 'request' , $ symfonyRequest ) ; return $ psrRequest ; }
To transform a symfony request as a psr request and inject the symfony request as attribute if the endpoint need the symfony request .
57,381
public function deploy ( ) { if ( empty ( $ this -> context ) || empty ( $ this -> siteDomain ) || empty ( $ this -> deviceView ) || empty ( $ this -> design ) ) return ; $ files = null ; $ md5 = null ; $ contents = null ; $ aggregatePath = $ this -> getAggregatePath ( ) ; $ this -> Logger -> debug ( "Aggregate Path: {...
Aggregates the files if necessary .
57,382
public function resolveFile ( $ name ) { $ resolvedFilename = $ this -> getBaseDeployDirectory ( ) . $ this -> subject . '/' . ltrim ( $ name , '/' ) ; return new StorageFacilityFile ( '/' . ltrim ( $ name , '/' ) , $ resolvedFilename ) ; }
Returns the full filename of an existing deployed file with the name specified .
57,383
protected function getFiles ( ) { if ( $ this -> isSiteDeployment ) { if ( $ this -> deviceView != 'main' && ! is_dir ( "{$this->viewDirectory}/{$this->context}/{$this->siteDomain}/{$this->deviceView}" ) ) { $ this -> deviceView = 'main' ; } if ( $ this -> design != 'default' && ! is_dir ( "{$this->viewDirectory}/{$thi...
Returns a list of all the files in the theme directory combined with all the asset files of all installed plugins
57,384
public static function fromQName ( $ name ) { if ( $ name instanceof QName ) { $ name = "{$name->prefix}:{$name->localName}" ; } if ( ! is_string ( $ name ) ) { throw new \ InvalidArgumentException ( "$name must be string or a QName instanxe" ) ; } $ types = SchemaTypes :: getInstance ( ) ; $ attribute = $ types -> get...
The qualified name of the attribute
57,385
protected static function setURI ( $ uri ) { if ( ! is_string ( $ uri ) ) { throw new InvalidArgumentException ( '$uri must be a string or null' ) ; } self :: $ uri = filter_var ( $ uri , FILTER_SANITIZE_URL ) ; }
Sets the link URI
57,386
protected static function setAnchorPoint ( $ anchor ) { if ( is_string ( $ anchor ) && ! empty ( trim ( $ anchor ) ) ) { self :: $ anchor = '#' . trim ( $ anchor , '#' ) ; } else { self :: $ anchor = false ; } }
Sets the anchor point for the link
57,387
public static function getHref ( $ link ) { self :: setURI ( $ link [ 'uri' ] ) ; self :: setAnchorPoint ( $ link [ 'fragment' ] ) ; return self :: getURI ( ) . self :: getAnchorPoint ( ) ; }
Returns the correctly formatted link string
57,388
protected function extractGeneric ( $ type ) { if ( empty ( $ type ) ) { return null ; } $ generic = null ; if ( substr ( $ type , - 2 ) === '[]' ) { $ generic = substr ( $ type , 0 , - 2 ) ; } elseif ( strtolower ( substr ( $ type , 0 , 6 ) ) === 'array<' && substr ( $ type , - 1 ) === '>' ) { $ generic = substr ( $ t...
Extract the generic subtype from the specified type if there is one .
57,389
public function setClass ( $ clazz ) { if ( $ clazz instanceof ClassMetadata ) { $ classMetadata = $ clazz ; $ classname = $ clazz -> getReflectionClass ( ) -> getName ( ) ; } else if ( class_exists ( $ clazz ) ) { $ classname = $ clazz ; $ classMetadata = $ this -> getEntityManager ( ) -> getClassMetadata ( $ clazz ) ...
Sets the class associated with this configuration
57,390
public function setBaseQueryBuilder ( QueryBuilder $ baseQueryBuilder = null ) { if ( $ baseQueryBuilder === null ) { $ this -> baseQueryBuilder = $ this -> getDefaultQueryBuilder ( ) ; } else { $ this -> baseQueryBuilder = $ baseQueryBuilder ; } }
sets the base query builder
57,391
public function getDefaultQueryBuilder ( ) { $ em = $ this -> getEntityManager ( ) ; return $ em -> createQueryBuilder ( ) -> select ( 'n' ) -> from ( $ this -> getClassname ( ) , 'n' ) ; }
gets the default query builder
57,392
protected function addToDocument ( $ document ) { parent :: addToDocument ( $ document ) ; $ this -> getRangeKey ( ) -> getPropertyMetadata ( ) -> setValue ( $ document , $ this -> getRangeValue ( ) ) ; }
Set this identifier s values on the provided document instance .
57,393
protected function getArray ( ) { $ key = $ this -> getRangeKey ( ) -> getPropertyMetadata ( ) -> name ; $ array = parent :: getArray ( ) ; $ array [ $ key ] = $ this -> getRangeValue ( ) ; return $ array ; }
Return this identifier s key names and values .
57,394
public function push ( string $ key , $ value ) : self { $ this -> offsetSet ( $ key , $ value ) ; return $ this ; }
Push a configuration in via the key
57,395
public function remove ( ... $ with_keys ) : self { foreach ( $ with_keys as $ keys ) { foreach ( ( array ) $ keys as $ k ) { $ this -> offsetUnset ( $ k ) ; } } return $ this ; }
Removes an item or multiple items .
57,396
public function unsetFilter ( $ array , $ keys ) { if ( is_array ( $ array ) ) { if ( ! is_array ( $ keys ) ) { $ keys = array ( $ keys ) ; } foreach ( $ keys as $ key ) { if ( array_key_exists ( $ key , $ array ) ) { unset ( $ array [ $ key ] ) ; } } } return $ array ; }
Removes an element from the given array
57,397
public function getRewritedParameters ( $ parameter ) { if ( is_int ( $ parameter ) ) { return array ( $ parameter ) ; } if ( ! isset ( $ this -> parameters [ $ parameter ] ) ) { throw StatementRewriterException :: parameterDoesNotExist ( $ parameter ) ; } return $ this -> parameters [ $ parameter ] ; }
Gets the rewrited positional statement parameters according to the named parameter .
57,398
private function rewrite ( ) { $ positionalParameter = 1 ; $ literal = false ; $ statementLength = strlen ( $ this -> statement ) ; for ( $ placeholderPos = 0 ; $ placeholderPos < $ statementLength ; $ placeholderPos ++ ) { if ( in_array ( $ this -> statement [ $ placeholderPos ] , array ( '\'' , '"' ) ) ) { $ literal ...
Rewrite the named statement and parameters to positional .
57,399
private function isValidPlaceholderCharacter ( $ character ) { $ asciiCode = ord ( $ character ) ; return ( ( $ asciiCode >= 48 ) && ( $ asciiCode <= 57 ) ) || ( ( $ asciiCode >= 65 ) && ( $ asciiCode <= 90 ) ) || ( ( $ asciiCode >= 97 ) && ( $ asciiCode <= 122 ) ) ; }
Checks if the character is a valid placeholder character .