Commit f2a7390c authored by Jonathan.Wage's avatar Jonathan.Wage

Fixed calls to wrong static functions and added some functionality to sandbox.

parent c8812542
...@@ -169,7 +169,7 @@ class Doctrine_Facade ...@@ -169,7 +169,7 @@ class Doctrine_Facade
{ {
$directory = '/tmp/tmp_doctrine_models'; $directory = '/tmp/tmp_doctrine_models';
Doctrine::generateModelsFromDb($directory); Doctrine_Facade::generateModelsFromDb($directory);
$export = new Doctrine_Export_Schema(); $export = new Doctrine_Export_Schema();
...@@ -321,7 +321,7 @@ class Doctrine_Facade ...@@ -321,7 +321,7 @@ class Doctrine_Facade
if ($delete) if ($delete)
{ {
$models = Doctrine::getLoadedModels(); $models = Doctrine_Facade::getLoadedModels();
foreach ($models as $model) foreach ($models as $model)
{ {
...@@ -351,7 +351,7 @@ class Doctrine_Facade ...@@ -351,7 +351,7 @@ class Doctrine_Facade
if ($delete) if ($delete)
{ {
$models = Doctrine::getLoadedModels(); $models = Doctrine_Facade::getLoadedModels();
foreach ($models as $model) foreach ($models as $model)
{ {
......
...@@ -38,13 +38,15 @@ define('SANDBOX_PATH', dirname(__FILE__)); ...@@ -38,13 +38,15 @@ define('SANDBOX_PATH', dirname(__FILE__));
define('DOCTRINE_PATH', dirname(SANDBOX_PATH) . DIRECTORY_SEPARATOR . 'lib'); define('DOCTRINE_PATH', dirname(SANDBOX_PATH) . DIRECTORY_SEPARATOR . 'lib');
define('DATA_FIXTURES_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'fixtures'); define('DATA_FIXTURES_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'fixtures');
define('MODELS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'models'); define('MODELS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'models');
define('MIGRATIONS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'models'); define('MIGRATIONS_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'migrations');
define('SQL_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'sql'); define('SQL_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'sql');
define('YAML_SCHEMA_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'schema'); define('YAML_SCHEMA_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'schema');
define('DSN', 'sqlite:/' . SANDBOX_PATH . DIRECTORY_SEPARATOR . 'sandbox.db'); define('DB_PATH', SANDBOX_PATH . DIRECTORY_SEPARATOR . 'sandbox.db');
define('DSN', 'sqlite:' . DB_PATH);
require_once(DOCTRINE_PATH . DIRECTORY_SEPARATOR . 'Doctrine.php'); require_once(DOCTRINE_PATH . DIRECTORY_SEPARATOR . 'Doctrine.php');
spl_autoload_register(array('Doctrine', 'autoload')); spl_autoload_register(array('Doctrine', 'autoload'));
Doctrine_Manager::connection(DSN, 'sandbox'); $pdo = new PDO(DSN);
\ No newline at end of file Doctrine_Manager::connection($pdo, 'sandbox');
\ No newline at end of file
...@@ -10,7 +10,7 @@ abstract class BaseUser extends Doctrine_Record ...@@ -10,7 +10,7 @@ abstract class BaseUser extends Doctrine_Record
{ {
$this->setTableName('user'); $this->setTableName('user');
$this->hasColumn('username', 'string', 255); $this->hasColumn('username', 'string', 255);
$this->hasColumn('contact_id', 'integer', null); $this->hasColumn('contact_id', 'integer', 11);
} }
public function setUp() public function setUp()
......
No preview for this file type
...@@ -6,7 +6,7 @@ User: ...@@ -6,7 +6,7 @@ User:
length: 255 length: 255
contact_id: contact_id:
type: integer type: integer
size: 11 length: 11
relations: relations:
Contact: Contact:
local: contact_id local: contact_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment