idx
int64
0
60.3k
question
stringlengths
92
4.62k
target
stringlengths
7
635
39,000
protected function buildObjectStateUpdateInputStruct ( APIObjectState $ objectState , $ identifier , $ defaultLanguageCode , $ names , $ descriptions ) { $ inputStruct = new InputStruct ( ) ; if ( $ identifier !== null && ( ! is_string ( $ identifier ) || empty ( $ identifier ) ) ) { throw new InvalidArgumentValue ( 'i...
Validates input for updating object states and builds the InputStruct object .
39,001
public function buildDomainRoleObject ( SPIRole $ role ) { $ rolePolicies = array ( ) ; foreach ( $ role -> policies as $ spiPolicy ) { $ rolePolicies [ ] = $ this -> buildDomainPolicyObject ( $ spiPolicy ) ; } return new Role ( array ( 'id' => $ role -> id , 'identifier' => $ role -> identifier , 'status' => $ role ->...
Maps provided SPI Role value object to API Role value object .
39,002
public function buildDomainPolicyObject ( SPIPolicy $ spiPolicy ) { $ policyLimitations = array ( ) ; if ( $ spiPolicy -> module !== '*' && $ spiPolicy -> function !== '*' && $ spiPolicy -> limitations !== '*' ) { foreach ( $ spiPolicy -> limitations as $ identifier => $ values ) { $ policyLimitations [ ] = $ this -> l...
Maps provided SPI Policy value object to API Policy value object .
39,003
public function buildDomainUserRoleAssignmentObject ( SPIRoleAssignment $ spiRoleAssignment , User $ user , APIRole $ role ) { $ limitation = null ; if ( ! empty ( $ spiRoleAssignment -> limitationIdentifier ) ) { $ limitation = $ this -> limitationService -> getLimitationType ( $ spiRoleAssignment -> limitationIdentif...
Builds the API UserRoleAssignment object from provided SPI RoleAssignment object .
39,004
public function buildDomainUserGroupRoleAssignmentObject ( SPIRoleAssignment $ spiRoleAssignment , UserGroup $ userGroup , APIRole $ role ) { $ limitation = null ; if ( ! empty ( $ spiRoleAssignment -> limitationIdentifier ) ) { $ limitation = $ this -> limitationService -> getLimitationType ( $ spiRoleAssignment -> li...
Builds the API UserGroupRoleAssignment object from provided SPI RoleAssignment object .
39,005
public function buildPersistenceRoleCreateStruct ( APIRoleCreateStruct $ roleCreateStruct ) { $ policiesToCreate = array ( ) ; foreach ( $ roleCreateStruct -> getPolicies ( ) as $ policyCreateStruct ) { $ policiesToCreate [ ] = $ this -> buildPersistencePolicyObject ( $ policyCreateStruct -> module , $ policyCreateStru...
Creates SPI Role create struct from provided API role create struct .
39,006
public function buildPersistencePolicyObject ( $ module , $ function , array $ limitations ) { $ limitationsToCreate = '*' ; if ( $ module !== '*' && $ function !== '*' && ! empty ( $ limitations ) ) { $ limitationsToCreate = array ( ) ; foreach ( $ limitations as $ limitation ) { $ limitationsToCreate [ $ limitation -...
Creates SPI Policy value object from provided module function and limitations .
39,007
public function createRoleDraft ( Role $ role ) { $ returnValue = $ this -> service -> createRoleDraft ( $ role ) ; $ this -> signalDispatcher -> emit ( new CreateRoleDraftSignal ( array ( 'roleId' => $ returnValue -> id , ) ) ) ; return $ returnValue ; }
Creates a new RoleDraft for existing Role .
39,008
public function updateRoleDraft ( RoleDraft $ roleDraft , RoleUpdateStruct $ roleUpdateStruct ) { $ returnValue = $ this -> service -> updateRoleDraft ( $ roleDraft , $ roleUpdateStruct ) ; $ this -> signalDispatcher -> emit ( new UpdateRoleDraftSignal ( array ( 'roleId' => $ roleDraft -> id , ) ) ) ; return $ returnVa...
Updates the properties of a role draft .
39,009
public function addPolicyByRoleDraft ( RoleDraft $ roleDraft , PolicyCreateStruct $ policyCreateStruct ) { $ returnValue = $ this -> service -> addPolicyByRoleDraft ( $ roleDraft , $ policyCreateStruct ) ; $ this -> signalDispatcher -> emit ( new AddPolicyByRoleDraftSignal ( array ( 'roleId' => $ roleDraft -> id , 'pol...
Adds a new policy to the role draft .
39,010
public function removePolicyByRoleDraft ( RoleDraft $ roleDraft , PolicyDraft $ policyDraft ) { $ returnValue = $ this -> service -> removePolicyByRoleDraft ( $ roleDraft , $ policyDraft ) ; $ this -> signalDispatcher -> emit ( new RemovePolicyByRoleDraftSignal ( array ( 'roleId' => $ roleDraft -> id , 'policyId' => $ ...
Removes a policy from a role draft .
39,011
public function deleteRoleDraft ( RoleDraft $ roleDraft ) { $ returnValue = $ this -> service -> deleteRoleDraft ( $ roleDraft ) ; $ this -> signalDispatcher -> emit ( new DeleteRoleDraftSignal ( array ( 'roleId' => $ roleDraft -> id , ) ) ) ; return $ returnValue ; }
Deletes the given role draft .
39,012
public function publishRoleDraft ( RoleDraft $ roleDraft ) { $ returnValue = $ this -> service -> publishRoleDraft ( $ roleDraft ) ; $ this -> signalDispatcher -> emit ( new PublishRoleDraftSignal ( array ( 'roleId' => $ roleDraft -> id , ) ) ) ; return $ returnValue ; }
Publishes a given Role draft .
39,013
public function deletePolicy ( Policy $ policy ) { $ returnValue = $ this -> service -> deletePolicy ( $ policy ) ; $ this -> signalDispatcher -> emit ( new RemovePolicySignal ( array ( 'roleId' => $ policy -> roleId , 'policyId' => $ policy -> id , ) ) ) ; return $ returnValue ; }
Delete a policy .
39,014
protected function getFieldDefinition ( array $ data ) { $ contentTypeId = $ this -> requestParser -> parseHref ( $ data [ '__url' ] , 'contentTypeId' ) ; $ fieldDefinitionId = $ this -> requestParser -> parseHref ( $ data [ '__url' ] , 'fieldDefinitionId' ) ; $ contentTypeDraft = $ this -> contentTypeService -> loadCo...
Returns field definition by typeFieldDefinitionDraft pattern URL .
39,015
public function validate ( APILimitationValue $ limitationValue ) : array { $ validationErrors = array ( ) ; $ existingLanguages = $ this -> persistenceLanguageHandler -> loadListByLanguageCodes ( $ limitationValue -> limitationValues ) ; $ missingLanguages = array_diff ( $ limitationValue -> limitationValues , array_k...
Makes sure every language code defined as limitation exists .
39,016
public function evaluate ( APILimitationValue $ value , APIUserReference $ currentUser , ValueObject $ object , array $ targets = null ) : ? bool { if ( null == $ targets ) { $ targets = [ ] ; } foreach ( $ targets as $ target ) { if ( ! $ target instanceof Target \ Version ) { continue ; } $ accessVote = $ this -> eva...
Evaluate permission against content & target .
39,017
private function evaluateContentCreateStruct ( ContentCreateStruct $ object , APILimitationValue $ value ) : ? bool { $ languageCodes = $ this -> getAllLanguageCodesFromCreateStruct ( $ object ) ; return empty ( array_diff ( $ languageCodes , $ value -> limitationValues ) ) ? self :: ACCESS_GRANTED : self :: ACCESS_DEN...
Evaluate language codes of allowed translations for ContentCreateStruct .
39,018
private function evaluateVersionTarget ( Target \ Version $ version , APILimitationValue $ value ) : ? bool { $ accessVote = self :: ACCESS_ABSTAIN ; if ( $ version -> newStatus === VersionInfo :: STATUS_DRAFT ) { $ accessVote = self :: ACCESS_GRANTED ; } if ( ! empty ( $ version -> allLanguageCodesList ) ) { $ accessV...
Evaluate permissions to create new Version .
39,019
private function evaluateMatchingAnyLimitation ( array $ languageCodesList , array $ limitationValues ) : bool { return empty ( array_intersect ( $ languageCodesList , $ limitationValues ) ) ? self :: ACCESS_DENIED : self :: ACCESS_GRANTED ; }
Allow access if any of the given language codes for translations matches any of the limitation values .
39,020
private function getAllLanguageCodesFromCreateStruct ( ContentCreateStruct $ contentCreateStruct ) : array { $ languageCodes = [ $ contentCreateStruct -> mainLanguageCode ] ; foreach ( $ contentCreateStruct -> fields as $ field ) { $ languageCodes [ ] = $ field -> languageCode ; } return array_unique ( $ languageCodes ...
Get unique list of language codes for all used translations including mainLanguageCode .
39,021
public function offsetSet ( $ index , $ value ) { if ( ! parent :: offsetExists ( $ index ) ) { throw new PropertyReadOnlyException ( $ index , __CLASS__ ) ; } parent :: offsetSet ( $ index , $ value ) ; }
Only allows existing indexes to be updated .
39,022
private function getSectionId ( $ locationId ) { $ location = $ this -> load ( $ locationId ) ; $ locationContentInfo = $ this -> contentHandler -> loadContentInfo ( $ location -> contentId ) ; return $ locationContentInfo -> sectionId ; }
Retrieves section ID of the location s content .
39,023
private function updateSubtreeSectionIfNecessary ( Location $ location , $ sectionId ) { if ( $ this -> isMainLocation ( $ location ) ) { $ this -> setSectionForSubtree ( $ location -> id , $ sectionId ) ; } }
If the location is the main location for its content updates subtree section .
39,024
private function isMainLocation ( Location $ location ) { $ locationContentInfo = $ this -> contentHandler -> loadContentInfo ( $ location -> contentId ) ; return $ locationContentInfo -> mainLocationId === $ location -> id ; }
Checks if the location is the main location for its content .
39,025
public function markSubtreeModified ( $ locationId , $ timestamp = null ) { $ nodeData = $ this -> locationGateway -> getBasicNodeData ( $ locationId ) ; $ timestamp = $ timestamp ? : time ( ) ; $ this -> locationGateway -> updateSubtreeModificationTime ( $ nodeData [ 'path_string' ] , $ timestamp ) ; }
Marks the given nodes and all ancestors as modified .
39,026
public function setInvisible ( int $ id ) : void { $ sourceNodeData = $ this -> locationGateway -> getBasicNodeData ( $ id ) ; $ this -> locationGateway -> setNodeWithChildrenInvisible ( $ sourceNodeData [ 'path_string' ] ) ; }
Sets a location + all children to invisible .
39,027
public function bulkIndex ( array $ contentList , callable $ errorCallback ) { $ fullTextBulkData = [ ] ; foreach ( $ contentList as $ content ) { try { $ fullTextBulkData [ ] = $ this -> mapper -> mapContent ( $ content ) ; } catch ( NotFoundException $ e ) { $ errorCallback ( $ content , $ e ) ; } } $ this -> indexer...
Bulk index list of content objects .
39,028
protected function setInsertColumns ( QueryBuilder $ queryBuilder , VersionInfo $ versionInfo , Field $ field ) { $ queryBuilder -> setValue ( 'contentobject_attribute_id' , ':fieldId' ) -> setValue ( 'filename' , ':filename' ) -> setValue ( 'mime_type' , ':mimeType' ) -> setValue ( 'original_filename' , ':originalFile...
Set the required insert columns to insert query builder .
39,029
public function getValidBlockItemsAsContentInfo ( Block $ block ) { $ contentInfoObjects = array ( ) ; foreach ( $ this -> getValidBlockItems ( $ block ) as $ item ) { try { $ contentInfoObjects [ ] = $ this -> contentService -> loadContentInfo ( $ item -> contentId ) ; } catch ( UnauthorizedException $ e ) { } } retur...
Returns valid block items as content objects .
39,030
protected function internalCreate ( CreateStruct $ struct , $ versionNo = 1 ) { $ content = new Content ( ) ; $ content -> fields = $ struct -> fields ; $ content -> versionInfo = $ this -> mapper -> createVersionInfoFromCreateStruct ( $ struct , $ versionNo ) ; $ content -> versionInfo -> contentInfo -> id = $ this ->...
Creates a new Content entity in the storage engine .
39,031
public function deleteVersion ( $ contentId , $ versionNo ) { $ versionInfo = $ this -> loadVersionInfo ( $ contentId , $ versionNo ) ; $ this -> locationGateway -> deleteNodeAssignment ( $ contentId , $ versionNo ) ; $ this -> fieldHandler -> deleteFields ( $ contentId , $ versionInfo ) ; $ this -> contentGateway -> d...
Deletes given version its fields node assignment relations and names .
39,032
private function createCurlHandlerForUrl ( URL $ url , array & $ handlers ) { $ handler = curl_init ( ) ; curl_setopt_array ( $ handler , [ CURLOPT_URL => $ url -> url , CURLOPT_RETURNTRANSFER => false , CURLOPT_FOLLOWLOCATION => true , CURLOPT_CONNECTTIMEOUT => $ this -> options [ 'connection_timeout' ] , CURLOPT_TIME...
Initialize and return a cURL session for given URL .
39,033
private function doValidate ( URL $ url , $ handler ) { $ this -> setUrlStatus ( $ url , $ this -> isSuccessful ( curl_getinfo ( $ handler , CURLINFO_HTTP_CODE ) ) ) ; }
Validate single response .
39,034
private function generateViewParametersArray ( $ vpString ) { $ vpString = trim ( $ vpString , '/' ) ; $ viewParameters = array ( ) ; $ vpSegments = explode ( '/' , $ vpString ) ; for ( $ i = 0 , $ iMax = count ( $ vpSegments ) ; $ i < $ iMax ; ++ $ i ) { if ( empty ( $ vpSegments [ $ i ] ) ) { continue ; } if ( $ vpSe...
Generates the view parameters array from the view parameters string .
39,035
public function setSiteAccess ( SiteAccess $ siteAccess = null ) { if ( $ this -> matcherFactory instanceof SiteAccessAware ) { $ this -> matcherFactory -> setSiteAccess ( $ siteAccess ) ; } }
Changes SiteAccess .
39,036
public function createSection ( SectionCreateStruct $ sectionCreateStruct ) { if ( ! is_string ( $ sectionCreateStruct -> name ) || empty ( $ sectionCreateStruct -> name ) ) { throw new InvalidArgumentValue ( 'name' , $ sectionCreateStruct -> name , 'SectionCreateStruct' ) ; } if ( ! is_string ( $ sectionCreateStruct -...
Creates a new Section in the content repository .
39,037
public function updateSection ( Section $ section , SectionUpdateStruct $ sectionUpdateStruct ) { if ( $ sectionUpdateStruct -> name !== null && ! is_string ( $ sectionUpdateStruct -> name ) ) { throw new InvalidArgumentValue ( 'name' , $ section -> name , 'Section' ) ; } if ( $ sectionUpdateStruct -> identifier !== nu...
Updates the given section in the content repository .
39,038
public function isSectionUsed ( Section $ section ) { return $ this -> sectionHandler -> assignmentsCount ( $ section -> id ) > 0 || $ this -> sectionHandler -> policiesCount ( $ section -> id ) > 0 || $ this -> sectionHandler -> countRoleAssignmentsUsingSection ( $ section -> id ) > 0 ; }
Returns true if the given section is assigned to contents or used in role policies or in role assignments .
39,039
public function assignSectionToSubtree ( Location $ location , Section $ section ) : void { $ loadedSubtree = $ this -> repository -> getLocationService ( ) -> loadLocation ( $ location -> id ) ; $ loadedSection = $ this -> loadSection ( $ section -> id ) ; $ sectionAssignCriterion = $ this -> permissionCriterionResolv...
Assigns the subtree to the given section this method overrides the current assigned section .
39,040
protected function buildDomainSectionObject ( SPISection $ spiSection ) { return new Section ( array ( 'id' => $ spiSection -> id , 'identifier' => $ spiSection -> identifier , 'name' => $ spiSection -> name , ) ) ; }
Builds API Section object from provided SPI Section object .
39,041
public function getZoneDefinitionByLayout ( $ layoutIdentifier ) { if ( ! isset ( $ this -> zoneDefinition [ $ layoutIdentifier ] ) ) { throw new OutOfBoundsException ( "Could not find an ezpage zone definition block for given layout '$layoutIdentifier'" ) ; } return $ this -> zoneDefinition [ $ layoutIdentifier ] ; }
Returns a zone definition for a given layout . It consists of a configuration array for the given layout .
39,042
public function getBlockDefinitionByIdentifier ( $ blockIdentifier ) { if ( ! isset ( $ this -> blockDefinition [ $ blockIdentifier ] ) ) { throw new OutOfBoundsException ( "Could not find an ezpage block definition for given identifier '$blockIdentifier'" ) ; } return $ this -> blockDefinition [ $ blockIdentifier ] ; ...
Returns a block definition for a given block identifier .
39,043
public function getLastValidBlockItem ( Block $ block ) { if ( isset ( $ this -> lastValidItems [ $ block ] ) ) { return $ this -> lastValidItems [ $ block ] ; } return $ this -> lastValidItems [ $ block ] = $ this -> getStorageGateway ( ) -> getLastValidBlockItem ( $ block ) ; }
Returns the last valid item for a given block .
39,044
protected function removePathPrefix ( $ path , $ prefix ) { if ( $ prefix !== '/' && mb_stripos ( $ path , $ prefix ) === 0 ) { $ path = mb_substr ( $ path , mb_strlen ( $ prefix ) ) ; } return $ path ; }
Removes prefix from path .
39,045
public function generate ( $ name , $ parameters = array ( ) , $ referenceType = UrlGeneratorInterface :: ABSOLUTE_PATH ) { if ( $ name instanceof Location ) { return $ this -> generator -> generate ( $ name , $ parameters , $ referenceType ) ; } if ( $ name === self :: URL_ALIAS_ROUTE_NAME ) { if ( isset ( $ parameter...
Generates a URL for a location from the given parameters .
39,046
public function addParser ( $ mediaType , Parser $ parser ) { list ( $ mediaType , $ version ) = $ this -> parseMediaTypeVersion ( $ mediaType ) ; $ this -> parsers [ $ mediaType ] [ $ version ] = $ parser ; }
Adds another parser for the given Content Type .
39,047
protected function parseMediaTypeVersion ( $ mediaType ) { $ version = '1.0' ; $ contentType = explode ( '; ' , $ mediaType ) ; if ( count ( $ contentType ) > 1 ) { $ mediaType = $ contentType [ 0 ] ; foreach ( array_slice ( $ contentType , 1 ) as $ parameterString ) { if ( strpos ( $ contentType [ 1 ] , '=' ) === fals...
Parses and returns the version from a MediaType .
39,048
public function postProcessValueHash ( $ outgoingValueHash ) { if ( ! isset ( $ outgoingValueHash [ 'destinationContentId' ] ) || ! $ this -> canMapContentHref ( ) ) { return $ outgoingValueHash ; } $ outgoingValueHash [ 'destinationContentHref' ] = $ this -> mapToContentHref ( $ outgoingValueHash [ 'destinationContent...
In addition to the destinationContentId adds a destinationContentHref entry .
39,049
public function setPrefix ( $ prefix ) { $ this -> publishedIOService -> setPrefix ( $ prefix ) ; $ this -> draftIOService -> setPrefix ( $ prefix ) ; }
Sets the IOService prefix .
39,050
private function setPrefixes ( ) { $ pathArray = array ( $ this -> optionsProvider -> getVarDir ( ) ) ; if ( $ storageDir = $ this -> optionsProvider -> getStorageDir ( ) ) { $ pathArray [ ] = $ storageDir ; } $ this -> draftPrefix = implode ( '/' , array_merge ( $ pathArray , array ( $ this -> optionsProvider -> getDr...
Computes the paths to published & draft images path using the options from the provider .
39,051
protected function setUrlStatus ( URL $ url , $ isValid ) { try { $ updateStruct = $ this -> urlService -> createUpdateStruct ( ) ; $ updateStruct -> isValid = $ isValid ; $ updateStruct -> lastChecked = new DateTime ( ) ; $ this -> urlService -> updateUrl ( $ url , $ updateStruct ) ; $ this -> logger -> info ( sprintf...
Sets URL status .
39,052
public function bulkIndexContent ( array $ contentObjects ) { $ documents = array ( ) ; foreach ( $ contentObjects as $ content ) { $ documents [ ] = $ this -> mapper -> mapContent ( $ content ) ; } $ this -> gateway -> bulkIndex ( $ documents ) ; }
Indexes several content objects .
39,053
public function indexLocation ( Location $ location ) { $ document = $ this -> mapper -> mapLocation ( $ location ) ; $ this -> gateway -> index ( $ document ) ; }
Indexes a Location in the index storage .
39,054
public function bulkIndexLocations ( array $ locations ) { $ documents = array ( ) ; foreach ( $ locations as $ location ) { $ documents [ ] = $ this -> mapper -> mapLocation ( $ location ) ; } $ this -> gateway -> bulkIndex ( $ documents ) ; }
Indexes several Locations .
39,055
public function deleteContent ( $ contentId , $ versionId = null ) { if ( $ versionId === null ) { $ this -> gateway -> deleteByQuery ( json_encode ( [ 'query' => [ 'match' => [ '_id' => $ contentId ] ] ] ) , $ this -> contentDocumentTypeIdentifier ) ; } else { $ this -> gateway -> delete ( $ contentId , $ this -> cont...
Deletes a content object from the index .
39,056
public function deleteLocation ( $ locationId , $ contentId ) { $ ast = array ( 'filter' => array ( 'and' => array ( 0 => array ( 'nested' => array ( 'path' => 'locations_doc' , 'filter' => array ( 'regexp' => array ( 'locations_doc.path_string_id' => ".*/{$locationId}/.*" , ) , ) , ) , ) , 1 => array ( 'nested' => arr...
Deletes a location from the index .
39,057
public function purgeIndex ( ) { $ this -> gateway -> purgeIndex ( $ this -> contentDocumentTypeIdentifier ) ; $ this -> gateway -> purgeIndex ( $ this -> locationDocumentTypeIdentifier ) ; }
Purges all contents from the index .
39,058
protected function loadObject ( ) { $ this -> object = $ this -> proxy -> getVersionInfo ( ) -> getContentInfo ( ) ; $ this -> proxy = null ; }
Get the inner content Info value object from ContentProxy .
39,059
private function isValidSelectionMethod ( $ selectionMethod ) { return in_array ( $ selectionMethod , [ self :: SELECTION_BROWSE , self :: SELECTION_DROPDOWN , self :: SELECTION_LIST_WITH_RADIO_BUTTONS , self :: SELECTION_LIST_WITH_CHECKBOXES , self :: SELECTION_MULTIPLE_SELECTION_LIST , self :: SELECTION_TEMPLATE_BASE...
Checks whether given selectionMethod is valid .
39,060
public function getRole ( $ identifier ) { $ role = null ; try { $ role = $ this -> roleService -> loadRoleByIdentifier ( $ identifier ) ; } catch ( ApiExceptions \ NotFoundException $ e ) { } return $ role ; }
Fetches the role with identifier .
39,061
public function getLastValidBlockItem ( Block $ block ) { $ dbHandler = $ this -> getConnection ( ) ; $ q = $ dbHandler -> createSelectQuery ( ) ; $ q -> select ( 'object_id, node_id, priority, ts_publication, ts_visible, rotation_until, moved_to' ) -> from ( $ dbHandler -> quoteTable ( 'ezm_pool' ) ) -> where ( $ q ->...
Returns the block item having a highest visible date for given block . Will return null if no block item is registered for block .
39,062
protected function buildBlockItem ( array $ row ) { return new Item ( array ( 'blockId' => $ row [ 'block_id' ] , 'contentId' => ( int ) $ row [ 'object_id' ] , 'locationId' => ( int ) $ row [ 'node_id' ] , 'priority' => ( int ) $ row [ 'priority' ] , 'publicationDate' => new DateTime ( "@{$row['ts_publication']}" ) , ...
Builds a Page \ Parts \ Item object from a row returned from ezm_pool table .
39,063
private function getValueTypeCheckCallback ( $ valueTypes ) { $ callback = function ( $ value ) { return false ; } ; if ( $ valueTypes & Specifications :: TYPE_INTEGER ) { $ callback = function ( $ value ) use ( $ callback ) { return is_numeric ( $ value ) || $ callback ( $ value ) ; } ; } if ( $ valueTypes & Specifica...
Returns a callback that checks the values types depending on the operator specifications .
39,064
protected function getWordExpression ( SelectQuery $ query , $ token ) { if ( $ this -> configuration [ 'enableWildcards' ] && $ token [ 0 ] === '*' ) { return $ query -> expr -> like ( $ this -> dbHandler -> quoteColumn ( 'word' ) , $ query -> bindValue ( '%' . substr ( $ token , 1 ) ) ) ; } if ( $ this -> configurati...
Get single word query expression .
39,065
protected function getWordIdSubquery ( SelectQuery $ query , $ string ) { $ subQuery = $ query -> subSelect ( ) ; $ tokens = $ this -> tokenizeString ( $ this -> processor -> transform ( $ string , $ this -> configuration [ 'commands' ] ) ) ; $ wordExpressions = array ( ) ; foreach ( $ tokens as $ token ) { $ wordExpre...
Get subquery to select relevant word IDs .
39,066
protected function getStopWordThresholdValue ( ) { if ( $ this -> stopWordThresholdValue !== null ) { return $ this -> stopWordThresholdValue ; } $ query = $ this -> dbHandler -> createSelectQuery ( ) ; $ query -> select ( $ query -> alias ( $ query -> expr -> count ( '*' ) , 'count' ) ) -> from ( $ this -> dbHandler -...
Returns an exact content object count threshold to ignore common terms on .
39,067
public function getType ( $ name ) { if ( ! isset ( $ this -> types [ $ name ] ) ) { throw new \ OutOfBoundsException ( "No type registered for $name." ) ; } return $ this -> types [ $ name ] ; }
Get Indexable type .
39,068
public function getPermissionsCriterion ( $ module = 'content' , $ function = 'read' , ? array $ targets = null ) { $ permissionSets = $ this -> permissionResolver -> hasAccess ( $ module , $ function ) ; if ( is_bool ( $ permissionSets ) ) { return $ permissionSets ; } if ( empty ( $ permissionSets ) ) { throw new Run...
Get permission criteria if needed and return false if no access at all .
39,069
protected function getBoundingCoordinates ( MapLocationValue $ location , $ distance ) { $ radiansLatitude = deg2rad ( $ location -> latitude ) ; $ radiansLongitude = deg2rad ( $ location -> longitude ) ; $ angularDistance = $ distance / self :: EARTH_RADIUS ; $ deltaLongitude = asin ( sin ( $ angularDistance ) / cos (...
Calculates and returns bounding box coordinates .
39,070
public function postProcessValueHash ( $ outgoingValueHash ) { if ( ! isset ( $ outgoingValueHash [ 'destinationContentIds' ] ) || ! is_array ( $ outgoingValueHash [ 'destinationContentIds' ] ) || ! $ this -> canMapContentHref ( ) ) { return $ outgoingValueHash ; } $ outgoingValueHash [ 'destinationContentHrefs' ] = ar...
In addition to the list of destinationContentIds adds a destinationContentHrefs array with matching content uris .
39,071
protected function internalFindContentInfo ( Query $ query , array $ languageFilter = array ( ) , $ filterOnUserPermissions = true ) { if ( ! is_int ( $ query -> offset ) ) { throw new InvalidArgumentType ( '$query->offset' , 'integer' , $ query -> offset ) ; } if ( ! is_int ( $ query -> limit ) ) { throw new InvalidAr...
Finds SPI content info objects for the given query .
39,072
protected function addPermissionsCriterion ( Criterion & $ criterion ) { $ permissionCriterion = $ this -> permissionCriterionResolver -> getPermissionsCriterion ( 'content' , 'read' ) ; if ( $ permissionCriterion === true || $ permissionCriterion === false ) { return $ permissionCriterion ; } if ( $ criterion instance...
Adds content read Permission criteria if needed and return false if no access at all .
39,073
public function load ( $ contentTypeId , $ status = Type :: STATUS_DEFINED ) { return $ this -> loadFromRows ( $ this -> contentTypeGateway -> loadTypeData ( $ contentTypeId , $ status ) , $ contentTypeId , $ status ) ; }
Loads a content type by id and status .
39,074
protected function internalCreate ( CreateStruct $ createStruct , $ contentTypeId = null ) { foreach ( $ createStruct -> fieldDefinitions as $ fieldDef ) { if ( ! is_int ( $ fieldDef -> position ) ) { throw new InvalidArgumentException ( 'position' , "'" . var_export ( $ fieldDef -> position , true ) . "' is wrong valu...
Internal method for creating ContentType .
39,075
public function createDraft ( $ modifierId , $ contentTypeId ) { $ createStruct = $ this -> mapper -> createCreateStructFromType ( $ this -> load ( $ contentTypeId , Type :: STATUS_DEFINED ) ) ; $ createStruct -> status = Type :: STATUS_DRAFT ; $ createStruct -> modifierId = $ modifierId ; $ createStruct -> modified = ...
Creates a draft of existing defined content type .
39,076
public function unlink ( $ groupId , $ contentTypeId , $ status ) { $ groupCount = $ this -> contentTypeGateway -> countGroupsForType ( $ contentTypeId , $ status ) ; if ( $ groupCount < 2 ) { throw new Exception \ RemoveLastGroupFromType ( $ contentTypeId , $ status ) ; } $ this -> contentTypeGateway -> deleteGroupAss...
Unlink a content type group from a content type .
39,077
public function link ( $ groupId , $ contentTypeId , $ status ) { $ this -> contentTypeGateway -> insertGroupAssignment ( $ groupId , $ contentTypeId , $ status ) ; return true ; }
Link a content type group with a content type .
39,078
public function getFieldDefinition ( $ id , $ status ) { $ rows = $ this -> contentTypeGateway -> loadFieldDefinition ( $ id , $ status ) ; if ( $ rows === false ) { throw new NotFoundException ( 'FieldDefinition' , array ( 'id' => $ id , 'status' => $ status , ) ) ; } $ multilingualData = $ this -> mapper -> extractMu...
Returns field definition for the given field definition id .
39,079
public function addFieldDefinition ( $ contentTypeId , $ status , FieldDefinition $ fieldDefinition ) { $ storageFieldDef = new StorageFieldDefinition ( ) ; $ this -> mapper -> toStorageFieldDefinition ( $ fieldDefinition , $ storageFieldDef ) ; $ fieldDefinition -> id = $ this -> contentTypeGateway -> insertFieldDefin...
Adds a new field definition to an existing Type .
39,080
public function removeFieldDefinition ( $ contentTypeId , $ status , $ fieldDefinitionId ) { $ this -> contentTypeGateway -> deleteFieldDefinition ( $ contentTypeId , $ status , $ fieldDefinitionId ) ; return true ; }
Removes a field definition from an existing Type .
39,081
public function publish ( $ contentTypeId ) { $ toType = $ this -> load ( $ contentTypeId , Type :: STATUS_DRAFT ) ; try { $ fromType = $ this -> load ( $ contentTypeId , Type :: STATUS_DEFINED ) ; $ this -> updateHandler -> updateContentObjects ( $ fromType , $ toType ) ; $ this -> updateHandler -> deleteOldType ( $ f...
Update content objects .
39,082
public function getConnection ( ) { $ repositoryConfig = $ this -> repositoryConfigurationProvider -> getRepositoryConfig ( ) ; if ( isset ( $ repositoryConfig [ 'search' ] [ 'connection' ] ) ) { $ doctrineConnectionId = sprintf ( 'doctrine.dbal.%s_connection' , $ repositoryConfig [ 'search' ] [ 'connection' ] ) ; } el...
Returns database connection used by database handler .
39,083
public function bulkIndex ( array $ documents ) { if ( empty ( $ documents ) ) { return ; } $ payload = '' ; foreach ( $ documents as $ document ) { $ payload .= $ this -> serializer -> getIndexMetadata ( $ document ) . "\n" ; $ payload .= $ this -> serializer -> getIndexDocument ( $ document ) . "\n" ; } $ result = $ ...
Performs bulk index of a given array of documents .
39,084
private function processConnectionConfiguration ( ContainerBuilder $ container , $ config ) { $ alias = $ this -> getAlias ( ) ; if ( isset ( $ config [ 'default_connection' ] ) ) { $ container -> setParameter ( "{$alias}.default_connection" , $ config [ 'default_connection' ] ) ; } elseif ( ! empty ( $ config [ 'conne...
Processes connection configuration by flattening connection parameters and setting them to the container as parameters .
39,085
private function configureSearchServices ( ContainerBuilder $ container , $ connectionName , $ connectionParams ) { $ alias = $ this -> getAlias ( ) ; $ httpClientId = static :: HTTP_CLIENT_ID . ".$connectionName" ; $ httpClientDef = new DefinitionDecorator ( self :: HTTP_CLIENT_ID ) ; $ httpClientDef -> replaceArgumen...
Creates needed search services for given connection name and parameters .
39,086
public function setBody ( $ body ) { $ this -> body = empty ( $ body ) ? null : Stream :: factory ( $ body ) ; }
Set request body .
39,087
private function executeCommand ( OutputInterface $ output , $ cmd , $ timeout = 300 ) { $ phpFinder = new PhpExecutableFinder ( ) ; if ( ! $ phpPath = $ phpFinder -> find ( false ) ) { throw new \ RuntimeException ( 'The php executable could not be found, add it to your PATH environment variable and try again' ) ; } $...
Executes a Symfony command in separate process .
39,088
final protected function getMultipleCacheItems ( array $ ids , string $ keyPrefix , callable $ missingLoader , callable $ loadedTagger , array $ keySuffixes = [ ] ) : array { if ( empty ( $ ids ) ) { return [ ] ; } $ cacheKeys = [ ] ; $ cacheKeysToIdMap = [ ] ; foreach ( \ array_unique ( $ ids ) as $ id ) { $ key = $ k...
Helper for getting multiple cache items in one call and do the id extraction for you .
39,089
protected function updateFieldData ( VersionInfo $ versionInfo , Field $ field ) { $ updateQuery = $ this -> connection -> createQueryBuilder ( ) ; $ updateQuery -> update ( $ this -> connection -> quoteIdentifier ( self :: MAP_LOCATION_TABLE ) ) -> set ( $ this -> connection -> quoteIdentifier ( 'latitude' ) , ':latit...
Perform an update on the field data .
39,090
protected function storeNewFieldData ( VersionInfo $ versionInfo , Field $ field ) { $ insertQuery = $ this -> connection -> createQueryBuilder ( ) ; $ insertQuery -> insert ( $ this -> connection -> quoteIdentifier ( self :: MAP_LOCATION_TABLE ) ) -> values ( [ 'latitude' => ':latitude' , 'longitude' => ':longitude' ,...
Store new field data .
39,091
public function getVariation ( Field $ field , VersionInfo $ versionInfo , $ variationName , array $ parameters = [ ] ) { $ variation = $ this -> aliasGenerator -> getVariation ( $ field , $ versionInfo , $ variationName , $ parameters ) ; if ( null === $ variation -> width || null === $ variation -> height ) { $ varia...
Returns a Variation object ensuring proper image dimensions .
39,092
private function getVariationBinaryFile ( $ originalPath , $ variationName ) { if ( $ variationName !== IORepositoryResolver :: VARIATION_ORIGINAL ) { $ variationPath = $ this -> variationPathGenerator -> getVariationPath ( $ originalPath , $ variationName ) ; } else { $ variationPath = $ originalPath ; } return $ this...
Get image variation filesystem path .
39,093
public function createURLWildcard ( Request $ request ) { $ urlWildcardCreate = $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) ) , $ request -> getContent ( ) ) ) ; try { $ createdURLWildcard = $ this -> urlWildcardService -> create ( $ urlWil...
Creates a new URL wildcard .
39,094
public function deleteURLWildcard ( $ urlWildcardId ) { $ this -> urlWildcardService -> remove ( $ this -> urlWildcardService -> load ( $ urlWildcardId ) ) ; return new Values \ NoContent ( ) ; }
The given URL wildcard is deleted .
39,095
private function validateCustomTagsConfiguration ( ContainerInterface $ container , array $ enabledCustomTags ) { $ definedCustomTags = array_keys ( $ container -> getParameter ( EzPublishCoreExtension :: RICHTEXT_CUSTOM_TAGS_PARAMETER ) ) ; foreach ( $ enabledCustomTags as $ customTagName ) { if ( ! in_array ( $ custo...
Validate SiteAccess - defined Custom Tags configuration against global one .
39,096
private function validateCustomStylesConfiguration ( ContainerInterface $ container , array $ enabledCustomStyles ) { $ definedCustomStyles = array_keys ( $ container -> getParameter ( EzPublishCoreExtension :: RICHTEXT_CUSTOM_STYLES_PARAMETER ) ) ; foreach ( $ enabledCustomStyles as $ customStyleName ) { if ( ! in_arr...
Validate SiteAccess - defined Custom Styles configuration against global one .
39,097
public function mapConfig ( array $ config , $ mapper ) { $ mapperCallable = is_callable ( $ mapper ) ; if ( ! $ mapperCallable && ! $ mapper instanceof ConfigurationMapperInterface ) { throw new InvalidArgumentException ( 'Configuration mapper must either be a callable or an instance of ConfigurationMapper.' ) ; } if ...
Triggers mapping process between semantic and internal configuration .
39,098
protected function validateCriterionInput ( Criterion $ criterion ) { if ( ! isset ( $ criterion -> criteria [ 0 ] ) || ( count ( $ criterion -> criteria ) > 1 ) ) { throw new RuntimeException ( 'Invalid aggregation in LogicalNot criterion.' ) ; } }
Validates criterion .
39,099
public function insertExistingField ( Content $ content , Field $ field , StorageFieldValue $ value ) { $ q = $ this -> dbHandler -> createInsertQuery ( ) ; $ this -> setInsertFieldValues ( $ q , $ content , $ field , $ value ) ; $ q -> set ( $ this -> dbHandler -> quoteColumn ( 'id' ) , $ q -> bindValue ( $ field -> i...
Inserts an existing field .