1
0
mirror of synced 2024-12-05 03:06:05 +03:00

[2.0] Fix for accidental commit to sandbox

This commit is contained in:
jwage 2009-10-09 17:51:06 +00:00
parent bb6e54fba1
commit c71b4ebd71
4 changed files with 6 additions and 26 deletions

View File

@ -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() {

View File

@ -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;

View File

@ -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);

View File

@ -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();
echo 'Hello World!';