Hi, i'm a newbie into symfopny and i'm having this weird problem,
could be something i'm doing wrong:
I started with symfony 1.0 for learning it and then moving on to
symfony 1.1. Also, due to this i'm using propel (the version which
came with symfony).
for learning, i'm trying to build a common forum-like application
which allows persons to create discussions and post messages into
them. I have a many to many relation which turned into this three
tables:
person (master)
discussion (master)
messages (detail for person and discussion)
I'm trying to save a new discussion and a new message (person has
already been created). So i make this:
$discussion = new Discussion ();
$discussion->setTitle ($this->getRequestParameter ('title'));
$discussion->setPersonId ($this->getUser ()->getAttribute
('id')); // from session
$discussion->setcreationDate (time ());
$discussion->save ();
The problem i have is that after the save i can't get the correct id
for discussion:
$disc_id = $discussion->getId ();
It ALWAYS returns 0. BUT in the database it's being saved with no
problem (and btw, the id in the db is different as it's an integer not
null auto_increment.
table definition:
create table discussion (
id integer primary key not null auto_increment,
What could be wrong ? this should be an error on my side but i can't
imagine which one because other tables and models i have behave
without problems.
i would reallya appreciate your help about this. After i learn propel
"good" i would study doctrine and would decide if migrating or not.
Julian.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---