idx
int64
0
60.3k
question
stringlengths
92
4.62k
target
stringlengths
7
635
38,800
public function clear ( ) : void { $ this -> cache = $ this -> cacheIndex = $ this -> cacheExpiryTime = $ this -> cacheAccessCount = [ ] ; }
Deletes all cache in the in - memory pool .
38,801
private function getNonDefaultSiteaccessName ( ) { $ defaultSiteaccessName = $ this -> getDefaultSiteaccessName ( ) ; foreach ( $ this -> getKernel ( ) -> getContainer ( ) -> getParameter ( 'ezpublish.siteaccess.list' ) as $ siteaccessName ) { if ( $ siteaccessName !== $ defaultSiteaccessName ) { return $ siteaccessNam...
Returns the name of an existing siteaccess that isn t the default one .
38,802
public function process ( ContainerBuilder $ container ) { if ( ! $ container -> hasAlias ( SchemaBuilder :: class ) || ! $ container -> hasDefinition ( self :: CLEAN_INSTALLER_DEF_ID ) ) { return ; } $ cleanInstallerDefinition = $ container -> getDefinition ( self :: CLEAN_INSTALLER_DEF_ID ) ; $ cleanInstallerDefiniti...
Replace Clean installer with CoreInstaller if required SchemaBuilder from DoctrineSchemaBundle is available .
38,803
private function getExpression ( ) { if ( $ this -> expression === null ) { $ this -> expression = '/(<\?xml.*\?>)?([ \t\n\r]*)(<' . preg_quote ( $ this -> documentElement , '/' ) . '.*xmlns="' . preg_quote ( $ this -> namespace , '/' ) . '".*>)/is' ; } return $ this -> expression ; }
Computes and returns regular expression pattern for matching and replacement .
38,804
public function setPrefix ( $ prefix ) { if ( $ prefix != '' ) { $ urlParts = parse_url ( $ prefix ) ; if ( isset ( $ urlParts [ 'scheme' ] ) || isset ( $ urlParts [ 'host' ] ) ) { $ prefix = rtrim ( $ prefix , '/' ) . '/' ; } else { $ prefix = '/' . trim ( $ prefix , '/' ) . '/' ; } } $ this -> prefix = $ prefix ; }
Makes the prefix absolute .
38,805
protected function convertArrayObjects ( $ data ) { if ( $ data instanceof Json \ ArrayObject ) { $ data = $ data -> getArrayCopy ( ) ; foreach ( $ data as $ key => $ value ) { $ data [ $ key ] = $ this -> convertArrayObjects ( $ value ) ; } } elseif ( $ data instanceof Json \ JsonObject ) { foreach ( $ data as $ key =...
Convert ArrayObjects to arrays .
38,806
public function endObjectElement ( $ name ) { $ this -> checkEndObjectElement ( $ name ) ; $ this -> json = $ this -> json -> getParent ( ) ; }
End object element .
38,807
public function endHashElement ( $ name ) { $ this -> checkEndHashElement ( $ name ) ; $ this -> json = $ this -> json -> getParent ( ) ; }
End hash element .
38,808
public function startList ( $ name ) { $ this -> checkStartList ( $ name ) ; $ array = new Json \ ArrayObject ( $ this -> json ) ; $ this -> json -> $ name = $ array ; $ this -> json = $ array ; }
Start list .
38,809
public function endList ( $ name ) { $ this -> checkEndList ( $ name ) ; $ this -> json = $ this -> json -> getParent ( ) ; }
End list .
38,810
protected function formatSVRLFailure ( DOMElement $ failedAssert ) { $ location = $ failedAssert -> getAttribute ( 'location' ) ; return ( strlen ( $ location ) ? $ location . ': ' : '' ) . $ failedAssert -> textContent ; }
Returns SVRL assertion failure as a string .
38,811
protected function checkStartDocument ( $ data ) { if ( count ( $ this -> stack ) ) { throw new Exceptions \ OutputGeneratorException ( 'Starting a document may only be the very first operation.' ) ; } $ this -> stack [ ] = array ( 'document' , $ data , array ( ) ) ; }
Check start document .
38,812
protected function checkStartHashElement ( $ data ) { $ this -> checkStart ( 'hashElement' , $ data , array ( 'document' , 'objectElement' , 'hashElement' , 'list' ) ) ; $ last = count ( $ this -> stack ) - 2 ; if ( $ this -> stack [ $ last ] [ 0 ] !== 'list' ) { if ( isset ( $ this -> stack [ $ last ] [ 2 ] [ $ data ]...
Check start hash element .
38,813
public function setSiteAccess ( SiteAccess $ siteAccess = null ) { if ( $ siteAccess === null ) { return ; } $ this -> matchConfig = $ this -> configResolver -> getParameter ( 'block_view' , 'ezsettings' , $ siteAccess -> name ) ; }
Changes internal configuration to use the one for passed SiteAccess .
38,814
private function groupsArraySetting ( array $ groups , $ id , array $ config , $ options = 0 ) { $ groupsSettings = array ( ) ; sort ( $ groups ) ; foreach ( $ groups as $ group ) { if ( isset ( $ config [ $ this -> siteAccessNodeName ] [ $ group ] [ $ id ] ) ) { if ( $ options & static :: MERGE_FROM_SECOND_LEVEL ) { f...
Merges setting array for a set of groups .
38,815
public function getField ( $ fieldDefIdentifier , $ languageCode = null ) { if ( null === $ languageCode ) { $ languageCode = $ this -> versionInfo -> contentInfo -> mainLanguageCode ; } if ( isset ( $ this -> fields [ $ fieldDefIdentifier ] [ $ languageCode ] ) ) { return $ this -> fields [ $ fieldDefIdentifier ] [ $ ...
This method returns the field for a given field definition identifier and language .
38,816
protected function selectAliasLanguageCode ( SPIURLAlias $ spiUrlAlias , ? string $ languageCode , bool $ showAllTranslations , array $ prioritizedLanguageList ) { if ( isset ( $ languageCode ) && ! in_array ( $ languageCode , $ spiUrlAlias -> languageCodes ) ) { return false ; } foreach ( $ prioritizedLanguageList as ...
Determines alias language code .
38,817
protected function extractPath ( SPIURLAlias $ spiUrlAlias , $ languageCode , $ showAllTranslations , array $ prioritizedLanguageList ) { $ pathData = array ( ) ; $ pathLevels = count ( $ spiUrlAlias -> pathData ) ; foreach ( $ spiUrlAlias -> pathData as $ level => $ levelEntries ) { if ( $ level === $ pathLevels - 1 )...
Returns path extracted from normalized path data returned from persistence using language settings .
38,818
protected function choosePrioritizedLanguageCode ( array $ entries , $ showAllTranslations , array $ prioritizedLanguageList ) { foreach ( $ prioritizedLanguageList as $ prioritizedLanguageCode ) { if ( isset ( $ entries [ 'translations' ] [ $ prioritizedLanguageCode ] ) ) { return $ prioritizedLanguageCode ; } } if ( ...
Returns language code with highest priority .
38,819
protected function matchPath ( SPIURLAlias $ spiUrlAlias , $ path , $ languageCode ) { $ matchedPathElements = array ( ) ; $ matchedPathLanguageCodes = array ( ) ; $ pathElements = explode ( '/' , $ path ) ; $ pathLevels = count ( $ spiUrlAlias -> pathData ) ; foreach ( $ pathElements as $ level => $ pathElement ) { if...
Matches path string with normalized path data returned from persistence .
38,820
private function sortTranslationsByPrioritizedLanguages ( array $ translations ) { $ sortedTranslations = array ( ) ; foreach ( $ this -> settings [ 'prioritizedLanguageList' ] as $ languageCode ) { if ( isset ( $ translations [ $ languageCode ] ) ) { $ sortedTranslations [ ] = array ( 'lang' => $ languageCode , 'text'...
Needed when translations for the part of the alias are the same for multiple languages . In that case we need to ensure that more prioritized language is chosen .
38,821
protected function buildSPIUrlAlias ( URLAlias $ urlAlias ) { return new SPIURLAlias ( array ( 'id' => $ urlAlias -> id , 'type' => $ urlAlias -> type , 'destination' => $ urlAlias -> destination , 'isCustom' => $ urlAlias -> isCustom , ) ) ; }
Builds persistence domain object .
38,822
public function lookup ( $ url , $ languageCode = null ) { $ url = $ this -> cleanUrl ( $ url ) ; $ spiUrlAlias = $ this -> urlAliasHandler -> lookup ( $ url ) ; list ( $ path , $ languageCodes ) = $ this -> matchPath ( $ spiUrlAlias , $ url , $ languageCode ) ; if ( $ path === false || ! $ this -> isPathLoadable ( $ s...
looks up the URLAlias for the given url .
38,823
public function deleteCorruptedUrlAliases ( ) : int { if ( $ this -> repository -> getPermissionResolver ( ) -> hasAccess ( 'content' , 'urltranslator' ) !== true ) { throw new UnauthorizedException ( 'content' , 'urltranslator' ) ; } return $ this -> urlAliasHandler -> deleteCorruptedUrlAliases ( ) ; }
Delete global system or custom URL alias pointing to non - existent Locations .
38,824
protected function buildUrlAliasDomainObject ( SPIURLAlias $ spiUrlAlias , string $ path ) { return new URLAlias ( array ( 'id' => $ spiUrlAlias -> id , 'type' => $ spiUrlAlias -> type , 'destination' => $ spiUrlAlias -> destination , 'languageCodes' => $ spiUrlAlias -> languageCodes , 'alwaysAvailable' => $ spiUrlAlia...
Builds API UrlAlias object from given SPI UrlAlias object .
38,825
protected function buildDomainObject ( Notification $ spiNotification ) : APINotification { return new APINotification ( [ 'id' => $ spiNotification -> id , 'ownerId' => $ spiNotification -> ownerId , 'isPending' => $ spiNotification -> isPending , 'type' => $ spiNotification -> type , 'created' => new DateTime ( "@{$s...
Builds Notification domain object from ValueObject returned by Persistence API .
38,826
public function listTrashed ( $ offset , $ limit , array $ sort = null ) { try { return $ this -> innerGateway -> listTrashed ( $ offset , $ limit , $ sort ) ; } catch ( DBALException $ e ) { throw new RuntimeException ( 'Database error' , 0 , $ e ) ; } catch ( PDOException $ e ) { throw new RuntimeException ( 'Databas...
Lists trashed items . Returns entries from ezcontentobject_trash .
38,827
protected function convertColumnsToProperties ( array $ databaseValues ) { $ propertyValues = [ ] ; $ propertyMap = $ this -> getPropertyMap ( ) ; foreach ( $ databaseValues as $ columnName => $ value ) { $ conversionFunction = $ propertyMap [ $ columnName ] [ 'cast' ] ; $ propertyValues [ $ propertyMap [ $ columnName ...
Convert the given database values to properties .
38,828
protected function fetchUserId ( $ fieldId ) { $ query = $ this -> connection -> createQueryBuilder ( ) ; $ query -> select ( $ this -> connection -> quoteIdentifier ( 'contentobject_id' ) ) -> from ( $ this -> connection -> quoteIdentifier ( 'ezcontentobject_attribute' ) ) -> where ( $ query -> expr ( ) -> eq ( $ this...
Fetch user content object id for the given field id .
38,829
public function countTypesInGroup ( $ groupId ) { try { return $ this -> innerGateway -> countTypesInGroup ( $ groupId ) ; } catch ( DBALException $ e ) { throw new RuntimeException ( 'Database error' , 0 , $ e ) ; } catch ( PDOException $ e ) { throw new RuntimeException ( 'Database error' , 0 , $ e ) ; } }
Returns the number of types in a certain group .
38,830
public function getStoragePathForField ( $ fieldId , $ versionNo , $ languageCode ) { return sprintf ( '%s/%s-%s-%s' , $ this -> getDirectoryStructure ( $ fieldId ) , $ fieldId , $ versionNo , $ languageCode ) ; }
Generates the storage path for the field identified by parameters .
38,831
protected function getCoreFieldType ( $ identifier ) { if ( ! isset ( $ this -> coreFieldTypeMap [ $ identifier ] ) ) { throw new FieldTypeNotFoundException ( $ identifier ) ; } $ fieldType = $ this -> coreFieldTypeMap [ $ identifier ] ; if ( ! $ this -> coreFieldTypeMap [ $ identifier ] instanceof FieldTypeInterface )...
Instantiates a FieldType object .
38,832
public function process ( ContainerBuilder $ container ) { if ( ! $ container -> hasDefinition ( $ this -> factoryId ) ) { return ; } $ searchEngineFactoryDefinition = $ container -> getDefinition ( $ this -> factoryId ) ; foreach ( $ container -> findTaggedServiceIds ( 'ezpublish.searchEngine' ) as $ id => $ attribute...
Registers all found search engines to the SearchEngineFactory .
38,833
public function getFieldDefinitionById ( $ fieldDefinitionId ) { if ( isset ( $ this -> fieldDefinitionsById [ $ fieldDefinitionId ] ) ) { return $ this -> fieldDefinitionsById [ $ fieldDefinitionId ] ; } return null ; }
This method returns the field definition for the given id .
38,834
public function createSessionAction ( Request $ request ) { $ sessionInput = $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) ) , $ request -> getContent ( ) ) ) ; $ request -> attributes -> set ( 'username' , $ sessionInput -> login ) ; $ reque...
Creates a new session based on the credentials provided as POST parameters .
38,835
private function hasStoredCsrfToken ( ) { if ( $ this -> csrfTokenManager === null ) { return true ; } return $ this -> csrfTokenManager -> hasToken ( $ this -> csrfTokenIntention ) ; }
Tests if a CSRF token is stored .
38,836
private function getCsrfToken ( ) { if ( $ this -> csrfTokenManager === null ) { return '' ; } return $ this -> csrfTokenManager -> getToken ( $ this -> csrfTokenIntention ) -> getValue ( ) ; }
Returns the csrf token for REST . The token is generated if it doesn t exist .
38,837
public function getIdUrlMap ( array $ ids ) { $ map = [ ] ; if ( ! empty ( $ ids ) ) { $ query = $ this -> connection -> createQueryBuilder ( ) ; $ query -> select ( $ this -> connection -> quoteIdentifier ( 'id' ) , $ this -> connection -> quoteIdentifier ( 'url' ) ) -> from ( self :: URL_TABLE ) -> where ( 'id IN (:i...
Return a list of URLs for a list of URL ids .
38,838
public function getUrlIdMap ( array $ urls ) { $ map = [ ] ; if ( ! empty ( $ urls ) ) { $ query = $ this -> connection -> createQueryBuilder ( ) ; $ query -> select ( $ this -> connection -> quoteIdentifier ( 'id' ) , $ this -> connection -> quoteIdentifier ( 'url' ) ) -> from ( self :: URL_TABLE ) -> where ( $ query ...
Return a list of URL ids for a list of URLs .
38,839
private function deleteOrphanedUrls ( ) { $ query = $ this -> connection -> createQueryBuilder ( ) ; $ query -> select ( $ this -> connection -> quoteIdentifier ( 'url.id' ) ) -> from ( $ this -> connection -> quoteIdentifier ( self :: URL_TABLE ) , 'url' ) -> leftJoin ( 'url' , $ this -> connection -> quoteIdentifier ...
Delete all orphaned URLs .
38,840
public function convertCriteria ( $ fieldTypeIdentifier , SelectQuery $ query , Criterion $ criterion , $ column ) { if ( $ this -> registry -> has ( $ fieldTypeIdentifier ) ) { return $ this -> registry -> get ( $ fieldTypeIdentifier ) -> handle ( $ query , $ criterion , $ column ) ; } if ( $ this -> defaultHandler ==...
Converts the criteria into query fragments .
38,841
protected function getQueryCondition ( Criterion $ filter , SelectQuery $ query , array $ languageFilter ) { $ condition = $ query -> expr -> lAnd ( $ this -> criteriaConverter -> convertCriteria ( $ query , $ filter , $ languageFilter ) , $ query -> expr -> eq ( 'ezcontentobject.status' , ContentInfo :: STATUS_PUBLISH...
Get query condition .
38,842
protected function getResultCount ( Criterion $ filter , array $ languageFilter ) { $ query = $ this -> handler -> createSelectQuery ( ) ; $ columnName = $ this -> handler -> quoteColumn ( 'id' , 'ezcontentobject' ) ; $ query -> select ( "COUNT( DISTINCT $columnName )" ) -> from ( $ this -> handler -> quoteTable ( 'ezc...
Get result count .
38,843
protected function getContentInfoList ( Criterion $ filter , $ sort , $ offset , $ limit , array $ languageFilter ) { $ query = $ this -> handler -> createSelectQuery ( ) ; $ query -> selectDistinct ( 'ezcontentobject.*' , $ this -> handler -> aliasedColumn ( $ query , 'main_node_id' , 'main_tree' ) ) ; if ( $ sort !==...
Get sorted arrays of content IDs which should be returned .
38,844
private function validateSettingName ( $ name ) { if ( ! isset ( $ this -> settingsSchema [ $ name ] ) ) { return new ValidationError ( "Setting '%setting%' is unknown" , null , [ '%setting%' => $ name , ] , "[$name]" ) ; } return null ; }
Validates the fieldSetting name .
38,845
private function validateDefaultAuthorSetting ( $ name , $ value ) { $ definedValues = [ self :: DEFAULT_VALUE_EMPTY , self :: DEFAULT_CURRENT_USER , ] ; if ( ! in_array ( $ value , $ definedValues , true ) ) { return new ValidationError ( "Setting '%setting%' has unknown default value" , null , [ '%setting%' => $ name...
Validates if the defaultAuthor setting has one of the defined values .
38,846
public function validateDocument ( DOMDocument $ xmlDocument ) : array { $ errors = [ ] ; $ xpath = new DOMXPath ( $ xmlDocument ) ; $ xpath -> registerNamespace ( 'docbook' , 'http://docbook.org/ns/docbook' ) ; foreach ( $ xpath -> query ( '//docbook:eztemplate' ) as $ tagElement ) { $ tagName = $ tagElement -> getAtt...
Validate Custom Tags found in the document .
38,847
public function getToolbarTemplate ( $ collectorName ) { if ( ! isset ( $ this -> data [ 'toolbarTemplates' ] [ $ collectorName ] ) ) { return null ; } return $ this -> data [ 'toolbarTemplates' ] [ $ collectorName ] ; }
Returns toolbar template for given collector name .
38,848
public function getPanelTemplate ( $ collectorName ) { if ( ! isset ( $ this -> data [ 'panelTemplates' ] [ $ collectorName ] ) ) { return null ; } return $ this -> data [ 'panelTemplates' ] [ $ collectorName ] ; }
Returns panel template to use for given collector name .
38,849
public function generateLanguageMaskFromLanguageIds ( array $ languageIds , $ alwaysAvailable ) : int { $ languageMask = $ alwaysAvailable ? 1 : 0 ; foreach ( $ languageIds as $ languageId ) { $ languageMask |= $ languageId ; } return $ languageMask ; }
Generates a language mask from pre - loaded Language Ids .
38,850
public function generateLanguageMaskFromLanguageCodes ( array $ languageCodes , bool $ isAlwaysAvailable = false ) : int { $ mask = $ isAlwaysAvailable ? 1 : 0 ; $ languageList = $ this -> languageHandler -> loadListByLanguageCodes ( $ languageCodes ) ; foreach ( $ languageList as $ language ) { $ mask |= $ language ->...
Generates a language mask from plain array of language codes and always available flag .
38,851
public function getState ( ) { $ hash = array ( ) ; foreach ( $ this -> getProperties ( ) as $ property ) { $ hash [ $ property ] = $ this -> $ property ; } return $ hash ; }
Returns available properties with their values as a simple hash .
38,852
public function parse ( Message $ message ) { if ( ! isset ( $ message -> headers [ 'Content-Type' ] ) ) { throw new Exceptions \ Parser ( 'Missing Content-Type header in message.' ) ; } $ mediaTypeParts = explode ( ';' , $ message -> headers [ 'Content-Type' ] ) ; $ contentTypeParts = explode ( '+' , $ mediaTypeParts ...
Parse provided request .
38,853
public function getPrioritizedLanguages ( ? array $ forcedLanguages ) : array { if ( $ forcedLanguages !== null ) { return $ forcedLanguages ; } if ( $ this -> defaultShowAllTranslations ) { return Language :: ALL ; } $ languages = [ ] ; if ( $ this -> contextLanguage !== null ) { $ languages [ ] = $ this -> contextLan...
Get prioritized languages taking into account forced - context - and lastly configured - languages .
38,854
public function getUseAlwaysAvailable ( ? bool $ forcedUseAlwaysAvailable = null ) : bool { if ( $ forcedUseAlwaysAvailable !== null ) { return $ forcedUseAlwaysAvailable ; } return $ this -> defaultUseAlwaysAvailable ; }
Get currently set UseAlwaysAvailable .
38,855
public function getShowAllTranslations ( ? bool $ forcedShowAllTranslations = null ) : bool { if ( $ forcedShowAllTranslations !== null ) { return $ forcedShowAllTranslations ; } return $ this -> defaultShowAllTranslations ; }
Get currently set showAllTranslations .
38,856
protected function getSortFieldName ( SortClause $ sortClause , $ contentTypeIdentifier , $ fieldDefinitionIdentifier , $ name = null ) { return $ this -> fieldNameResolver -> getSortFieldName ( $ sortClause , $ contentTypeIdentifier , $ fieldDefinitionIdentifier , $ name ) ; }
Get sort field name .
38,857
private function getCacheTags ( UrlAlias $ urlAlias , array $ tags = [ ] ) { $ tags [ ] = 'urlAlias-' . $ urlAlias -> id ; if ( $ urlAlias -> type === UrlAlias :: LOCATION ) { $ tags [ ] = 'urlAlias-location-' . $ urlAlias -> destination ; $ location = $ this -> persistenceHandler -> locationHandler ( ) -> load ( $ url...
Return relevant UrlAlias and optionally UrlAlias location tags so cache can be purged reliably .
38,858
public function createContentTypeGroup ( Request $ request ) { $ createStruct = $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) ) , $ request -> getContent ( ) ) ) ; try { return new Values \ CreatedContentTypeGroup ( array ( 'contentTypeGroup'...
Creates a new content type group .
38,859
public function updateContentTypeGroup ( $ contentTypeGroupId , Request $ request ) { $ createStruct = $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) ) , $ request -> getContent ( ) ) ) ; try { $ this -> contentTypeService -> updateContentType...
Updates a content type group .
38,860
public function listContentTypesForGroup ( $ contentTypeGroupId , Request $ request ) { $ contentTypes = $ this -> contentTypeService -> loadContentTypes ( $ this -> contentTypeService -> loadContentTypeGroup ( $ contentTypeGroupId , Language :: ALL ) , Language :: ALL ) ; if ( $ this -> getMediaType ( $ request ) === ...
Returns a list of content types of the group .
38,861
public function deleteContentTypeGroup ( $ contentTypeGroupId ) { $ contentTypeGroup = $ this -> contentTypeService -> loadContentTypeGroup ( $ contentTypeGroupId ) ; $ contentTypes = $ this -> contentTypeService -> loadContentTypes ( $ contentTypeGroup ) ; if ( ! empty ( $ contentTypes ) ) { throw new ForbiddenExcepti...
The given content type group is deleted .
38,862
public function loadContentTypeGroupList ( Request $ request ) { if ( $ request -> query -> has ( 'identifier' ) ) { $ contentTypeGroup = $ this -> contentTypeService -> loadContentTypeGroupByIdentifier ( $ request -> query -> get ( 'identifier' ) ) ; return new Values \ TemporaryRedirect ( $ this -> router -> generate...
Returns a list of all content type groups .
38,863
public function loadContentType ( $ contentTypeId ) { $ contentType = $ this -> contentTypeService -> loadContentType ( $ contentTypeId , Language :: ALL ) ; return new Values \ RestContentType ( $ contentType , $ contentType -> getFieldDefinitions ( ) ) ; }
Loads a content type .
38,864
public function listContentTypes ( Request $ request ) { if ( $ this -> getMediaType ( $ request ) === 'application/vnd.ez.api.contenttypelist' ) { $ return = new Values \ ContentTypeList ( array ( ) , $ request -> getPathInfo ( ) ) ; } else { $ return = new Values \ ContentTypeInfoList ( array ( ) , $ request -> getPa...
Returns a list of content types .
38,865
public function loadContentTypeByIdentifier ( Request $ request ) { return $ this -> contentTypeService -> loadContentTypeByIdentifier ( $ request -> query -> get ( 'identifier' ) , Language :: ALL ) ; }
Loads a content type by its identifier .
38,866
public function loadContentTypeByRemoteId ( Request $ request ) { return $ this -> contentTypeService -> loadContentTypeByRemoteId ( $ request -> query -> get ( 'remoteId' ) , Language :: ALL ) ; }
Loads a content type by its remote ID .
38,867
public function createContentType ( $ contentTypeGroupId , Request $ request ) { $ contentTypeGroup = $ this -> contentTypeService -> loadContentTypeGroup ( $ contentTypeGroupId ) ; $ publish = ( $ request -> query -> has ( 'publish' ) && $ request -> query -> get ( 'publish' ) === 'true' ) ; try { $ contentTypeDraft =...
Creates a new content type draft in the given content type group .
38,868
public function createContentTypeDraft ( $ contentTypeId , Request $ request ) { $ contentType = $ this -> contentTypeService -> loadContentType ( $ contentTypeId ) ; try { $ contentTypeDraft = $ this -> contentTypeService -> createContentTypeDraft ( $ contentType ) ; } catch ( BadStateException $ e ) { throw new Forbi...
Creates a draft and updates it with the given data .
38,869
public function loadContentTypeDraft ( $ contentTypeId ) { $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; return new Values \ RestContentType ( $ contentTypeDraft , $ contentTypeDraft -> getFieldDefinitions ( ) ) ; }
Loads a content type draft .
38,870
public function updateContentTypeDraft ( $ contentTypeId , Request $ request ) { $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; $ contentTypeUpdateStruct = $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ( 'Content...
Updates meta data of a draft . This method does not handle field definitions .
38,871
public function addContentTypeDraftFieldDefinition ( $ contentTypeId , Request $ request ) { $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; $ fieldDefinitionCreate = $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ...
Creates a new field definition for the given content type draft .
38,872
public function loadContentTypeFieldDefinitionList ( $ contentTypeId ) { $ contentType = $ this -> contentTypeService -> loadContentType ( $ contentTypeId , Language :: ALL ) ; return new Values \ FieldDefinitionList ( $ contentType , $ contentType -> getFieldDefinitions ( ) ) ; }
Loads field definitions for a given content type .
38,873
public function loadContentTypeFieldDefinition ( $ contentTypeId , $ fieldDefinitionId , Request $ request ) { $ contentType = $ this -> contentTypeService -> loadContentType ( $ contentTypeId , Language :: ALL ) ; foreach ( $ contentType -> getFieldDefinitions ( ) as $ fieldDefinition ) { if ( $ fieldDefinition -> id ...
Returns the field definition given by id .
38,874
public function loadContentTypeDraftFieldDefinitionList ( $ contentTypeId ) { $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; return new Values \ FieldDefinitionList ( $ contentTypeDraft , $ contentTypeDraft -> getFieldDefinitions ( ) ) ; }
Loads field definitions for a given content type draft .
38,875
public function loadContentTypeDraftFieldDefinition ( $ contentTypeId , $ fieldDefinitionId , Request $ request ) { $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; foreach ( $ contentTypeDraft -> getFieldDefinitions ( ) as $ fieldDefinition ) { if ( $ fieldDefinition -> i...
Returns the draft field definition given by id .
38,876
public function updateContentTypeDraftFieldDefinition ( $ contentTypeId , $ fieldDefinitionId , Request $ request ) { $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; $ fieldDefinitionUpdate = $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ r...
Updates the attributes of a field definition .
38,877
public function removeContentTypeDraftFieldDefinition ( $ contentTypeId , $ fieldDefinitionId , Request $ request ) { $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; $ fieldDefinition = null ; foreach ( $ contentTypeDraft -> getFieldDefinitions ( ) as $ fieldDef ) { if ( ...
Deletes a field definition from a content type draft .
38,878
public function publishContentTypeDraft ( $ contentTypeId ) { $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; $ fieldDefinitions = $ contentTypeDraft -> getFieldDefinitions ( ) ; if ( empty ( $ fieldDefinitions ) ) { throw new ForbiddenException ( 'Empty content type draf...
Publishes a content type draft .
38,879
public function deleteContentType ( $ contentTypeId ) { $ contentType = $ this -> contentTypeService -> loadContentType ( $ contentTypeId ) ; try { $ this -> contentTypeService -> deleteContentType ( $ contentType ) ; } catch ( BadStateException $ e ) { throw new ForbiddenException ( $ e -> getMessage ( ) ) ; } return ...
The given content type is deleted .
38,880
public function deleteContentTypeDraft ( $ contentTypeId ) { $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; $ this -> contentTypeService -> deleteContentType ( $ contentTypeDraft ) ; return new Values \ NoContent ( ) ; }
The given content type draft is deleted .
38,881
public function loadGroupsOfContentType ( $ contentTypeId ) { $ contentType = $ this -> contentTypeService -> loadContentType ( $ contentTypeId , Language :: ALL ) ; return new Values \ ContentTypeGroupRefList ( $ contentType , $ contentType -> getContentTypeGroups ( ) ) ; }
Returns the content type groups the content type belongs to .
38,882
public function linkContentTypeToGroup ( $ contentTypeId , Request $ request ) { $ contentType = $ this -> contentTypeService -> loadContentType ( $ contentTypeId ) ; try { $ contentTypeGroupId = $ this -> requestParser -> parseHref ( $ request -> query -> get ( 'group' ) , 'contentTypeGroupId' ) ; } catch ( Exceptions...
Links a content type group to the content type and returns the updated group list .
38,883
public function unlinkContentTypeFromGroup ( $ contentTypeId , $ contentTypeGroupId ) { $ contentType = $ this -> contentTypeService -> loadContentType ( $ contentTypeId ) ; $ contentTypeGroup = $ this -> contentTypeService -> loadContentTypeGroup ( $ contentTypeGroupId ) ; $ existingContentTypeGroups = $ contentType -...
Removes the given group from the content type and returns the updated group list .
38,884
private function mapToGroupUpdateStruct ( ContentTypeGroupCreateStruct $ createStruct ) { return new ContentTypeGroupUpdateStruct ( array ( 'identifier' => $ createStruct -> identifier , 'modifierId' => $ createStruct -> creatorId , 'modificationDate' => $ createStruct -> creationDate , ) ) ; }
Converts the provided ContentTypeGroupCreateStruct to ContentTypeGroupUpdateStruct .
38,885
public function getLimitationType ( $ identifier ) { if ( ! isset ( $ this -> settings [ 'limitationTypes' ] [ $ identifier ] ) ) { throw new LimitationNotFoundException ( $ identifier ) ; } return $ this -> settings [ 'limitationTypes' ] [ $ identifier ] ; }
Returns the LimitationType registered with the given identifier .
38,886
public function validateLimitations ( array $ limitations ) { $ allErrors = array ( ) ; foreach ( $ limitations as $ limitation ) { $ errors = $ this -> validateLimitation ( $ limitation ) ; if ( ! empty ( $ errors ) ) { $ allErrors [ $ limitation -> getIdentifier ( ) ] = $ errors ; } } return $ allErrors ; }
Validates an array of Limitations .
38,887
public function validateLimitation ( Limitation $ limitation ) { $ identifier = $ limitation -> getIdentifier ( ) ; if ( ! isset ( $ this -> settings [ 'limitationTypes' ] [ $ identifier ] ) ) { throw new BadStateException ( '$identifier' , "limitationType[{$identifier}] is not configured" ) ; } $ type = $ this -> sett...
Validates single Limitation .
38,888
protected function getContentInfo ( ) { if ( $ this -> object === null ) { if ( $ this -> contentInfoProxy === null ) { $ this -> contentInfoProxy = new ContentContentInfoProxy ( $ this , $ this -> id ) ; } return $ this -> contentInfoProxy ; } elseif ( $ this -> contentInfoProxy !== null ) { $ this -> contentInfoProxy...
Return content info in proxy form if we have not loaded object yet .
38,889
public function buildRootResource ( ) { $ language = new ExpressionLanguage ( ) ; $ resources = array ( ) ; foreach ( $ this -> resourceConfig as $ name => $ resource ) { $ resources [ ] = new Values \ Resource ( $ name , $ resource [ 'mediaType' ] , $ language -> evaluate ( $ resource [ 'href' ] , [ 'router' => $ this...
Build root resource .
38,890
public function loadLocation ( $ locationPath ) { $ location = $ this -> locationService -> loadLocation ( $ this -> extractLocationIdFromPath ( $ locationPath ) ) ; if ( trim ( $ location -> pathString , '/' ) != $ locationPath ) { throw new Exceptions \ NotFoundException ( "Could not find location with path string $l...
Loads a location .
38,891
public function deleteSubtree ( $ locationPath ) { $ location = $ this -> locationService -> loadLocation ( $ this -> extractLocationIdFromPath ( $ locationPath ) ) ; $ this -> locationService -> deleteLocation ( $ location ) ; return new Values \ NoContent ( ) ; }
Deletes a location .
38,892
public function moveSubtree ( $ locationPath , Request $ request ) { $ locationToMove = $ this -> locationService -> loadLocation ( $ this -> extractLocationIdFromPath ( $ locationPath ) ) ; $ destinationLocationId = null ; $ destinationHref = $ request -> headers -> get ( 'Destination' ) ; try { $ destinationLocationI...
Moves a subtree to a new location .
38,893
public function swapLocation ( $ locationPath , Request $ request ) { $ locationId = $ this -> extractLocationIdFromPath ( $ locationPath ) ; $ location = $ this -> locationService -> loadLocation ( $ locationId ) ; $ destinationLocation = $ this -> locationService -> loadLocation ( $ this -> extractLocationIdFromPath ...
Swaps a location with another one .
38,894
public function loadLocationByRemoteId ( Request $ request ) { return new Values \ LocationList ( array ( new Values \ RestLocation ( $ location = $ this -> locationService -> loadLocationByRemoteId ( $ request -> query -> get ( 'remoteId' ) ) , $ this -> locationService -> getLocationChildCount ( $ location ) ) , ) , ...
Loads a location by remote ID .
38,895
public function loadLocationsForContent ( $ contentId , Request $ request ) { $ restLocations = array ( ) ; $ contentInfo = $ this -> contentService -> loadContentInfo ( $ contentId ) ; foreach ( $ this -> locationService -> loadLocations ( $ contentInfo ) as $ location ) { $ restLocations [ ] = new Values \ RestLocati...
Loads all locations for content object .
38,896
public function loadLocationChildren ( $ locationPath , Request $ request ) { $ offset = $ request -> query -> has ( 'offset' ) ? ( int ) $ request -> query -> get ( 'offset' ) : 0 ; $ limit = $ request -> query -> has ( 'limit' ) ? ( int ) $ request -> query -> get ( 'limit' ) : 10 ; $ restLocations = array ( ) ; $ lo...
Loads child locations of a location .
38,897
public function updateLocation ( $ locationPath , Request $ request ) { $ locationUpdate = $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) ) , $ request -> getContent ( ) ) ) ; $ location = $ this -> locationService -> loadLocation ( $ this -> ...
Updates a location .
38,898
protected function copyConfigurationFile ( $ source , $ target ) { $ fs = new Filesystem ( ) ; $ fs -> copy ( $ source , $ target , true ) ; if ( ! $ this -> output -> isQuiet ( ) ) { $ this -> output -> writeln ( "Copied $source to $target" ) ; } }
Copy and override configuration file .
38,899
final protected function getKernelSQLFileForDBMS ( $ relativeFilePath ) { $ databasePlatform = $ this -> db -> getDatabasePlatform ( ) -> getName ( ) ; $ filePath = "{$this->baseDataDir}/{$databasePlatform}/{$relativeFilePath}" ; if ( ! is_readable ( $ filePath ) ) { throw new InvalidArgumentException ( '$relativeFileP...
Get DBMS - specific SQL data file path .