Path

ez components / documentation / api reference / 2007.2 / persistent


PersistentObject

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Source for file generator_definition.php

Documentation is available at generator_definition.php

 1. <?php
 2. /**
 3.  * @version 1.3.3
 4.  * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved.
 5.  * @license http://ez.no/licenses/new_bsd New BSD License
 6.  * @package PersistentObject
 7.  */
 8.  
 9. /**
10.  * Defines a persistent object id generator.
11.  *
12.  * For more information on how to use this class see
13.  * {@link ezcPersisentObjectIdProperty}
14.  *
15.  * @version 1.3.3
16.  * @package PersistentObject
17.  */
18. class ezcPersistentGeneratorDefinition extends ezcBaseStruct
19. {
20.     /**
21.      * The name of the class implementing the generator.
22.      *
23.      * @var string 
24.      */
25.     public $class;
26.  
27.     /**
28.      * Any parameters required by the generator.
29.      *
30.      * Parameters should be in the format array('parameterName' => parameterValue )
31.      *
32.      * @var array(string=>string) 
33.      */
34.     public $params;
35.  
36.     /**
37.      * Constructs a new PersistentGeneratorDefinition where $class contains
38.      * name of the class to load and $params contains a list of parameters
39.      * provided to the constructor of that class.
40.      *
41.      * @param string $class 
42.      * @param array $params 
43.      */
44.     public function __construct$classarray $params array() )
45.     {
46.         $this->class = $class;
47.         $this->params = $params;
48.     }
49.  
50.     /**
51.      * Returns a new instance of this class with the data specified by $array.
52.      *
53.      * $array contains all the data members of this class in the form:
54.      * array('member_name'=>value).
55.      *
56.      * __set_state makes this class exportable with var_export.
57.      * var_export() generates code, that calls this method when it
58.      * is parsed with PHP.
59.      *
60.      * @param array(string=>mixed) $array 
61.      * @return ezcPersistentGeneratorDefinition 
62.      */
63.     public static function __set_statearray $array )
64.     {
65.         return new ezcPersistentGeneratorDefinition$array['class'],
66.                                                      $array['params');
67.     }
68. }
69. ?>
Last updated: Mon, 17 Dec 2007