idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
38,900 | public function getViewParameters ( Field $ field ) { $ parameters = array ( ) ; $ request = $ this -> getCurrentRequest ( ) ; if ( $ request && $ request -> attributes -> has ( '_locale' ) ) { $ parameters [ 'locale' ] = $ request -> attributes -> get ( '_locale' ) ; } else { $ parameters [ 'locale' ] = $ this -> loca... | Returns a hash with locale as key and locale string in POSIX format as value . |
38,901 | public function dispatch ( Request $ request , $ result ) { foreach ( $ request -> getAcceptableContentTypes ( ) as $ mimeType ) { foreach ( $ this -> mapping as $ regexp => $ visitor ) { if ( preg_match ( $ regexp , $ mimeType ) ) { return $ visitor -> visit ( $ result ) ; } } } throw new RuntimeException ( 'No view m... | Dispatches a visitable result to the mapped visitor . |
38,902 | private function addRichTextSection ( ArrayNodeDefinition $ rootNode ) { $ ezRichTextNode = $ rootNode -> children ( ) -> arrayNode ( 'ezrichtext' ) -> children ( ) ; $ this -> addCustomTagsSection ( $ ezRichTextNode ) ; $ this -> addCustomStylesSection ( $ ezRichTextNode ) ; $ ezRichTextNode -> end ( ) -> end ( ) -> e... | Define global Semantic Configuration for RichText . |
38,903 | private function addCustomStylesSection ( NodeBuilder $ ezRichTextNode ) { return $ ezRichTextNode -> arrayNode ( 'custom_styles' ) -> useAttributeAsKey ( 'style' ) -> arrayPrototype ( ) -> children ( ) -> scalarNode ( 'template' ) -> defaultNull ( ) -> end ( ) -> scalarNode ( 'inline' ) -> defaultFalse ( ) -> end ( ) ... | Define RichText Custom Styles Semantic Configuration . |
38,904 | private function addImagePlaceholderSection ( ArrayNodeDefinition $ rootNode ) { $ rootNode -> children ( ) -> arrayNode ( 'image_placeholder' ) -> info ( 'Configuration for strategy of replacing missing images' ) -> useAttributeAsKey ( 'name' ) -> arrayPrototype ( ) -> children ( ) -> scalarNode ( 'provider' ) -> end ... | Defines configuration the images placeholder generation . |
38,905 | private function addUrlAliasSection ( ArrayNodeDefinition $ rootNode ) { return $ rootNode -> children ( ) -> arrayNode ( 'url_alias' ) -> children ( ) -> arrayNode ( 'slug_converter' ) -> children ( ) -> scalarNode ( 'transformation' ) -> end ( ) -> scalarNode ( 'separator' ) -> end ( ) -> arrayNode ( 'transformation_... | Define Url Alias Slug converter Semantic Configuration . |
38,906 | public function resolveUrlAliasSchema ( Content $ content , ContentType $ contentType = null ) { if ( $ contentType === null ) { $ contentType = $ this -> contentTypeHandler -> load ( $ content -> contentInfo -> contentTypeId ) ; } return $ this -> resolve ( strlen ( $ contentType -> urlAliasSchema ) === 0 ? $ contentT... | Convenience method for resolving URL alias schema . |
38,907 | public function resolve ( $ nameSchema , $ contentType , array $ fieldMap , array $ languageCodes ) { list ( $ filteredNameSchema , $ groupLookupTable ) = $ this -> filterNameSchema ( $ nameSchema ) ; $ tokens = $ this -> extractTokens ( $ filteredNameSchema ) ; $ schemaIdentifiers = $ this -> getIdentifiers ( $ nameSc... | Returns the real name for a content name pattern . |
38,908 | protected function getFieldTitles ( array $ schemaIdentifiers , $ contentType , array $ fieldMap , $ languageCode ) { $ fieldTitles = array ( ) ; foreach ( $ schemaIdentifiers as $ fieldDefinitionIdentifier ) { if ( isset ( $ fieldMap [ $ fieldDefinitionIdentifier ] [ $ languageCode ] ) ) { if ( $ contentType instanceo... | Fetches the list of available Field identifiers in the token and returns an array of their current title value . |
38,909 | protected function getIdentifiers ( $ schemaString ) { $ allTokens = '#<(.*)>#U' ; $ identifiers = '#\\W#' ; $ tmpArray = array ( ) ; preg_match_all ( $ allTokens , $ schemaString , $ matches ) ; foreach ( $ matches [ 1 ] as $ match ) { $ tmpArray [ ] = preg_split ( $ identifiers , $ match , - 1 , PREG_SPLIT_NO_EMPTY )... | Returns all identifiers from all tokens in the name schema . |
38,910 | protected function searchChildrenLocations ( APILocation $ location , $ offset = 0 , $ limit = - 1 , array $ prioritizedLanguages = null ) { $ query = new LocationQuery ( [ 'filter' => new Criterion \ ParentLocationId ( $ location -> id ) , 'offset' => $ offset >= 0 ? ( int ) $ offset : 0 , 'limit' => $ limit >= 0 ? ( ... | Searches children locations of the provided parent location id . |
38,911 | private function fetchRow ( ) { ++ $ this -> cursor ; $ fileId = $ this -> rowReader -> getRow ( ) ; $ this -> item = $ fileId ; } | Fetches the next item from the resultset and moves the cursor forward . |
38,912 | private function addNewNotEmptyXmlElement ( DOMDocument $ dom , DOMElement $ node , $ name , $ value ) { if ( ! empty ( $ value ) ) { $ this -> addNewXmlElement ( $ dom , $ node , $ name , $ value ) ; } } | Utility method to add new elements to an xml node if their value is not empty . |
38,913 | private function addNewXmlElement ( DOMDocument $ dom , DOMElement $ node , $ name , $ value ) { $ new = $ dom -> createElement ( $ name ) ; $ new -> appendChild ( $ dom -> createTextNode ( $ value ) ) ; $ node -> appendChild ( $ new ) ; } | Utility method to add new elements to an xml node . |
38,914 | public function restoreValueFromXmlString ( $ xmlString ) { $ zones = array ( ) ; $ attributes = array ( ) ; $ layout = null ; if ( $ xmlString ) { $ dom = new DOMDocument ( '1.0' , 'utf-8' ) ; $ dom -> loadXML ( $ xmlString ) ; $ root = $ dom -> documentElement ; foreach ( $ root -> childNodes as $ node ) { if ( $ nod... | Restores value from XML string . |
38,915 | public function buildRepository ( PersistenceHandler $ persistenceHandler , SearchHandler $ searchHandler , BackgroundIndexer $ backgroundIndexer , RelationProcessor $ relationProcessor ) { $ repository = new $ this -> repositoryClass ( $ persistenceHandler , $ searchHandler , $ backgroundIndexer , $ relationProcessor ... | Builds the main repository heart of eZ Publish API . |
38,916 | protected function getMatchedSiteAccess ( ) { if ( isset ( $ this -> matchedSiteAccess ) ) { return $ this -> matchedSiteAccess ; } preg_match ( "@{$this->regex}@" , $ this -> element , $ match ) ; $ this -> matchedSiteAccess = isset ( $ match [ $ this -> itemNumber ] ) ? $ match [ $ this -> itemNumber ] : false ; retu... | Returns matched SiteAccess . |
38,917 | public function viewBlock ( Block $ block , array $ params = array ( ) , array $ cacheSettings = array ( ) ) { $ response = new Response ( ) ; if ( $ this -> getParameter ( 'content.view_cache' ) === true ) { $ response -> setPublic ( ) ; if ( isset ( $ cacheSettings [ 'smax-age' ] ) && is_int ( $ cacheSettings [ 'smax... | Render the block . |
38,918 | protected function renderLocation ( Location $ location , $ viewType , $ layout = false , array $ params = array ( ) ) { return $ this -> viewManager -> renderLocation ( $ location , $ viewType , $ params + array ( 'noLayout' => ! $ layout ) ) ; } | Creates the content to be returned when viewing a Location . |
38,919 | protected function renderContent ( Content $ content , $ viewType , $ layout = false , array $ params = array ( ) ) { return $ this -> viewManager -> renderContent ( $ content , $ viewType , $ params + array ( 'noLayout' => ! $ layout ) ) ; } | Creates the content to be returned when viewing a Content . |
38,920 | public function parse ( array $ data , ParsingDispatcher $ parsingDispatcher ) { if ( ! array_key_exists ( 'FullTextCriterion' , $ data ) ) { throw new Exceptions \ Parser ( 'Invalid <FullTextCriterion> format' ) ; } return new FullTextCriterion ( $ data [ 'FullTextCriterion' ] ) ; } | Parses input structure to a FullText criterion . |
38,921 | protected function rewriteUrl ( $ url ) { if ( empty ( $ this -> hosts ) ) { return $ url ; } $ proxyHost = rtrim ( reset ( $ this -> hosts ) , '/' ) ; $ relativeUrl = parse_url ( $ url , PHP_URL_PATH ) ; return $ proxyHost . $ relativeUrl ; } | Replaces host with given proxy host . |
38,922 | protected function validateHandlerOptions ( $ fromHandlers , $ toHandlers , OutputInterface $ output ) { foreach ( [ 'From' => $ fromHandlers , 'To' => $ toHandlers ] as $ direction => $ handlers ) { $ lowerDirection = strtolower ( $ direction ) ; if ( count ( $ handlers ) !== 2 ) { $ output -> writeln ( "Enter two com... | Verify that the handler options have been set to meaningful values . |
38,923 | protected function migrateFiles ( $ totalFileCount = null , $ bulkCount , $ dryRun , OutputInterface $ output ) { $ progress = new ProgressBar ( $ output , $ totalFileCount ) ; if ( $ totalFileCount ) { $ progress -> setFormat ( "%message%\n %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%... | Migrate files . |
38,924 | protected function validateInputContentTypeGroups ( array $ contentTypeGroups ) { if ( empty ( $ contentTypeGroups ) ) { throw new InvalidArgumentException ( '$contentTypeGroups' , 'Argument must contain at least one ContentTypeGroup' ) ; } foreach ( $ contentTypeGroups as $ key => $ contentTypeGroup ) { if ( ! $ conte... | Validates input ContentTypeGroup array . |
38,925 | protected function validateInputFieldDefinitionCreateStruct ( FieldDefinitionCreateStruct $ fieldDefinitionCreateStruct , $ argumentName = '$fieldDefinitionCreateStruct' ) { if ( $ fieldDefinitionCreateStruct -> fieldTypeIdentifier === null ) { throw new InvalidArgumentException ( $ argumentName , "Property 'fieldTypeI... | Validates input FieldDefinitionCreateStruct . |
38,926 | protected function validateFieldDefinitionCreateStruct ( FieldDefinitionCreateStruct $ fieldDefinitionCreateStruct , SPIFieldType $ fieldType ) { $ validationErrors = array ( ) ; if ( $ fieldDefinitionCreateStruct -> isSearchable && ! $ fieldType -> isSearchable ( ) ) { $ validationErrors [ ] = new ValidationError ( "F... | Validates FieldDefinitionCreateStruct . |
38,927 | public function newFieldDefinitionCreateStruct ( $ identifier , $ fieldTypeIdentifier ) { if ( ! is_string ( $ identifier ) ) { throw new InvalidArgumentValue ( '$identifier' , $ identifier ) ; } if ( ! is_string ( $ fieldTypeIdentifier ) ) { throw new InvalidArgumentValue ( '$fieldTypeIdentifier' , $ fieldTypeIdentifi... | Instantiates a field definition create struct . |
38,928 | public function copyLegacyField ( VersionInfo $ versionInfo , Field $ field , Field $ originalField , array $ context ) { return $ this -> storeFieldData ( $ versionInfo , $ field , $ context ) ; } | This method is used exclusively by Legacy Storage to copy external data of existing field in main language to the untranslatable field not passed in create or update struct but created implicitly in storage layer . |
38,929 | public function getController ( FilterControllerEvent $ event ) { $ request = $ event -> getRequest ( ) ; if ( ( $ viewBuilder = $ this -> viewBuilderRegistry -> getFromRegistry ( $ request -> attributes -> get ( '_controller' ) ) ) === null ) { return ; } $ parameterEvent = new FilterViewBuilderParametersEvent ( clone... | Configures the View for eZ View controllers . |
38,930 | protected function getQueryRange ( $ operator , $ start , $ end ) { $ start = $ this -> prepareValue ( $ start ) ; $ end = $ this -> prepareValue ( $ end ) ; $ startBrace = '[' ; $ startValue = '*' ; $ endValue = '*' ; $ endBrace = ']' ; switch ( $ operator ) { case Operator :: GT : $ startBrace = '{' ; $ endBrace = '}... | Get Elasticsearch range query . |
38,931 | protected function getFilterRange ( $ operator , $ start , $ end ) { if ( ( $ operator === Operator :: LT ) || ( $ operator === Operator :: LTE ) ) { $ end = $ start ; $ start = null ; } switch ( $ operator ) { case Operator :: GT : $ range = array ( 'gt' => $ start , ) ; break ; case Operator :: GTE : $ range = array ... | Get Elasticsearch range filter . |
38,932 | protected function getLimitationByIdentifier ( $ identifier ) { switch ( $ identifier ) { case APILimitation :: CONTENTTYPE : return new \ eZ \ Publish \ API \ Repository \ Values \ User \ Limitation \ ContentTypeLimitation ( ) ; case APILimitation :: LANGUAGE : return new \ eZ \ Publish \ API \ Repository \ Values \ U... | Instantiates Limitation object based on identifier . |
38,933 | protected function convertDom ( \ DOMNode $ node ) { $ isArray = false ; $ current = array ( ) ; $ text = '' ; if ( $ node instanceof \ DOMElement ) { foreach ( $ node -> attributes as $ name => $ attribute ) { $ current [ "_{$name}" ] = $ attribute -> value ; } } $ parentTagName = $ node instanceof \ DOMElement ? $ no... | Converts DOM nodes to array structures . |
38,934 | public function mapUser ( array $ data ) { $ user = new User ( ) ; $ user -> id = $ data [ 'contentobject_id' ] ; $ user -> login = $ data [ 'login' ] ; $ user -> email = $ data [ 'email' ] ; $ user -> passwordHash = $ data [ 'password_hash' ] ; $ user -> hashAlgorithm = ( int ) $ data [ 'password_hash_type' ] ; $ user... | Map user data into user object . |
38,935 | public function mapUsers ( array $ data ) { $ users = array ( ) ; foreach ( $ data as $ row ) { $ users [ ] = $ this -> mapUser ( $ row ) ; } return $ users ; } | Map data for a set of user data . |
38,936 | public function mapPolicies ( array $ data ) { $ policies = array ( ) ; foreach ( $ data as $ row ) { $ policyId = $ row [ 'ezpolicy_id' ] ; if ( ! isset ( $ policies [ $ policyId ] ) && ( $ policyId !== null ) ) { $ originalId = null ; if ( $ row [ 'ezpolicy_original_id' ] ) { $ originalId = ( int ) $ row [ 'ezpolicy_... | Map policy data to an array of policies . |
38,937 | public function mapRole ( array $ data ) { $ role = new Role ( ) ; foreach ( $ data as $ row ) { if ( empty ( $ role -> id ) ) { $ role -> id = ( int ) $ row [ 'ezrole_id' ] ; $ role -> identifier = $ row [ 'ezrole_name' ] ; $ role -> status = $ row [ 'ezrole_version' ] != 0 ? Role :: STATUS_DRAFT : Role :: STATUS_DEFI... | Map role data to a role . |
38,938 | public function mapRoles ( array $ data ) { $ roleData = array ( ) ; foreach ( $ data as $ row ) { $ roleData [ $ row [ 'ezrole_id' ] ] [ ] = $ row ; } $ roles = array ( ) ; foreach ( $ roleData as $ data ) { $ roles [ ] = $ this -> mapRole ( $ data ) ; } return $ roles ; } | Map data for a set of roles . |
38,939 | public function mapRoleAssignments ( array $ data ) { $ roleAssignmentData = array ( ) ; foreach ( $ data as $ row ) { $ id = ( int ) $ row [ 'id' ] ; $ roleId = ( int ) $ row [ 'role_id' ] ; $ contentId = ( int ) $ row [ 'contentobject_id' ] ; if ( isset ( $ roleAssignmentData [ $ roleId ] [ $ contentId ] ) && $ roleA... | Map data for a set of role assignments . |
38,940 | public function validate ( FieldDefinition $ fieldDefinition , SPIValue $ fieldValue ) { $ validationErrors = array ( ) ; if ( $ this -> isEmptyValue ( $ fieldValue ) ) { return $ validationErrors ; } $ fieldSettings = $ fieldDefinition -> getFieldSettings ( ) ; if ( ( ! isset ( $ fieldSettings [ 'isMultiple' ] ) || $ ... | Validates field value against isMultiple setting . |
38,941 | protected function historize ( $ parentId , $ textMD5 , $ newId ) { $ query = $ this -> dbHandler -> createUpdateQuery ( ) ; $ query -> update ( $ this -> dbHandler -> quoteTable ( $ this -> table ) ) -> set ( $ this -> dbHandler -> quoteColumn ( 'is_original' ) , $ query -> bindValue ( 0 , null , \ PDO :: PARAM_INT ) ... | Updates single row matched by composite primary key . |
38,942 | protected function setQueryValues ( Query $ query , $ values ) { foreach ( $ values as $ column => $ value ) { if ( ! in_array ( $ column , $ this -> columns [ 'ezurlalias_ml' ] ) ) { throw new \ Exception ( "unknown column '$column' for table 'ezurlalias_ml'" ) ; } switch ( $ column ) { case 'text' : case 'action' : c... | Sets value for insert or update query . |
38,943 | public function loadRow ( $ parentId , $ textMD5 ) { $ query = $ this -> dbHandler -> createSelectQuery ( ) ; $ query -> select ( '*' ) -> from ( $ this -> dbHandler -> quoteTable ( $ this -> table ) ) -> where ( $ query -> expr -> lAnd ( $ query -> expr -> eq ( $ this -> dbHandler -> quoteColumn ( 'parent' ) , $ query... | Loads single row data matched by composite primary key . |
38,944 | public function bulkRemoveTranslation ( $ languageId , $ actions ) { $ connection = $ this -> dbHandler -> getConnection ( ) ; $ query = $ connection -> createQueryBuilder ( ) ; $ query -> update ( $ connection -> quoteIdentifier ( $ this -> table ) ) -> set ( 'lang_mask' , 'lang_mask & ~ ' . $ languageId ) -> where ( ... | Removes languageId of removed translation from lang_mask and deletes single language rows for multiple Locations . |
38,945 | public function deleteUrlAliasesWithoutLocation ( ) : int { $ dbPlatform = $ this -> connection -> getDatabasePlatform ( ) ; $ subquery = $ this -> connection -> createQueryBuilder ( ) ; $ subquery -> select ( 'node_id' ) -> from ( 'ezcontentobject_tree' , 't' ) -> where ( $ subquery -> expr ( ) -> eq ( 't.node_id' , s... | Delete URL aliases pointing to non - existent Locations . |
38,946 | public function deleteUrlAliasesWithoutParent ( ) : int { $ existingAliasesQuery = $ this -> getAllUrlAliasesQuery ( ) ; $ query = $ this -> connection -> createQueryBuilder ( ) ; $ query -> delete ( $ this -> table ) -> where ( $ query -> expr ( ) -> neq ( 'parent' , $ query -> createPositionalParameter ( 0 , \ PDO ::... | Delete URL aliases pointing to non - existent parent nodes . |
38,947 | public function deleteUrlAliasesWithBrokenLink ( ) { $ existingAliasesQuery = $ this -> getAllUrlAliasesQuery ( ) ; $ query = $ this -> connection -> createQueryBuilder ( ) ; $ query -> delete ( $ this -> table ) -> where ( $ query -> expr ( ) -> neq ( 'id' , 'link' ) ) -> andWhere ( $ query -> expr ( ) -> notIn ( 'lin... | Delete URL aliases which do not link to any existing URL alias node . |
38,948 | private function getAllUrlAliasesQuery ( ) : string { $ existingAliasesQueryBuilder = $ this -> connection -> createQueryBuilder ( ) ; $ innerQueryBuilder = $ this -> connection -> createQueryBuilder ( ) ; return $ existingAliasesQueryBuilder -> select ( 'tmp.id' ) -> from ( '(' . $ innerQueryBuilder -> select ( 'id' )... | Get subquery for IDs of all URL aliases . |
38,949 | private function deleteRow ( int $ parentId , string $ textMD5 ) : int { $ queryBuilder = $ this -> connection -> createQueryBuilder ( ) ; $ expr = $ queryBuilder -> expr ( ) ; $ queryBuilder -> delete ( $ this -> table ) -> where ( $ expr -> andX ( $ expr -> eq ( 'parent' , $ queryBuilder -> createPositionalParameter ... | Delete URL alias row by its primary composite key . |
38,950 | private function prepareTargetsForType ( ? array $ targets , LimitationType $ type ) : ? array { $ isTargetAware = $ type instanceof TargetAwareType ; if ( null === $ targets ) { return $ isTargetAware ? [ ] : null ; } $ targets = array_filter ( $ targets , function ( $ target ) use ( $ isTargetAware ) { $ isTarget = $... | Prepare list of targets for the given Type keeping BC . |
38,951 | protected function visitTranslatedList ( Generator $ generator , array $ translatedElements , $ listName ) { $ generator -> startHashElement ( $ listName ) ; $ generator -> startList ( 'value' ) ; foreach ( $ translatedElements as $ languageCode => $ element ) { $ generator -> startValueElement ( 'value' , $ element , ... | Visits a list of translated elements . |
38,952 | protected function visitLimitation ( Generator $ generator , Limitation $ limitation ) { $ generator -> startHashElement ( 'limitation' ) ; $ generator -> startAttribute ( 'identifier' , $ limitation -> getIdentifier ( ) ) ; $ generator -> endAttribute ( 'identifier' ) ; $ generator -> startHashElement ( 'values' ) ; $... | Visits a limitation . |
38,953 | public function loadLanguages ( ) { $ languages = $ this -> languageHandler -> loadAll ( ) ; $ returnArray = array ( ) ; foreach ( $ languages as $ language ) { $ returnArray [ ] = $ this -> buildDomainObject ( $ language ) ; } return $ returnArray ; } | Loads all Languages . |
38,954 | protected function buildDomainObject ( SPILanguage $ spiLanguage ) { return new Language ( array ( 'id' => $ spiLanguage -> id , 'languageCode' => $ spiLanguage -> languageCode , 'name' => $ spiLanguage -> name , 'enabled' => $ spiLanguage -> isEnabled , ) ) ; } | Builds Language domain object from ValueObject returned by Persistence API . |
38,955 | public function parse ( array $ data , ParsingDispatcher $ parsingDispatcher ) { if ( ! array_key_exists ( 'SectionIdCriterion' , $ data ) ) { throw new Exceptions \ Parser ( 'Invalid <SectionIdCriterion> format' ) ; } return new SectionIdCriterion ( $ data [ 'SectionIdCriterion' ] ) ; } | Parses input structure to a SectionId Criterion object . |
38,956 | public function determineActions ( Type $ fromType , Type $ toType ) { $ actions = array ( ) ; foreach ( $ fromType -> fieldDefinitions as $ fieldDef ) { if ( ! $ this -> hasFieldDefinition ( $ toType , $ fieldDef ) ) { $ actions [ ] = new ContentUpdater \ Action \ RemoveField ( $ this -> contentGateway , $ fieldDef , ... | Determines the necessary update actions . |
38,957 | public function applyUpdates ( $ contentTypeId , array $ actions ) { if ( empty ( $ actions ) ) { return ; } foreach ( $ this -> getContentIdsByContentTypeId ( $ contentTypeId ) as $ contentId ) { foreach ( $ actions as $ action ) { $ action -> apply ( $ contentId ) ; } } } | Applies all given updates . |
38,958 | public function suggest ( $ prefix , $ fieldPaths = array ( ) , $ limit = 10 , Criterion $ filter = null ) { return $ this -> service -> suggest ( $ prefix , $ fieldPaths , $ limit , $ filter ) ; } | Suggests a list of values for the given prefix . |
38,959 | public function buildContentTypeDomainObject ( SPIContentType $ spiContentType , array $ prioritizedLanguages = [ ] ) : APIContentType { $ mainLanguageCode = $ this -> contentLanguageHandler -> load ( $ spiContentType -> initialLanguageId ) -> languageCode ; $ fieldDefinitions = array ( ) ; foreach ( $ spiContentType -... | Builds a ContentType domain object from value object returned by persistence . |
38,960 | public function buildSPIContentTypeUpdateStruct ( APIContentTypeDraft $ contentTypeDraft , APIContentTypeUpdateStruct $ contentTypeUpdateStruct , APIUserReference $ user ) { $ updateStruct = new SPIContentTypeUpdateStruct ( ) ; $ updateStruct -> identifier = $ contentTypeUpdateStruct -> identifier !== null ? $ contentT... | Builds ContentType update struct for storage layer . |
38,961 | public function buildContentTypeGroupDomainObject ( SPIContentTypeGroup $ spiGroup , array $ prioritizedLanguages = [ ] ) : APIContentTypeGroup { return new ContentTypeGroup ( array ( 'id' => $ spiGroup -> id , 'identifier' => $ spiGroup -> identifier , 'creationDate' => $ this -> getDateTime ( $ spiGroup -> created ) ... | Builds a ContentTypeGroup domain object from value object returned by persistence . |
38,962 | public function buildFieldDefinitionDomainObject ( SPIFieldDefinition $ spiFieldDefinition , $ mainLanguageCode , array $ prioritizedLanguages = [ ] ) { $ fieldType = $ this -> fieldTypeRegistry -> getFieldType ( $ spiFieldDefinition -> fieldType ) ; $ fieldDefinition = new FieldDefinition ( array ( 'names' => $ spiFie... | Builds a FieldDefinition domain object from value object returned by persistence . |
38,963 | public function buildSPIFieldDefinitionUpdate ( APIFieldDefinitionUpdateStruct $ fieldDefinitionUpdateStruct , APIFieldDefinition $ fieldDefinition ) { $ fieldType = $ this -> fieldTypeRegistry -> getFieldType ( $ fieldDefinition -> fieldTypeIdentifier ) ; $ validatorConfiguration = $ fieldDefinitionUpdateStruct -> val... | Builds SPIFieldDefinition object using API FieldDefinitionUpdateStruct and API FieldDefinition . |
38,964 | public function buildSPIFieldDefinitionCreate ( APIFieldDefinitionCreateStruct $ fieldDefinitionCreateStruct , SPIFieldType $ fieldType ) { $ spiFieldDefinition = new SPIFieldDefinition ( array ( 'id' => null , 'identifier' => $ fieldDefinitionCreateStruct -> identifier , 'fieldType' => $ fieldDefinitionCreateStruct ->... | Builds SPIFieldDefinition object using API FieldDefinitionCreateStruct . |
38,965 | private function isUserConflict ( EzUser $ user , TokenInterface $ previousToken = null ) { if ( $ previousToken === null || ! $ previousToken instanceof UsernamePasswordToken ) { return false ; } $ previousUser = $ previousToken -> getUser ( ) ; if ( ! $ previousUser instanceof EzUser ) { return false ; } $ wasAnonymo... | Checks if newly matched user is conflicting with previously non - anonymous logged in user if any . |
38,966 | public function deleteDirectory ( $ spiPath ) { $ query = $ this -> db -> createQueryBuilder ( ) ; $ query -> delete ( 'ezdfsfile' ) -> where ( 'name LIKE :spiPath ESCAPE :esc' ) -> setParameter ( ':esc' , '\\' ) -> setParameter ( ':spiPath' , addcslashes ( $ this -> addPrefix ( rtrim ( $ spiPath , '/' ) ) , '%_' ) . '... | Delete directory and all the content under specified directory . |
38,967 | public function loadAllLanguagesData ( ) { try { return $ this -> innerGateway -> loadAllLanguagesData ( ) ; } catch ( DBALException $ e ) { throw new RuntimeException ( 'Database error' , 0 , $ e ) ; } catch ( PDOException $ e ) { throw new RuntimeException ( 'Database error' , 0 , $ e ) ; } } | Loads the data for all languages . |
38,968 | private function validateISBNChecksum ( $ isbnNr ) { $ result = 0 ; $ isbnNr = strtoupper ( $ isbnNr ) ; for ( $ i = 10 ; $ i > 0 ; -- $ i ) { if ( is_numeric ( $ isbnNr [ $ i - 1 ] ) || ( $ i === 10 && $ isbnNr [ $ i - 1 ] === 'X' ) ) { if ( ( $ i === 1 ) && ( $ isbnNr [ 9 ] === 'X' ) ) { $ result += 10 * $ i ; } else... | Validates the ISBN number . All characters should be numeric except the last digit that may be the character X which should be calculated as 10 . |
38,969 | private function validateISBN13Checksum ( $ isbnNr , & $ error ) { if ( ! $ isbnNr ) { return false ; } if ( strlen ( $ isbnNr ) !== self :: ISBN13_LENGTH ) { $ error = 'ISBN-13 must be 13 digit, digit count is: ' . strlen ( $ isbnNr ) ; return false ; } if ( substr ( $ isbnNr , 0 , self :: ISBN13_PREFIX_LENGTH ) !== s... | Validates the ISBN - 13 number . |
38,970 | public function getTranslatableMessage ( ) { if ( isset ( $ this -> plural ) ) { return new Plural ( $ this -> singular , $ this -> plural , $ this -> values ) ; } else { return new Message ( $ this -> singular , $ this -> values ) ; } } | Returns a translatable Message . |
38,971 | protected function createField ( $ id , $ versionNo , $ languageCode ) { $ field = new Field ( ) ; $ field -> id = $ id ; $ field -> fieldDefinitionId = $ this -> fieldDefinition -> id ; $ field -> type = $ this -> fieldDefinition -> fieldType ; $ field -> value = clone $ this -> fieldDefinition -> defaultValue ; $ fie... | Creates new Field value object setting given parameters and default value for a field definition the action is constructed for . |
38,972 | public function getFieldNames ( Criterion $ criterion , $ fieldDefinitionIdentifier , $ fieldTypeIdentifier = null , $ name = null ) { $ fieldTypeNameMap = $ this -> getFieldTypes ( $ criterion , $ fieldDefinitionIdentifier , $ fieldTypeIdentifier , $ name ) ; return array_keys ( $ fieldTypeNameMap ) ; } | For the given parameters returns a set of search backend field names to search on . |
38,973 | public function getSortFieldName ( SortClause $ sortClause , $ contentTypeIdentifier , $ fieldDefinitionIdentifier , $ name = null ) { $ fieldMap = $ this -> getSearchableFieldMap ( ) ; if ( ! isset ( $ fieldMap [ $ contentTypeIdentifier ] [ $ fieldDefinitionIdentifier ] ) ) { return null ; } $ fieldName = array_keys (... | For the given parameters returns search backend field name to sort on or null if the field could not be found . |
38,974 | public function getIndexFieldName ( $ criterionOrSortClause , $ contentTypeIdentifier , $ fieldDefinitionIdentifier , $ fieldTypeIdentifier , $ name , $ isSortField ) { if ( $ criterionOrSortClause instanceof CustomFieldInterface && $ customFieldName = $ criterionOrSortClause -> getCustomField ( $ contentTypeIdentifier... | Returns index field name for the given parameters . |
38,975 | public function loadGroup ( $ groupId ) { $ data = $ this -> objectStateGateway -> loadObjectStateGroupData ( $ groupId ) ; if ( empty ( $ data ) ) { throw new NotFoundException ( 'ObjectStateGroup' , $ groupId ) ; } return $ this -> objectStateMapper -> createObjectStateGroupFromData ( $ data ) ; } | Loads an object state group . |
38,976 | public function loadGroupByIdentifier ( $ identifier ) { $ data = $ this -> objectStateGateway -> loadObjectStateGroupDataByIdentifier ( $ identifier ) ; if ( empty ( $ data ) ) { throw new NotFoundException ( 'ObjectStateGroup' , $ identifier ) ; } return $ this -> objectStateMapper -> createObjectStateGroupFromData (... | Loads a object state group by identifier . |
38,977 | public function loadAllGroups ( $ offset = 0 , $ limit = - 1 ) { $ data = $ this -> objectStateGateway -> loadObjectStateGroupListData ( $ offset , $ limit ) ; return $ this -> objectStateMapper -> createObjectStateGroupListFromData ( $ data ) ; } | Loads all object state groups . |
38,978 | public function loadByIdentifier ( $ identifier , $ groupId ) { $ data = $ this -> objectStateGateway -> loadObjectStateDataByIdentifier ( $ identifier , $ groupId ) ; if ( empty ( $ data ) ) { throw new NotFoundException ( 'ObjectState' , array ( 'identifier' => $ identifier , 'groupId' => $ groupId ) ) ; } return $ t... | Loads an object state by identifier and group it belongs to . |
38,979 | protected function buildSPIBinaryFileCreateStructObject ( BinaryFileCreateStruct $ binaryFileCreateStruct ) { $ spiBinaryCreateStruct = new SPIBinaryFileCreateStruct ( ) ; $ spiBinaryCreateStruct -> id = $ this -> getPrefixedUri ( $ binaryFileCreateStruct -> id ) ; $ spiBinaryCreateStruct -> size = $ binaryFileCreateSt... | Generates SPI BinaryFileCreateStruct object from provided API BinaryFileCreateStruct object . |
38,980 | protected function buildDomainBinaryFileObject ( SPIBinaryFile $ spiBinaryFile ) { return new BinaryFile ( array ( 'size' => ( int ) $ spiBinaryFile -> size , 'mtime' => $ spiBinaryFile -> mtime , 'id' => $ this -> removeUriPrefix ( $ spiBinaryFile -> id ) , 'uri' => $ spiBinaryFile -> uri , 'mimeType' => $ spiBinaryFi... | Generates API BinaryFile object from provided SPI BinaryFile object . |
38,981 | public function compile ( array $ ast ) { $ transformations = array ( ) ; foreach ( $ ast as $ section => $ rules ) { foreach ( $ rules as $ rule ) { $ transformations [ $ section ] [ ] = $ this -> compileRule ( $ rule ) ; } } return $ transformations ; } | Compile AST into a set of regular expressions . |
38,982 | protected function compileRule ( array $ rule ) { switch ( $ rule [ 'type' ] ) { case TransformationProcessor :: T_MAP : return $ this -> compileMap ( $ rule ) ; case TransformationProcessor :: T_REPLACE : return $ this -> compileReplace ( $ rule ) ; case TransformationProcessor :: T_TRANSPOSE : return $ this -> compil... | Compiles a single rule . |
38,983 | protected function compileReplace ( array $ rule ) { return array ( 'regexp' => '([' . preg_quote ( $ this -> compileCharacter ( $ rule [ 'data' ] [ 'srcStart' ] ) ) . '-' . preg_quote ( $ this -> compileCharacter ( $ rule [ 'data' ] [ 'srcEnd' ] ) ) . '])us' , 'callback' => $ this -> compileTargetCharacter ( $ rule [ ... | Compile replace rule . |
38,984 | protected function compileTranspose ( array $ rule ) { return array ( 'regexp' => '([' . preg_quote ( $ this -> compileCharacter ( $ rule [ 'data' ] [ 'srcStart' ] ) ) . '-' . preg_quote ( $ this -> compileCharacter ( $ rule [ 'data' ] [ 'srcEnd' ] ) ) . '])us' , 'callback' => $ this -> getTransposeClosure ( $ rule [ '... | Compile transpose rule . |
38,985 | protected function compileTransposeModulo ( array $ rule ) { return array ( 'regexp' => '([' . preg_quote ( $ this -> getModuloCharRange ( $ this -> compileCharacter ( $ rule [ 'data' ] [ 'srcStart' ] ) , $ this -> compileCharacter ( $ rule [ 'data' ] [ 'srcEnd' ] ) , $ rule [ 'data' ] [ 'modulo' ] ) ) . '])us' , 'call... | Compile transpose modulo rule . |
38,986 | protected function getModuloCharRange ( $ start , $ end , $ modulo ) { $ start = $ this -> converter -> toUnicodeCodepoint ( $ start ) ; $ end = $ this -> converter -> toUnicodeCodepoint ( $ end ) ; $ modulo = hexdec ( $ modulo ) ; $ chars = '' ; for ( $ start ; $ start <= $ end ; $ start += $ modulo ) { $ chars .= $ t... | Get string with all characters defined by parameters . |
38,987 | protected function getTransposeClosure ( $ operator , $ value ) { $ value = hexdec ( $ value ) * ( $ operator === '-' ? - 1 : 1 ) ; $ converter = $ this -> converter ; return function ( $ matches ) use ( $ value , $ converter ) { return $ converter -> toUTF8Character ( $ converter -> toUnicodeCodepoint ( $ matches [ 0 ... | Returns a closure which modifies the provided character by the given value . |
38,988 | protected function compileTargetCharacter ( $ char ) { switch ( true ) { case $ char === 'remove' : return function ( $ matches ) { return '' ; } ; case $ char === 'keep' : return function ( $ matches ) { return $ matches [ 0 ] ; } ; case preg_match ( '("(?:[^\\\\"]+|\\\\\\\\|\\\\\'|\\\\")*?")' , $ char ) : $ string = ... | Compile target into a closure which can be used by preg_replace_callback . |
38,989 | protected function compileCharacter ( $ char ) { switch ( true ) { case preg_match ( '(^U\\+[0-9a-fA-F]{4}$)' , $ char ) : return $ this -> converter -> toUTF8Character ( hexdec ( substr ( $ char , 2 ) ) ) ; case preg_match ( '(^[0-9a-fA-F]{2}$)' , $ char ) : return chr ( hexdec ( $ char ) ) ; default : throw new Runti... | Compile a single source character definition into a plain UTF - 8 character . |
38,990 | private function promptUserForMainLanguageChange ( ContentInfo $ contentInfo , $ languageCode , array $ lastVersionLanguageCodes ) { $ contentName = "#{$contentInfo->id} ($contentInfo->name)" ; $ this -> output -> writeln ( "<comment>The specified Translation '{$languageCode}' is the Main Translation of the Content {$c... | Interact with user to update main Language of a Content Object . |
38,991 | public function index ( FullTextData $ fullTextData ) { $ indexArray = [ ] ; $ indexArrayOnlyWords = [ ] ; $ wordCount = 0 ; $ placement = 0 ; $ this -> remove ( $ fullTextData -> id ) ; foreach ( $ fullTextData -> values as $ fullTextValue ) { if ( is_numeric ( trim ( $ fullTextValue -> value ) ) ) { $ integerValue = ... | Index search engine full text data corresponding to content object field values . |
38,992 | public function remove ( $ contentId , $ versionId = null ) { $ doDelete = false ; $ this -> dbHandler -> beginTransaction ( ) ; $ wordIDList = $ this -> searchIndex -> getContentObjectWords ( $ contentId ) ; if ( count ( $ wordIDList ) > 0 ) { $ this -> searchIndex -> decrementWordObjectCount ( $ wordIDList ) ; $ doDe... | Remove whole content or a specific version from index . |
38,993 | private function indexWords ( FullTextData $ fullTextData , array $ indexArray , array $ wordIDArray , $ placement = 0 ) { $ contentId = $ fullTextData -> id ; $ prevWordId = 0 ; for ( $ i = 0 ; $ i < count ( $ indexArray ) ; ++ $ i ) { $ indexWord = $ indexArray [ $ i ] [ 'Word' ] ; $ contentFieldId = $ indexArray [ $... | Index wordIndex . |
38,994 | private function buildWordIDArray ( array $ indexArrayOnlyWords ) { $ wordCount = count ( $ indexArrayOnlyWords ) ; $ wordIDArray = [ ] ; $ wordArray = [ ] ; $ this -> dbHandler -> beginTransaction ( ) ; for ( $ arrayCount = 0 ; $ arrayCount < $ wordCount ; $ arrayCount += 500 ) { $ wordArrayChuck = array_slice ( $ ind... | Build WordIDArray and update ezsearch_word table . |
38,995 | public function dispatchCriterion ( $ criterionName , $ criterionData , ParsingDispatcher $ parsingDispatcher ) { $ mediaType = $ this -> getCriterionMediaType ( $ criterionName ) ; try { return $ parsingDispatcher -> parse ( array ( $ criterionName => $ criterionData ) , $ mediaType ) ; } catch ( Exceptions \ Parser $... | Dispatches parsing of a criterion name + data to its own parser . |
38,996 | public function dispatchFacetBuilder ( $ facetBuilderName , $ facetBuilderData , ParsingDispatcher $ parsingDispatcher ) { $ mediaType = $ this -> getFacetBuilderMediaType ( $ facetBuilderName ) ; try { return $ parsingDispatcher -> parse ( array ( $ facetBuilderName => $ facetBuilderData ) , $ mediaType ) ; } catch ( ... | Dispatches parsing of a facet builder name + data to its own parser . |
38,997 | public function dispatchSortClause ( $ sortClauseName , $ direction , ParsingDispatcher $ parsingDispatcher ) { $ mediaType = $ this -> getSortClauseMediaType ( $ sortClauseName ) ; return $ parsingDispatcher -> parse ( array ( $ sortClauseName => $ direction ) , $ mediaType ) ; } | Dispatches parsing of a sort clause name + direction to its own parser . |
38,998 | protected function buildDomainObjectStateObject ( SPIObjectState $ spiObjectState , APIObjectStateGroup $ objectStateGroup = null , array $ prioritizedLanguages = [ ] ) { $ objectStateGroup = $ objectStateGroup ? : $ this -> loadObjectStateGroup ( $ spiObjectState -> groupId ) ; return new ObjectState ( [ 'id' => $ spi... | Converts the object state SPI value object to API value object . |
38,999 | protected function buildDomainObjectStateGroupObject ( SPIObjectStateGroup $ spiObjectStateGroup , array $ prioritizedLanguages = [ ] ) { return new ObjectStateGroup ( [ 'id' => $ spiObjectStateGroup -> id , 'identifier' => $ spiObjectStateGroup -> identifier , 'mainLanguageCode' => $ spiObjectStateGroup -> defaultLang... | Converts the object state group SPI value object to API value object . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.