Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Static Public Member Functions | Static Protected Member Functions | Static Private Attributes | List of all members
ezpContentRepository Class Reference

## Static Public Member Functions
static | query (ezpContentCriteria $criteria)
static | queryCount (ezpContentCriteria $criteria)
static | fetch (ezpContentIdentifier $identifier)

## Static Protected Member Functions
static | translateFetchParams (ezpContentCriteria $criteria)

## Static Private Attributes
static | $defaultRootNode = 1

## Detailed Description

Definition at line 16 of file repository.php.

## Member Function Documentation

## ◆ fetch()

static ezpContentRepository::fetch | ( | ezpContentIdentifier | $identifier | ) |
| static

Fetches an ezpContent based on an identifier object.

The content will be fetched depending on what aspects of the identifier object have been configured.

Example 1: `$identifier = new ezpContentIdentifier; $identifier->objectId = 123; $content = ezpContentRepository::fetch( $identifier );`

Example 2: `$identifier = new ezpContentIdentifier; $identifier->nodeId = 456; $content = ezpContentRepository::fetch( $identifier );`

Further evolutions on ezpContentIdentifier will allow for unified fetching without adding new methods

Parameters

  ezpContentIdentifier | $identifier |

Returns
  ezpContent

Definition at line 125 of file repository.php.

## ◆ query()

static ezpContentRepository::query | ( | ezpContentCriteria | $criteria | ) |
| static

Runs a content repository query using a given set of criteria

Parameters

  ezpContentCriteria | $criteria |

Returns
  ezpContentList

Definition at line 24 of file repository.php.

References ezpContent\fromNode(), and translateFetchParams().

## ◆ queryCount()

static ezpContentRepository::queryCount | ( | ezpContentCriteria | $criteria | ) |
| static

Returns node count using a given set of criteria

Parameters

  ezpContentCriteria | $criteria |

Returns
  int

Definition at line 41 of file repository.php.

References $count, and translateFetchParams().

## ◆ translateFetchParams()

static ezpContentRepository::translateFetchParams | ( | ezpContentCriteria | $criteria | ) |
| static protected

We have a set of content criteria in $criteria These criteria provide us with:

- location conditions (part of subtree X, not part of subtree Y, etc)
- content based conditions (content class, attribute value, etc)

Based on this, we need to end up calling eZContentObjectTreeNode and return the resulting objects as an ezpContentList, a countable iterator that iterates over ezpContent objects

This method will make the translation between ezpContentCriteria and acceptable fetch params

Returns
  stdClass Object with 2 properties :
  - rootNodeId => array of parent node Ids
  - params => array of translated fetch params

eZContentObjectTreeNode requires one or more root node IDs to perform a content request. Such a root node can be provided using an ezpContentLocationCriteria. If none is provided, a default root node can be used. This is ezpContentRepository::$defaultRootNode

Definition at line 62 of file repository.php.

References $ret.

Referenced by query(), and queryCount().

## Member Data Documentation

## ◆ $defaultRootNode

ezpContentRepository::$defaultRootNode = 1
| static private

Definition at line 130 of file repository.php.

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

- repository.php

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