Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
eZNamePatternResolver Class Reference

## Public Member Functions
| __construct ( $namePattern, eZContentObject $contentObject, $contentVersion=false, $contentTranslation=false)
| resolveNamePattern ( $limit=0, $sequence='')

## Public Attributes
const | FIELD_NAME_MAX_SIZE = 255

## Private Member Functions
| fetchContentAttributes ()
| translatePattern ()
| extractTokens ( $namePattern)
| resolveToken ( $token)
| isTokenGroup ( $identifier)
| tokenParts ( $token)
| filterNamePattern ( $namePattern)
| getIdentifiers ( $patternString)

## Private Attributes
| $groupLookupTable
| $origNamePattern
| $namePattern
| $contentObject
| $version
| $translation
| $attributeArray
| $metaString = 'EZMETAGROUP_'

## Detailed Description

Definition at line 38 of file eznamepatternresolver.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZNamePatternResolver::__construct | ( |  | $namePattern,
|  | eZContentObject | $contentObject,
|  |  | $contentVersion = `false`,
|  |  | $contentTranslation = `false`
| ) |  |

Constructs a object to resolve $namePattern. $contentVersion and $contentTranslation specify which version and translation respectively of the content object to use.

Parameters

  string | $namePattern |
  eZContentObject | $contentObject |
  int | false | $contentVersion |
  string | false | $contentTranslation |

Definition at line 110 of file eznamepatternresolver.php.

References $contentObject, $namePattern, and filterNamePattern().

## Member Function Documentation

## ◆ extractTokens()

eZNamePatternResolver::extractTokens | ( |  | $namePattern | ) |
| private

Extract all tokens from $namePattern

Example: `Text <token> more text ==> <token>`

Parameters

  string | $namePattern |

Returns
  array

Definition at line 212 of file eznamepatternresolver.php.

References $namePattern.

Referenced by resolveToken(), and translatePattern().

## ◆ fetchContentAttributes()

eZNamePatternResolver::fetchContentAttributes | ( |  | ) |
| private

Fetches the list of available class-identifiers in the token, and it will only fetch the attributes which appear amongst the identifiers found in tokens.

Returns
  void

Definition at line 158 of file eznamepatternresolver.php.

References getIdentifiers().

Referenced by resolveNamePattern().

## ◆ filterNamePattern()

eZNamePatternResolver::filterNamePattern | ( |  | $namePattern | ) |
| private

Builds a lookup / translation table for groups in the $namePattern. The groups are referenced with a generated meta-token in the original name pattern.

Returns intermediate name pattern where groups are replaced with meta- tokens.

Parameters

  string | $namePattern |

Returns
  string

Definition at line 312 of file eznamepatternresolver.php.

References $namePattern.

Referenced by __construct().

## ◆ getIdentifiers()

eZNamePatternResolver::getIdentifiers | ( |  | $patternString | ) |
| private

Returns all identifiers from all tokens in the name pattern.

Parameters

  string | $patternString |

Returns
  array

Definition at line 346 of file eznamepatternresolver.php.

Referenced by fetchContentAttributes().

## ◆ isTokenGroup()

eZNamePatternResolver::isTokenGroup | ( |  | $identifier | ) |
| private

Checks whether $identifier is a placeholder for a token group.

Parameters

  string | $identifier |

Returns
  void

Definition at line 273 of file eznamepatternresolver.php.

Referenced by resolveToken().

## ◆ resolveNamePattern()

eZNamePatternResolver::resolveNamePattern | ( |  | $limit = `0`,
|  |  | $sequence = `''`
| ) |  |

Return the real name for an object name pattern

Parameters

  int | $limit | The limit on the string length, by defaul 0 aka none
  string | $sequence | End sequence applied to string if limit has been reached

Returns
  string

Definition at line 127 of file eznamepatternresolver.php.

References fetchContentAttributes(), FIELD_NAME_MAX_SIZE, eZDB\instance(), and translatePattern().

## ◆ resolveToken()

eZNamePatternResolver::resolveToken | ( |  | $token | ) |
| private

Looks up the value $token should be replaced with and returns this as a string. Meta strings denothing token groups are automatically inferred.

Parameters

  string | $token |

Returns
  string

Definition at line 231 of file eznamepatternresolver.php.

References extractTokens(), isTokenGroup(), and tokenParts().

Referenced by translatePattern().

## ◆ tokenParts()

eZNamePatternResolver::tokenParts | ( |  | $token | ) |
| private

Return the different constituents of $token in an array. The normal case here is that the different identifiers within one token will be tokenized and returned.

Example: `"&lt;title|text&gt;" ==> array( 'title', 'text' )`

Parameters

  string | $token |

Returns
  array

Definition at line 295 of file eznamepatternresolver.php.

Referenced by resolveToken().

## ◆ translatePattern()

eZNamePatternResolver::translatePattern | ( |  | ) |
| private

Replaces tokens in the name pattern with their resolved values.

Returns
  string

Definition at line 187 of file eznamepatternresolver.php.

References $namePattern, extractTokens(), and resolveToken().

Referenced by resolveNamePattern().

## Member Data Documentation

## ◆ $attributeArray

eZNamePatternResolver::$attributeArray
| private

Definition at line 90 of file eznamepatternresolver.php.

## ◆ $contentObject

eZNamePatternResolver::$contentObject
| private

Definition at line 69 of file eznamepatternresolver.php.

Referenced by __construct().

## ◆ $groupLookupTable

eZNamePatternResolver::$groupLookupTable
| private

Definition at line 47 of file eznamepatternresolver.php.

## ◆ $metaString

eZNamePatternResolver::$metaString = 'EZMETAGROUP_'
| private

Definition at line 98 of file eznamepatternresolver.php.

## ◆ $namePattern

eZNamePatternResolver::$namePattern
| private

Definition at line 62 of file eznamepatternresolver.php.

Referenced by __construct(), extractTokens(), filterNamePattern(), and translatePattern().

## ◆ $origNamePattern

eZNamePatternResolver::$origNamePattern
| private

Definition at line 54 of file eznamepatternresolver.php.

## ◆ $translation

eZNamePatternResolver::$translation
| private

Definition at line 83 of file eznamepatternresolver.php.

## ◆ $version

eZNamePatternResolver::$version
| private

Definition at line 76 of file eznamepatternresolver.php.

## ◆ FIELD_NAME_MAX_SIZE

const eZNamePatternResolver::FIELD_NAME_MAX_SIZE = 255

Definition at line 40 of file eznamepatternresolver.php.

Referenced by resolveNamePattern().

The documentation for this class was generated from the following file:

- eznamepatternresolver.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.