function __construct($class) { if ($class instanceof ITable) { $class = get_class($class); } else { if (!class_exists($class)) { $class2 = \Radical\Core\Libraries::getProjectSpace('DB\\' . $class); if (class_exists($class2)) { $class = $class2; } else { throw new \Exception($class . ' class does not exist'); } } if (!CoreInterface::oneof($class, '\\Radical\\Database\\Model\\ITable')) { throw new \Exception($class . ' is not a Database Table object'); } } $this->class = $class; }
protected static function getClasses() { return \Radical\Core\Libraries::get(\Radical\Core\Libraries::getProjectSpace('DB\\*')); }
protected function _getModule($module, $ns = 'DB') { return \Radical\Core\Libraries::getProjectSpace($ns . '\\' . ucfirst($module)); }