4 * Ajatus - Distributed CRM
6 * Copyright (c) 2008 Jerry Jalava <jerry.jalava@gmail.com>
7 * Copyright (c) 2008 Nemein Oy <http://nemein.com>
8 * Website: http://ajatus.info
9 * Licensed under the GPL license
10 * http://www.gnu.org/licenses/gpl.html
17 private $configuration;
20 public function __construct(&$connection, $configuration)
22 $this->connection
=& $connection;
23 $this->configuration
=& $configuration;
26 public function __get($helper)
28 return $this->load_helper($helper);
31 private function &load_helper($name)
33 if (isset($this->cache
[$name]))
35 return $this->cache
[$name];
38 $classname = "ajatus_helpers_{$name}";
40 if (! class_exists($classname))
42 throw new ajatus_helper_exception("No helper {$name} found!");
45 $this->cache
[$name] = new $classname(&$this->connection
, &$this->configuration
);
47 return $this->cache
[$name];