[2.0] Fix for accidental commit to sandbox
This commit is contained in:
parent
bb6e54fba1
commit
c71b4ebd71
@ -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() {
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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!';
|
Loading…
Reference in New Issue
Block a user