Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcPersistentCodeManager

PersistentObject::ezcPersistentCodeManager

Class ezcPersistentCodeManager

Handles persistent object definitions in plain code style.

Each definition must be in a separate file in the directory specified to the constructor. The filename must be the same as the lowercase name of the persistent object class with .php appended. For namespaces (PHP 5.3 and newer), sub-directories are used. For example the definition for class MyClass must reside in the top level directory as myclass.php and the definition for My\Namespace\Class must reside in my/namespace/class.php. Each such file must return the definition of one persistent object class.

Example exampleclass.php:

  1.  <?php
  2.  $definition = new ezcPersistentObjectDefinition;
  3.  return $definition;
  4.  ?>

Source for this file: /PersistentObject/src/managers/code_manager.php

ezcPersistentDefinitionManager
   |
   --ezcPersistentCodeManager
Version:   //autogen//

Method Summary

public ezcPersistentCodeManager __construct( $dir )
Constructs a new code manager that will look for persistent object definitions in the directory $dir.
public ezcPersistentObjectDefinition fetchDefinition( $class )
Returns the definition of the persistent object with the class $class.

Inherited Methods

From ezcPersistentDefinitionManager
public abstract ezcPersistentObjectDefinition ezcPersistentDefinitionManager::fetchDefinition()
Returns the definition of the persistent object with the class $class.
protected static ezcPersistentObjectDefinition ezcPersistentDefinitionManager::setupReversePropertyDefinition()
Returns the definition $def with the reverse relations field correctly set up.

Methods

__construct

ezcPersistentCodeManager __construct( string $dir )

Constructs a new code manager that will look for persistent object definitions in the directory $dir.

Parameters:
Name Type Description
$dir string

fetchDefinition

ezcPersistentObjectDefinition fetchDefinition( string $class )

Returns the definition of the persistent object with the class $class.

Parameters:
Name Type Description
$class string
Exceptions:
Type Description
ezcPersistentDefinitionMissingIdPropertyException if the definition does not have an "idProperty" attribute.
ezcPersistentDefinitionNotFoundException if no such definition can be found.
Redefinition of:
Method Description
ezcPersistentDefinitionManager::fetchDefinition() Returns the definition of the persistent object with the class $class.
Documentation generated by phpDocumentor 1.4.3