MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
persistentmanagerfactory.class
Ir para a documentação deste ficheiro.
1<?php
2
3include ('persistentexception.class');
4
6{
7 private $classMaps = array();
8 private $databases = array();
9 private $converters = array();
10 private $debug = false;
11 private $locked = false;
12 private $configLoader;
13 private $manager;
14 public $miolo;
15
16 public function __construct()
17 {
18 $this->miolo = MIOLO::GetInstance();
19 }
20
21 public function setConfigLoader($configLoader)
22 {
23 if ($configLoader == 'XML')
24 {
25 $this->configLoader = new XMLConfigLoader($this);
26 }
27 }
28
33 public function getPersistentManager()
34 {
35 if (!$this->locked)
36 {
37 $this->manager = new PersistentManager($this);
38 $this->locked = true;
39 }
40 return $this->manager;
41 }
42
43 public function addClassMap($name, $classMap)
44 {
45 $this->classMaps[$name] = $classMap;
46 }
47
48 public function getClassMap($param1, $param2 = NULL)
49 {
50 $numargs = func_num_args();
51
52 if ($numargs == 1)
53 {
54 if (is_object($param1))
55 {
56 $module = $param1->_bmodule;
57 $name = $param1->_bclass;
58 }
59 }
60 elseif ($numargs == 2)
61 {
62 $module = $param1;
63 $name = $param2;
64 }
65 else
66 {
67 throw new EPersistentManagerFactoryException("getClassmap Error!");
68 }
69
70 $className = strtolower($module . $name);
71 if (is_null($this->classMaps[$className]))
72 {
73 $classMap = $this->configLoader->getClassMap($module, $name);
74 $this->addClassMap($className, $classMap);
75 }
76
77 return $this->classMaps[$className];
78 }
79
80 public function getConverter($name)
81 {
82 return $this->converters[$name];
83 }
84
85 public function putConverter($name, &$converter)
86 {
87 $this->converters[$name] = $converter;
88 }
89}
90?>
getClassMap($param1, $param2=NULL)