From c71b4ebd71019e83581b241f95baccee60ea591e Mon Sep 17 00:00:00 2001 From: jwage Date: Fri, 9 Oct 2009 17:51:06 +0000 Subject: [PATCH] [2.0] Fix for accidental commit to sandbox --- tools/sandbox/Entities/Address.php | 2 +- tools/sandbox/Entities/User.php | 13 +------------ tools/sandbox/cli-config.php | 6 ++---- tools/sandbox/index.php | 11 ++--------- 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/tools/sandbox/Entities/Address.php b/tools/sandbox/Entities/Address.php index 90ea3f3f2..bb084c30e 100644 --- a/tools/sandbox/Entities/Address.php +++ b/tools/sandbox/Entities/Address.php @@ -11,7 +11,7 @@ class Address { private $id; /** @Column(type="string", length=255) */ private $street; - /** @OneToOne(targetEntity="User", mappedBy="address", cascade={"persist"}) */ + /** @OneToOne(targetEntity="User", mappedBy="address") */ private $user; public function getId() { diff --git a/tools/sandbox/Entities/User.php b/tools/sandbox/Entities/User.php index 0adbfd659..cf44b4683 100644 --- a/tools/sandbox/Entities/User.php +++ b/tools/sandbox/Entities/User.php @@ -15,20 +15,9 @@ class User { private $test; /** * @OneToOne(targetEntity="Address") - * @JoinColumns({ - * @JoinColumn(name="address_id", referencedColumnName="id"), - * @JoinColumn(name="address2_id", referencedColumnName="id") - * }) + * @JoinColumn(name="address_id", referencedColumnName="id") */ private $address; - /** - * @ManyToMany(targetEntity="Group") - * @JoinTable(name="user_group", - * joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")}, - * inverseJoinColumns={@JoinColumn(name="group_id", referencedColumnName="id") - * }) - */ - private $groups; public function getId() { return $this->id; diff --git a/tools/sandbox/cli-config.php b/tools/sandbox/cli-config.php index bac5ca186..c7c0c4c9f 100644 --- a/tools/sandbox/cli-config.php +++ b/tools/sandbox/cli-config.php @@ -23,10 +23,8 @@ $config = new \Doctrine\ORM\Configuration(); $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache); $connectionOptions = array( - 'driver' => 'pdo_mysql', - 'user' => 'root', - 'password' => '', - 'dbname' => 'doctrine2' + 'driver' => 'pdo_sqlite', + 'path' => 'database.sqlite' ); $em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config); diff --git a/tools/sandbox/index.php b/tools/sandbox/index.php index ea547d510..c13ce64b0 100644 --- a/tools/sandbox/index.php +++ b/tools/sandbox/index.php @@ -14,7 +14,7 @@ $classLoader->register(); // Set up caches $config = new \Doctrine\ORM\Configuration; -$cache = new \Doctrine\Common\Cache\ArrayCache; +$cache = new \Doctrine\Common\Cache\ApcCache; $config->setMetadataCacheImpl($cache); $config->setQueryCacheImpl($cache); @@ -30,13 +30,6 @@ $em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config); ## PUT YOUR TEST CODE BELOW $user = new User; -$user->setName('jwage'); - $address = new Address; -$address->setStreet('6512 Mercomatic Court'); -$address->setUser($user); -$user->setAddress($address); -$em->persist($user); -$em->persist($address); -$em->flush(); \ No newline at end of file +echo 'Hello World!'; \ No newline at end of file