. */ /** * Doctrine_Export * * @package Doctrine * @author Konsta Vesterinen * @license LGPL */ class Doctrine_Export { private $conn; private $dbh; public function __construct($conn) { $this->conn = $conn; $this->dbh = $conn->getDBH(); } public function export() { $parent = new ReflectionClass('Doctrine_Record'); $conn = Doctrine_Manager::getInstance()->getCurrentConnection(); $old = $conn->getAttribute(Doctrine::ATTR_CREATE_TABLES); $conn->setAttribute(Doctrine::ATTR_CREATE_TABLES, true); foreach(get_declared_classes() as $name) { $class = new ReflectionClass($name); if($class->isSubclassOf($parent) && ! $class->isAbstract()) $obj = new $class(); } $conn->setAttribute(Doctrine::ATTR_CREATE_TABLES, $old); } }