idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
1,200
protected function setBasicOptions ( array $ config ) { if ( ! isset ( $ config [ 'timeout' ] ) ) { $ config [ 'timeout' ] = static :: DEFAULT_REQUEST_TIMEOUT ; } if ( isset ( $ config [ 'base_uri' ] ) && strpos ( $ config [ 'base_uri' ] , 'http' ) === false ) { $ config [ 'base_uri' ] = 'https://' . $ config [ 'base_u...
Set timeout and base_uri options
1,201
protected function setConfigOption ( $ what , $ value ) { $ closure = function ( ) use ( $ what , $ value ) { $ this -> config [ $ what ] = $ value ; } ; $ closure = $ closure -> bindTo ( $ this , \ GuzzleHttp \ Client :: class ) ; $ closure ( ) ; }
Set values on the private \ GuzzleHttp \ Client - > config
1,202
protected function setDebugHandler ( $ options , $ fp = null ) { try { if ( is_bool ( $ fp ) ) { $ fp = null ; } $ handler = $ this -> getConfig ( 'handler' ) ; if ( $ handler && $ this -> debugHandler ) { return $ options ; } if ( isset ( $ options [ 'handler' ] ) ) { $ handler = $ options [ 'handler' ] ; } if ( $ han...
Add the Debug handler to the HandlerStack
1,203
protected function setLogHandler ( \ GuzzleHttp \ HandlerStack $ handlerStack , callable $ logHandler ) { try { $ handlerStack -> after ( 'history' , $ logHandler , 'logger' ) ; } catch ( \ InvalidArgumentException $ e ) { try { $ handlerStack -> before ( 'allow_redirects' , $ logHandler , 'logger' ) ; } catch ( \ Inva...
Add the Log handler to the HandlerStack
1,204
protected function setVerboseHandler ( $ options , $ fp = null ) { try { if ( is_bool ( $ fp ) || $ fp === null ) { $ fp = [ 'outputStream' => null , 'errorStream' => null ] ; } elseif ( ! is_array ( $ fp ) ) { $ fp = [ 'outputStream' => $ fp , 'errorStream' => $ fp ] ; } $ handler = $ this -> getConfig ( 'handler' ) ;...
Add the Verbose handler to the HandlerStack
1,205
protected function setRequestOptions ( array $ options ) { if ( isset ( $ options [ 'timestamp' ] ) ) { $ this -> authentication -> setTimestamp ( $ options [ 'timestamp' ] ) ; } elseif ( ! $ this -> getConfig ( 'timestamp' ) ) { $ this -> authentication -> setTimestamp ( ) ; } if ( isset ( $ options [ 'nonce' ] ) ) { ...
Set request specific options
1,206
public function setSigner ( \ Akamai \ Open \ EdgeGrid \ Authentication $ auth = null ) { $ this -> signer = $ auth ; if ( $ this -> signer === null ) { $ this -> signer = new Signer ( ) ; } }
Inject signer object
1,207
public static function createFromEdgeRcFile ( $ section = 'default' , $ file = null ) { $ signer = Signer :: createFromEdgeRcFile ( $ section , $ file ) ; $ auth = new static ( ) ; $ auth -> setSigner ( $ signer ) ; return $ auth ; }
Create Handler using an . edgerc file
1,208
public function add ( Message $ message ) { $ this -> queue -> insert ( $ message , is_null ( $ message -> getPosition ( ) ) ? null : - $ message -> getPosition ( ) ) ; $ this -> copyQueue ( clone $ this -> queue ) ; return $ this ; }
Add message to collection .
1,209
protected function copyQueue ( \ SplPriorityQueue $ queue ) { $ this -> items = [ ] ; foreach ( $ queue as $ item ) { $ this -> items [ ] = $ item ; } }
Copy queue items .
1,210
public function onFlash ( $ eventName , array $ data ) { $ this -> validateEventData ( $ data ) ; list ( $ notification , $ notificationBag , $ message ) = $ data ; $ key = implode ( '.' , [ $ this -> key , $ notificationBag -> getName ( ) ] ) ; $ this -> session -> push ( $ key , $ message ) ; return true ; }
Execute this event to flash messages .
1,211
public function getContainerTypes ( $ container ) { if ( isset ( $ this -> types [ $ container ] ) ) { return $ this -> types [ $ container ] ; } return $ this -> defaultTypes ; }
Return types for a container .
1,212
public function getContainerFormat ( $ container ) { if ( isset ( $ this -> format [ $ container ] ) ) { return $ this -> format [ $ container ] ; } return $ this -> defaultFormat ; }
Return format for a container .
1,213
public function getContainerFormats ( $ container ) { if ( isset ( $ this -> formats [ $ container ] ) ) { return $ this -> formats [ $ container ] ; } return $ this -> defaultFormats ; }
Return formats for a container .
1,214
public function addContainer ( $ container , $ types = [ ] , $ defaultFormat = null , $ formats = [ ] ) { if ( isset ( $ this -> containers [ $ container ] ) ) { return $ this ; } $ this -> containers [ $ container ] = new NotificationsBag ( $ container , $ types , $ defaultFormat , $ formats ) ; $ this -> containers [...
Add new container .
1,215
public function container ( $ container = null , Closure $ callback = null ) { $ container = is_null ( $ container ) ? $ this -> defaultContainer : $ container ; if ( ! isset ( $ this -> containers [ $ container ] ) ) { $ this -> addContainer ( $ container , $ this -> getContainerTypes ( $ container ) , $ this -> getCo...
Returns container instance .
1,216
public function fire ( $ event , NotificationsBag $ notificationBag , Message $ message ) { if ( ! isset ( static :: $ dispatcher ) ) { return true ; } $ event = "notification.{$event}: " . $ notificationBag -> getName ( ) ; return static :: $ dispatcher -> fire ( $ event , array ( $ this , $ notificationBag , $ messag...
Fire given event .
1,217
public function addType ( $ type ) { if ( func_num_args ( ) > 1 ) { foreach ( func_get_args ( ) as $ t ) { $ this -> addType ( $ t ) ; } } else { if ( is_array ( $ type ) ) { foreach ( $ type as $ t ) { $ this -> addType ( $ t ) ; } } else { if ( ! $ this -> typeIsAvailable ( $ type ) ) { $ this -> types [ ] = $ type ;...
Add new available type of message to bag .
1,218
protected function extractType ( $ name ) { if ( count ( $ this -> types ) <= 0 ) { return false ; } foreach ( $ this -> types as $ type ) { foreach ( $ this -> matcher as $ function => $ pattern ) { if ( str_replace ( array ( '{type}' , '{uType}' ) , array ( $ type , ucfirst ( $ type ) ) , $ pattern ) === $ name ) { r...
Extract type from a given string .
1,219
public function setFormats ( $ formats ) { foreach ( $ formats as $ type => $ format ) { $ this -> setFormat ( $ type , $ format ) ; } return $ this ; }
Set formats for a given types .
1,220
public function setFormat ( $ type , $ format ) { if ( $ this -> typeIsAvailable ( $ type ) ) { $ this -> formats [ $ type ] = $ format ; } return $ this ; }
Set format for a given type .
1,221
public function getFormat ( $ type ) { if ( ! $ this -> typeIsAvailable ( $ type ) ) { return false ; } if ( isset ( $ this -> formats [ $ type ] ) ) { return $ this -> formats [ $ type ] ; } if ( ! is_null ( $ this -> getDefaultFormat ( ) ) ) { return $ this -> getDefaultFormat ( ) ; } return false ; }
Return format for a given type .
1,222
protected function checkFormat ( $ format , $ type = null ) { return ! is_null ( $ format ) ? $ format : $ this -> getFormat ( $ type ) ; }
Returns valid format .
1,223
protected function addInstance ( Message $ message , $ type , $ flash = true , $ format = null ) { $ message -> setType ( $ type ) ; if ( $ message -> isFlash ( ) != $ flash ) { $ message -> setFlash ( $ flash ) ; } if ( is_null ( $ message -> getFormat ( ) ) ) { $ message -> setFormat ( $ this -> getFormat ( $ type ) ...
Add message by instance .
1,224
public function get ( $ type ) { $ collection = new Collection ( ) ; foreach ( $ this -> notifications as $ key => $ message ) { if ( $ message -> getType ( ) == $ type ) { $ collection -> add ( $ message ) ; } } return $ collection ; }
Returns all messages for given type .
1,225
public function clear ( $ type = null ) { if ( is_null ( $ type ) ) { $ this -> notifications = new Collection ( ) ; } else { $ notifications = new Collection ( ) ; foreach ( $ this -> notifications as $ message ) { if ( $ message -> getType ( ) != $ type ) { $ notifications -> add ( $ message ) ; } } $ this -> notific...
Clears message for a given type .
1,226
public function show ( $ type = null , $ format = null ) { $ messages = $ this -> getMessagesForRender ( $ type ) ; $ this -> groupForRender = array ( ) ; $ output = '' ; foreach ( $ messages as $ message ) { if ( ! $ message -> isFlash ( ) ) { if ( ! is_null ( $ format ) ) { $ message -> setFormat ( $ format ) ; } $ o...
Returns generated output of non flash messages .
1,227
protected function getMessagesForRender ( $ type = null ) { if ( is_null ( $ type ) ) { if ( count ( $ this -> groupForRender ) > 0 ) { $ messages = array ( ) ; foreach ( $ this -> groupForRender as $ typeToRender ) { $ messages = array_merge ( $ messages , $ this -> get ( $ typeToRender ) -> all ( ) ) ; } return new C...
Resolves which messages should be returned for rendering .
1,228
public function addToGrouping ( $ type ) { if ( ! $ this -> typeIsAvailable ( $ type ) ) { return $ this ; } if ( ! in_array ( $ type , $ this -> groupForRender ) ) { $ this -> groupForRender [ ] = $ type ; } return $ this ; }
Adds type for rendering .
1,229
public function removeFromGrouping ( $ type ) { foreach ( $ this -> groupForRender as $ key => $ typeToRender ) { if ( $ type == $ typeToRender ) { unset ( $ this -> groupForRender [ $ key ] ) ; } } $ this -> groupForRender = array_values ( $ this -> groupForRender ) ; return $ this ; }
Removes type from rendering .
1,230
public function has ( $ type = null ) { if ( $ this -> count ( ) <= 0 ) { return false ; } if ( is_null ( $ type ) ) { return true ; } if ( ! $ this -> typeIsAvailable ( $ type ) ) { return false ; } foreach ( $ this -> notifications as $ key => $ message ) { if ( $ message -> getType ( ) == $ type ) { return true ; } ...
Check if a message is set for given type .
1,231
protected function fireEvent ( $ event , $ message ) { if ( ! isset ( $ this -> notification ) ) { return true ; } return $ this -> getNotification ( ) -> fire ( $ event , $ this , $ message ) ; }
Fire event for a given message .
1,232
public function onKernelResponse ( FilterResponseEvent $ event ) { if ( HttpKernelInterface :: MASTER_REQUEST !== $ event -> getRequestType ( ) || ! $ this -> routeMatcher -> match ( $ event -> getRequest ( ) , $ this -> routes ) ) { return ; } $ event -> getResponse ( ) -> headers -> setCookie ( new Cookie ( $ this ->...
Sets a cookie to the response containing the CRSF token .
1,233
public function onKernelRequest ( GetResponseEvent $ event ) { if ( HttpKernelInterface :: MASTER_REQUEST !== $ event -> getRequestType ( ) || $ this -> routeMatcher -> match ( $ event -> getRequest ( ) , $ this -> exclude ) || ! $ this -> routeMatcher -> match ( $ event -> getRequest ( ) , $ this -> routes ) ) { retur...
Handles CSRF token validation .
1,234
public function isTokenValid ( $ value ) { $ csrfToken = new CsrfToken ( $ this -> tokenId , $ value ) ; return $ this -> csrfTokenManager -> isTokenValid ( $ csrfToken ) ; }
Tests if the given token value is valid .
1,235
public function getRuntime ( DeliveryExecution $ execution ) { $ delivery = $ execution -> getDelivery ( ) ; return $ this -> getServiceLocator ( ) -> get ( RuntimeService :: SERVICE_ID ) -> getRuntime ( $ delivery -> getUri ( ) ) ; }
Return the service call to run the delivery
1,236
public function updateDeliveryExecutionStatus ( KVDeliveryExecution $ deliveryExecution , $ old , $ new ) { $ this -> update ( $ deliveryExecution ) ; $ userId = $ deliveryExecution -> getUserIdentifier ( ) ; if ( $ old != null ) { $ oldReferences = $ this -> getDeliveryExecutionsByStatus ( $ userId , $ old ) ; foreach...
Update the collection of deliveries
1,237
public function getExecutionsByDelivery ( core_kernel_classes_Resource $ compiled ) { if ( ! $ this -> implementsMonitoring ( ) ) { throw new common_exception_NoImplementation ( get_class ( $ this -> getImplementation ( ) ) . ' does not implement \oat\taoDelivery\model\execution\Monitoring' ) ; } return $ this -> getIm...
Implemented in the monitoring interface
1,238
private function areColumnsExist ( \ common_persistence_sql_SchemaManager $ schemaManager ) { $ columnNames = [ RdsDeliveryExecutionService :: COLUMN_ID , RdsDeliveryExecutionService :: COLUMN_USER_ID , RdsDeliveryExecutionService :: COLUMN_DELIVERY_ID , RdsDeliveryExecutionService :: COLUMN_LABEL , RdsDeliveryExecutio...
Returns that the delivery_executions table columns are already exist in the table or not
1,239
private function createTable ( Schema $ schema ) { $ table = $ schema -> createTable ( RdsDeliveryExecutionService :: TABLE_NAME ) ; $ table -> addOption ( "engine" , "InnoDB" ) ; $ table -> addOption ( "charset" , "utf8" ) ; $ table -> addOption ( "collate" , "utf8_unicode_ci" ) ; $ this -> createColumns ( $ table ) ;...
Creates the table in the database for the Delivery
1,240
private function createIndex ( Table $ table , array $ columns ) { if ( count ( $ columns ) > 0 ) { $ indexPrefix = "idx_" . RdsDeliveryExecutionService :: TABLE_NAME . "_" ; $ indexName = substr ( $ indexPrefix . implode ( "_" , $ columns ) , 0 , 63 ) ; $ table -> addIndex ( $ columns , $ indexName ) ; } }
Generates index for the given columns
1,241
public function getAssignments ( User $ user ) { $ assignments = [ ] ; foreach ( $ this -> getInternalServices ( ) as $ service ) { $ assignments = array_merge ( $ assignments , $ service -> getAssignments ( $ user ) ) ; } return $ assignments ; }
Returns the deliveries available to a user
1,242
public function getAssignedUsers ( $ deliveryId ) { $ users = [ ] ; foreach ( $ this -> getInternalServices ( ) as $ service ) { $ users = array_merge ( $ users , $ service -> getAssignedUsers ( $ deliveryId ) ) ; } return $ users ; }
Returns the ids of users assigned to a delivery
1,243
protected function getViewDataFromRequest ( ) { $ lookupParams = [ 'warning' , 'error' ] ; $ result = [ ] ; foreach ( $ lookupParams as $ lookupParam ) { if ( $ this -> getRequest ( ) -> hasParameter ( $ lookupParam ) && ! empty ( $ this -> getRequest ( ) -> getParameter ( $ lookupParam ) ) ) { $ result [ ] = [ 'level'...
Get data from request to be passed to renderer
1,244
protected function _initDeliveryExecution ( ) { $ compiledDelivery = new \ core_kernel_classes_Resource ( \ tao_helpers_Uri :: decode ( $ this -> getRequestParameter ( 'uri' ) ) ) ; $ user = common_session_SessionManager :: getSession ( ) -> getUser ( ) ; $ assignmentService = $ this -> getServiceLocator ( ) -> get ( A...
Init a delivery execution from the current delivery .
1,245
public function initDeliveryExecution ( ) { try { $ deliveryExecution = $ this -> _initDeliveryExecution ( ) ; $ this -> redirect ( _url ( 'runDeliveryExecution' , null , null , array ( 'deliveryExecution' => $ deliveryExecution -> getIdentifier ( ) ) ) ) ; } catch ( UnAuthorizedException $ e ) { return $ this -> redir...
Init the selected delivery execution and forward to the execution screen
1,246
public function runDeliveryExecution ( ) { $ deliveryExecution = $ this -> getCurrentDeliveryExecution ( ) ; if ( ! $ this -> hasSessionAttribute ( DeliveryExecution :: getDeliveryIdSessionKey ( $ deliveryExecution -> getIdentifier ( ) ) ) ) { $ this -> setSessionAttribute ( DeliveryExecution :: getDeliveryIdSessionKey...
Displays the execution screen
1,247
public function finishDeliveryExecution ( ) { $ deliveryExecution = $ this -> getCurrentDeliveryExecution ( ) ; if ( $ deliveryExecution -> getUserIdentifier ( ) == common_session_SessionManager :: getSession ( ) -> getUserUri ( ) ) { $ stateService = $ this -> getServiceManager ( ) -> get ( StateServiceInterface :: SE...
Finish the delivery execution
1,248
protected function initResultServer ( $ compiledDelivery , $ executionIdentifier , $ userUri ) { $ this -> getDeliveryServer ( ) -> initResultServer ( $ compiledDelivery , $ executionIdentifier , $ userUri ) ; }
Initialize the result server using the delivery configuration and for this results session submission
1,249
protected function getReturnUrl ( ) { if ( $ this -> getServiceLocator ( ) -> has ( ReturnUrlService :: SERVICE_ID ) ) { $ deliveryExecution = $ this -> getCurrentDeliveryExecution ( ) ; return $ this -> getServiceLocator ( ) -> get ( ReturnUrlService :: SERVICE_ID ) -> getReturnUrl ( $ deliveryExecution -> getIdentifi...
Defines the returning URL in the top - right corner action menu
1,250
protected function verifyDeliveryStartAuthorized ( $ deliveryId ) { $ user = common_session_SessionManager :: getSession ( ) -> getUser ( ) ; $ this -> getAuthorizationProvider ( ) -> verifyStartAuthorization ( $ deliveryId , $ user ) ; }
Verify if the start of the delivery is allowed . Throws an exception if not
1,251
protected function verifyDeliveryExecutionAuthorized ( DeliveryExecution $ deliveryExecution ) { $ user = common_session_SessionManager :: getSession ( ) -> getUser ( ) ; $ this -> getAuthorizationProvider ( ) -> verifyResumeAuthorization ( $ deliveryExecution , $ user ) ; }
Check wether the delivery execution is authorized to run Throws an exception if not
1,252
public function getLabel ( ) { $ deliveryFieldsService = $ this -> getServiceLocator ( ) -> get ( DeliveryFieldsService :: SERVICE_ID ) ; $ label = $ deliveryFieldsService -> getLabel ( $ this -> getImplementation ( ) -> getDelivery ( ) , $ this -> getImplementation ( ) -> getLabel ( ) ) ; return $ label ; }
Returns a human readable test representation of the delivery execution Should respect the current user s language
1,253
public function legacyTransition ( DeliveryExecution $ deliveryExecution , $ state ) { switch ( $ state ) { case DeliveryExecution :: STATE_FINISHED : $ result = $ this -> finish ( $ deliveryExecution ) ; break ; case DeliveryExecution :: STATE_ACTIVE : $ result = $ this -> run ( $ deliveryExecution ) ; break ; case De...
Legacy function to ensure all calls to setState use the correct transition instead
1,254
public function initResultServer ( $ compiledDelivery , $ executionIdentifier , $ userUri ) { $ this -> getServiceManager ( ) -> get ( \ oat \ taoResultServer \ models \ classes \ ResultServerService :: SERVICE_ID ) -> initResultServer ( $ compiledDelivery , $ executionIdentifier , $ userUri ) ; }
Initialize the result server for a given execution
1,255
public function getDeliveryContainer ( DeliveryExecution $ deliveryExecution ) { $ runtimeService = $ this -> getServiceLocator ( ) -> get ( RuntimeService :: SERVICE_ID ) ; $ deliveryContainer = $ runtimeService -> getDeliveryContainer ( $ deliveryExecution -> getDelivery ( ) -> getUri ( ) ) ; return $ deliveryContain...
Returns the container for the delivery execution
1,256
public function count ( $ statusUri ) { $ persistence = $ this -> getPersistence ( ) ; $ key = $ this -> getStatusKey ( $ statusUri ) ; return intval ( $ persistence -> get ( $ key ) ) ; }
Get number of delivery executions of given status .
1,257
public function getLabel ( ) { $ deliveryFieldsService = ServiceManager :: getServiceManager ( ) -> get ( DeliveryFieldsService :: SERVICE_ID ) ; $ delivery = $ this -> getResource ( $ this -> getDeliveryId ( ) ) ; $ label = $ deliveryFieldsService -> getLabel ( $ delivery , $ this -> label ) ; return $ label ; }
Returns the label of the asignment which will often correspond to the label of the delivery
1,258
public function getLabel ( \ core_kernel_classes_Resource $ delivery , $ label = '' ) { $ user = \ common_session_SessionManager :: getSession ( ) -> getUser ( ) ; $ customLabelRoles = $ this -> getOption ( self :: PROPERTY_CUSTOM_LABEL ) ; if ( array_intersect ( $ customLabelRoles , $ user -> getRoles ( ) ) ) { $ prop...
Getting custom label from Delivery
1,259
public function getReturnUrl ( $ deliveryExecutionUri = '' ) { $ ext = ( $ this -> hasOption ( self :: EXTENSION_OPTION ) ) ? $ this -> getOption ( self :: EXTENSION_OPTION ) : 'taoDelivery' ; $ ctrl = ( $ this -> hasOption ( self :: CONTROLLER_OPTION ) ) ? $ this -> getOption ( self :: CONTROLLER_OPTION ) : 'DeliveryS...
Get the full url to go at the end of a test
1,260
public function verifyStartAuthorization ( $ deliveryId , User $ user ) { foreach ( $ this -> getProviders ( ) as $ provider ) { $ provider -> verifyStartAuthorization ( $ deliveryId , $ user ) ; } }
Verify that a given delivery is allowed to be started
1,261
protected function getProviders ( ) { if ( is_null ( $ this -> providers ) ) { $ this -> providers = array ( ) ; if ( $ this -> hasOption ( self :: OPTION_PROVIDERS ) ) { foreach ( $ this -> getOption ( self :: OPTION_PROVIDERS ) as $ provider ) { if ( $ provider instanceof ServiceLocatorAwareInterface ) { $ provider -...
Returns a list of providers that need to be verified
1,262
public function addProvider ( AuthorizationProvider $ provider ) { $ providers = $ this -> getOption ( self :: OPTION_PROVIDERS ) ; $ providers [ ] = $ provider ; $ this -> setOption ( self :: OPTION_PROVIDERS , $ providers ) ; }
Add an additional authorization provider that needs to be satisfied as well
1,263
public function unregister ( $ providerClass ) { $ providers = $ this -> getOption ( self :: OPTION_PROVIDERS ) ; foreach ( $ providers as $ key => $ provider ) { if ( get_class ( $ provider ) == $ providerClass ) { unset ( $ providers [ $ key ] ) ; } } $ this -> setOption ( self :: OPTION_PROVIDERS , $ providers ) ; }
Remove an existing authorization provider identified by exact class
1,264
public function getExecutionsByDelivery ( core_kernel_classes_Resource $ compiled ) { $ query = $ this -> getQueryBuilder ( ) -> select ( "*" ) -> from ( self :: TABLE_NAME ) -> where ( self :: COLUMN_DELIVERY_ID . " = :deliveryId" ) -> setParameter ( "deliveryId" , $ compiled -> getUri ( ) ) ; return array_map ( funct...
Returns the delivery executions for a compiled directory
1,265
public function getUserExecutions ( core_kernel_classes_Resource $ assembly , $ userUri ) { $ query = $ this -> getQueryBuilder ( ) -> select ( "*" ) -> from ( self :: TABLE_NAME ) -> where ( self :: COLUMN_DELIVERY_ID . " = :deliveryId" ) -> andWhere ( self :: COLUMN_USER_ID . " = :userId" ) -> setParameter ( "deliver...
Returns the executions the user has of a specified assembly
1,266
public function getDeliveryExecutionsByStatus ( $ userUri , $ status ) { $ query = $ this -> getQueryBuilder ( ) -> select ( "*" ) -> from ( self :: TABLE_NAME ) -> where ( self :: COLUMN_USER_ID . " = :userId" ) -> andWhere ( self :: COLUMN_STATUS . " = :status" ) -> setParameter ( "userId" , $ userUri ) -> setParamet...
Returns all Delivery Executions of a User with a specific status
1,267
public function getDeliveryExecution ( $ identifier ) { $ query = $ this -> getQueryBuilder ( ) -> select ( "*" ) -> from ( self :: TABLE_NAME ) -> where ( self :: COLUMN_ID . " = :id" ) -> setParameter ( "id" , $ identifier ) ; $ result = $ query -> execute ( ) -> fetch ( ) ; if ( ! $ result ) { $ result = [ ] ; } ret...
Returns the delivery execution instance associated to the implementation
1,268
public function updateDeliveryExecutionState ( $ identifier , $ fromState , $ toState ) { try { if ( $ fromState === $ toState ) { return true ; } $ query = $ this -> getQueryBuilder ( ) -> update ( self :: TABLE_NAME ) -> set ( self :: COLUMN_STATUS , ":status" ) -> where ( self :: COLUMN_ID . " = :id" ) -> setParamet...
Updates the state of the given deliveryexecution
1,269
private function parseQueryResult ( $ result = [ ] ) { $ rdsDeliveryExecution = new RdsDeliveryExecution ( $ this ) ; if ( array_key_exists ( self :: COLUMN_ID , $ result ) ) { $ rdsDeliveryExecution -> setIdentifier ( $ result [ self :: COLUMN_ID ] ) ; } if ( array_key_exists ( self :: COLUMN_LABEL , $ result ) ) { $ ...
Parses the query result array and constructs a new DeliveryExecution object from it
1,270
public function getDeliveryIdFromSession ( $ deliveryExecutionId ) { if ( \ PHPSession :: singleton ( ) -> hasAttribute ( static :: getDeliveryIdSessionKey ( $ deliveryExecutionId ) ) ) { return \ PHPSession :: singleton ( ) -> getAttribute ( static :: getDeliveryIdSessionKey ( $ deliveryExecutionId ) ) ; } return fals...
Returns the deliveryId from session .
1,271
public function getDeliveryThemeId ( $ deliveryId ) { $ themeId = $ this -> getDeliveryThemeIdFromCache ( $ deliveryId ) ; if ( $ themeId === false ) { $ themeId = $ this -> getDeliveryThemeIdFromDb ( $ deliveryId ) ; $ this -> storeDeliveryThemeIdToCache ( $ deliveryId , $ themeId ) ; } return $ themeId ; }
Returns the delivery theme id .
1,272
public function appendContents ( $ path , $ content ) { return $ this -> invoker -> invokeCall ( 'putContents' , [ 'path' => $ path , 'chunk' => base64_encode ( $ content ) , 'flags' => FILE_APPEND , ] ) -> then ( function ( $ payload ) { return \ React \ Promise \ resolve ( $ payload [ 'written' ] ) ; } ) ; }
Appends the given content to the specified file . If the file does not exist the file will be created .
1,273
public function map ( array $ parts ) : array { if ( $ this -> isMatchingSinglePart ( $ parts ) ) { $ parts [ 0 ] = new Suffix ( $ parts [ 0 ] , $ this -> suffixes [ $ this -> getKey ( $ parts [ 0 ] ) ] ) ; return $ parts ; } $ start = count ( $ parts ) - 1 ; for ( $ k = $ start ; $ k > 1 ; $ k -- ) { $ part = $ parts ...
map suffixes in the parts array
1,274
protected function parseSplitName ( $ first , $ second , $ third ) : Name { $ parts = array_merge ( $ this -> getFirstSegmentParser ( ) -> parse ( $ first ) -> getParts ( ) , $ this -> getSecondSegmentParser ( ) -> parse ( $ second ) -> getParts ( ) , $ this -> getThirdSegmentParser ( ) -> parse ( $ third ) -> getParts...
handles split - parsing of comma - separated name parts
1,275
public function getMappers ( ) : array { if ( empty ( $ this -> mappers ) ) { $ this -> setMappers ( [ new NicknameMapper ( $ this -> getNicknameDelimiters ( ) ) , new SalutationMapper ( $ this -> getSalutations ( ) , $ this -> getMaxSalutationIndex ( ) ) , new SuffixMapper ( $ this -> getSuffixes ( ) ) , new InitialMa...
get the mappers for this parser
1,276
protected function normalize ( string $ name ) : string { $ whitespace = $ this -> getWhitespace ( ) ; $ name = trim ( $ name ) ; return preg_replace ( '/[' . preg_quote ( $ whitespace ) . ']+/' , ' ' , $ name ) ; }
normalize the name
1,277
public function map ( array $ parts ) : array { if ( count ( $ parts ) < 2 ) { return [ $ this -> handleSinglePart ( $ parts [ 0 ] ) ] ; } $ pos = $ this -> findFirstnamePosition ( $ parts ) ; if ( null !== $ pos ) { $ parts [ $ pos ] = new Firstname ( $ parts [ $ pos ] ) ; } return $ parts ; }
map firstnames in parts array
1,278
public function map ( array $ parts ) : array { $ max = ( $ this -> maxIndex > 0 ) ? $ this -> maxIndex : floor ( count ( $ parts ) / 2 ) ; for ( $ k = 0 ; $ k < $ max ; $ k ++ ) { $ part = $ parts [ $ k ] ; if ( $ part instanceof AbstractPart ) { break ; } if ( $ this -> isSalutation ( $ part ) ) { $ parts [ $ k ] = n...
map salutations in the parts array
1,279
public function map ( array $ parts ) : array { $ isEncapsulated = false ; $ regexp = $ this -> buildRegexp ( ) ; $ closingDelimiter = '' ; foreach ( $ parts as $ k => $ part ) { if ( $ part instanceof AbstractPart ) { continue ; } if ( preg_match ( $ regexp , $ part , $ matches ) ) { $ isEncapsulated = true ; $ part =...
map nicknames in the parts array
1,280
public function map ( array $ parts ) : array { $ last = count ( $ parts ) - 1 ; foreach ( $ parts as $ k => $ part ) { if ( $ part instanceof AbstractPart ) { continue ; } if ( ! $ this -> matchLastPart && $ k === $ last ) { continue ; } if ( $ this -> isInitial ( $ part ) ) { $ parts [ $ k ] = new Initial ( $ part ) ...
map intials in parts array
1,281
public function map ( array $ parts ) : array { if ( ! $ this -> matchSinglePart && count ( $ parts ) < 2 ) { return $ parts ; } return $ this -> mapParts ( $ parts ) ; }
map lastnames in the parts array
1,282
protected function mapParts ( array $ parts ) : array { $ k = $ this -> skipIgnoredParts ( $ parts ) + 1 ; $ remapIgnored = true ; while ( -- $ k >= 0 ) { $ part = $ parts [ $ k ] ; if ( $ part instanceof AbstractPart ) { break ; } if ( $ this -> isFollowedByLastnamePart ( $ parts , $ k ) ) { if ( $ this -> isApplicabl...
we map the parts in reverse order because it makes more sense to parse for the lastname starting from the end
1,283
protected function skipIgnoredParts ( array $ parts ) : int { $ k = count ( $ parts ) ; while ( -- $ k >= 0 ) { if ( ! $ this -> isIgnoredPart ( $ parts [ $ k ] ) ) { break ; } } return $ k ; }
skip through the parts we want to ignore and return the start index
1,284
protected function remapIgnored ( array $ parts ) : array { $ k = count ( $ parts ) ; while ( -- $ k >= 0 ) { $ part = $ parts [ $ k ] ; if ( ! $ this -> isIgnoredPart ( $ part ) ) { break ; } $ parts [ $ k ] = new Lastname ( $ part ) ; } return $ parts ; }
remap ignored parts as lastname
1,285
protected function isApplicablePrefix ( array $ parts , int $ index ) : bool { if ( ! $ this -> isPrefix ( $ parts [ $ index ] ) ) { return false ; } return $ this -> hasUnmappedPartsBefore ( $ parts , $ index ) ; }
Assuming that the part at the given index is matched as a prefix determines if the prefix should be applied to the lastname .
1,286
protected function skipNicknameParts ( $ parts , $ startIndex ) { $ total = count ( $ parts ) ; for ( $ i = $ startIndex ; $ i < $ total ; $ i ++ ) { if ( ! ( $ parts [ $ i ] instanceof Nickname ) ) { return $ i ; } } return $ total - 1 ; }
find the next non - nickname index in parts
1,287
protected function hasUnmappedPartsBefore ( array $ parts , $ index ) : bool { foreach ( $ parts as $ k => $ part ) { if ( $ k === $ index ) { break ; } if ( ! ( $ part instanceof AbstractPart ) ) { return true ; } } return false ; }
checks if there are still unmapped parts left before the given position
1,288
protected function export ( string $ type , bool $ strict = false ) : string { $ matched = [ ] ; foreach ( $ this -> parts as $ part ) { if ( $ part instanceof AbstractPart && $ this -> isType ( $ part , $ type , $ strict ) ) { $ matched [ ] = $ part -> normalize ( ) ; } } return implode ( ' ' , $ matched ) ; }
helper method used by getters to extract and format relevant name parts
1,289
protected function isType ( AbstractPart $ part , string $ type , bool $ strict = false ) : bool { $ className = sprintf ( '%s\\%s' , self :: PARTS_NAMESPACE , $ type ) ; if ( $ strict ) { return get_class ( $ part ) === $ className ; } return is_a ( $ part , $ className ) ; }
helper method to check if a part is of the given type
1,290
public function map ( array $ parts ) : array { $ minumumParts = ( $ this -> mapWithoutLastname ? 2 : 3 ) ; if ( count ( $ parts ) < $ minumumParts ) { return $ parts ; } $ start = $ this -> findFirstMapped ( Firstname :: class , $ parts ) ; if ( false === $ start ) { return $ parts ; } return $ this -> mapFrom ( $ sta...
map middlenames in the parts array
1,291
public function cleanupCollapsedStatesInUC ( ) { $ backendUser = $ this -> getBackendUser ( ) ; if ( is_array ( $ backendUser -> uc [ 'moduleData' ] [ 'page' ] [ 'gridelementsCollapsedColumns' ] ) ) { $ collapsedGridelementColumns = $ backendUser -> uc [ 'moduleData' ] [ 'page' ] [ 'gridelementsCollapsedColumns' ] ; fo...
Processes the collapsed states of Gridelements columns and removes columns with 0 values
1,292
public function preProcess ( PageLayoutView & $ parentObject , & $ drawItem , & $ headerContent , & $ itemContent , array & $ row ) { if ( $ row [ 'CType' ] ) { $ this -> showHidden = $ parentObject -> tt_contentConfig [ 'showHidden' ] ? true : false ; if ( $ this -> helper -> getBackendUser ( ) -> uc [ 'hideContentPre...
Processes the item to be rendered before the actual example content gets rendered Deactivates the original example content output
1,293
protected function renderCTypeGridelements ( PageLayoutView $ parentObject , & $ row ) { $ head = [ ] ; $ gridContent = [ ] ; $ editUidList = [ ] ; $ colPosValues = [ ] ; $ singleColumn = false ; $ gridContainerId = $ row [ 'uid' ] ; if ( $ row [ 'pid' ] < 0 ) { $ originalRecord = BackendUtility :: getRecord ( 'tt_cont...
renders the HTML output for elements of the CType gridelements_pi1
1,294
protected function setMultipleColPosValues ( $ parserRows , & $ colPosValues , $ layout ) { if ( is_array ( $ parserRows ) ) { foreach ( $ parserRows as $ parserRow ) { if ( is_array ( $ parserRow [ 'columns.' ] ) && ! empty ( $ parserRow [ 'columns.' ] ) ) { foreach ( $ parserRow [ 'columns.' ] as $ parserColumns ) { ...
Sets column positions based on a selected gridelement layout
1,295
protected function setSingleColPosItems ( PageLayoutView $ parentObject , & $ colPosValues , & $ row ) { $ specificIds = $ this -> helper -> getSpecificIds ( $ row ) ; $ expressionBuilder = GeneralUtility :: makeInstance ( ConnectionPool :: class ) -> getQueryBuilderForTable ( 'tt_content' ) -> expr ( ) ; $ queryBuilde...
Directly returns the items for a single column if the rendering mode is set to single columns only
1,296
protected function checkIfTranslationsExistInLanguage ( array $ contentElements , $ language , PageLayoutView $ parentObject ) { $ allowInconsistentLanguageHandling = BackendUtility :: getPagesTSconfig ( $ parentObject -> id ) [ 'mod.' ] [ 'web_layout.' ] [ 'allowInconsistentLanguageHandling' ] ?? [ ] ; if ( $ language...
Checks whether translated Content Elements exist in the desired language If so deny creating new ones via the UI
1,297
protected function renderSingleElementHTML ( PageLayoutView $ parentObject , $ item ) { $ singleElementHTML = '' ; $ unset = false ; if ( ! isset ( $ parentObject -> tt_contentData [ 'nextThree' ] [ $ item [ 'uid' ] ] ) ) { $ unset = true ; $ parentObject -> tt_contentData [ 'nextThree' ] [ $ item [ 'uid' ] ] = $ item ...
Renders the HTML code for a single tt_content element
1,298
protected function tt_content_drawFooter ( PageLayoutView $ parentObject , array $ row ) { $ content = '' ; $ info = [ ] ; $ parentObject -> getProcessedValue ( 'tt_content' , 'starttime,endtime,fe_group,space_before_class,space_after_class' , $ row , $ info ) ; if ( ! empty ( $ GLOBALS [ 'TCA' ] [ 'tt_content' ] [ 'ct...
Draw the footer for a single tt_content element
1,299
protected function setColumnHeader ( PageLayoutView $ parentObject , & $ head , & $ colPos , & $ name , & $ editUidList , $ expanded = true ) { $ head [ $ colPos ] = $ this -> tt_content_drawColHeader ( $ name , ( $ parentObject -> doEdit && $ editUidList [ $ colPos ] ) ? '&edit[tt_content][' . $ editUidList [ $ colPos...
Sets the headers for a grid before content and headers are put together