1 | <?php |
||
12 | abstract class Datastore implements Datastore_Interface { |
||
13 | |||
14 | /** |
||
15 | * The related object id |
||
16 | * |
||
17 | * @var integer |
||
18 | */ |
||
19 | protected $object_id = 0; |
||
20 | |||
21 | /** |
||
22 | * Initialize the datastore. |
||
23 | */ |
||
24 | public function __construct() { |
||
25 | $this->init(); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Initialization tasks for concrete datastores. |
||
30 | * |
||
31 | * @abstract |
||
32 | */ |
||
33 | abstract public function init(); |
||
34 | |||
35 | /** |
||
36 | * Get the related object id |
||
37 | * |
||
38 | * @return integer |
||
39 | */ |
||
40 | public function get_object_id() { |
||
43 | |||
44 | /** |
||
45 | * Set the related object id |
||
46 | * |
||
47 | * @param integer $object_id |
||
48 | */ |
||
49 | public function set_object_id( $object_id ) { |
||
52 | |||
53 | /** |
||
54 | * Create a new datastore of type $raw_type. |
||
55 | * |
||
56 | * @param string $raw_type |
||
57 | * @return Datastore_Interface |
||
58 | */ |
||
59 | public static function factory( $raw_type ) { |
||
71 | |||
72 | /** |
||
73 | * An alias of factory(). |
||
74 | * |
||
75 | * @see Datastore::factory() |
||
76 | * @return Datastore_Interface |
||
77 | */ |
||
78 | public static function make() { |
||
81 | } |
||
82 |