Apache Zeta Components - high quality PHP components

Apache Zeta Components Manual :: Docs For Class ezcPersistentObjectIdProperty

PersistentObject::ezcPersistentObjectIdProperty

Class ezcPersistentObjectIdProperty

Defines a persistent object id field.

The column should be of type int both in PHP and in the database, usually. If you want to use a string ID, you need to use the ezcPersistentManualGenerator and set the ID property of the affected object yourself. Alternatively you can implement your own ezcPersistentIdentifierGenerator to perform this operation consistently.

The default value for the ID should be null, since ezcPersistentSession::save() determines if an object was already saved this way for integer IDs.

For descriptions for some the constants used in this class see: ezcPersisentObjectProperty

Source for this file: /PersistentObject/src/object/persistent_object_id_property.php

Version:   //autogen//

Properties

string read/write $columnName
The name of the database field that stores the value.
int read/write $databaseType
Type of the database column, as defined by PDO constants: PDO::PARAM_BOOL, PDO::PARAM_INT, PDO::PARAM_STR (default as defined by ezcQuery::bindValue()) or PDO::PARAM_LOB (important for binary data).
ezcPersistentGeneratorDefinition read/write $generator
The type of generator to use for the identifier. The identifier generator must be an object that extends the abstract class ezcPersistentIdentifierGenerator. The current options that are part of this package are:
  • ezcPersistentSequenceGenerator
  • ezcPersistentManualGenerator
  • ezcPersistentNativeGenerator
string read/write $propertyName
The name of the PersistentObject property that holds the value in the PHP object.
int read/write $propertyType
The type of the PHP property. See class constants ezcPersistentObjectProperty::PHP_TYPE_*.
int read/write $visibility
The visibility of the property. This property is deprecated!

Method Summary

public static ezcPersistentObjectIdProperty __set_state( $array )
Returns a new instance of this class with the data specified by $array.
public ezcPersistentObjectIdProperty __construct( [ $columnName = null] , [ $propertyName = null] , [ $visibility = null] , [ $generator = null] , [ $propertyType = ezcPersistentObjectProperty::PHP_TYPE_INT] , [ $databaseType = PDO::PARAM_STR] )
Constructs a new PersistentObjectField

Methods

__set_state

static ezcPersistentObjectIdProperty __set_state( $array )

Returns a new instance of this class with the data specified by $array.

$array contains all the data members of this class in the form: array('member_name'=>value).

__set_state makes this class exportable with var_export. var_export() generates code, that calls this method when it is parsed with PHP.

Parameters:
Name Type Description
$array array(string=>mixed)

__construct

ezcPersistentObjectIdProperty __construct( [string $columnName = null] , [string $propertyName = null] , [int $visibility = null] , [ezcPersistentGeneratorDefinition $generator = null] , [int $propertyType = ezcPersistentObjectProperty::PHP_TYPE_INT] , [int $databaseType = PDO::PARAM_STR] )

Constructs a new PersistentObjectField

Parameters:
Name Type Description
$columnName string The name of the database field that stores the value.
$propertyName string The name of the class member
$visibility int See $visibility for possible values.
$generator ezcPersistentGeneratorDefinition Definition of the identifier generator
$propertyType int See ezcPersistentObjectProperty for possible values.
$databaseType int See PDO::* for possible values.
Documentation generated by phpDocumentor 1.4.3