Trying to do some related tables, under my bundle Entity dir i create 2
files
------------------------------Street:
/**
* @orm:Entity
*/
class Street
{
/**
* @orm:Id
* @orm:Column(type="integer")
* @orm:GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* @orm:Column(type="string", length="255")
*/
protected $name;
/**
* @ManyToOne(targetEntity="Town", inversedBy="streets")
*/
private $town;
}
-------------------------------------------------------------------Town:
/**
* @orm:Entity
*/
class Town
{
/**
* @orm:Id
* @orm:Column(type="integer")
* @orm:GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* @orm:Column(type="string", length="255")
*/
protected $name;
/**
* @OneToMany(targetEntity="Street", mappedBy="town")
*/
private $streets;
}
=======================
then, start doctrine:generate:entities MyBundle task.
and --dump-sql doctrine:schema:create shown:
===
CREATE TABLE Town (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT
NULL, PRIMARY KEY(id)) ENGINE = InnoDB;
CREATE TABLE Street (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255)
NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB
===
Where is my foreign keys? and in php classes now GetChild methods too.
What i do wrong?
(and btw, how say doctrine dont generate ~Street.php file)
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en