Thansk to all!!
The solution is copy the parent::save() before take the id, example:
parent::save();
//Insertamos en la tabla de traza de documentos
$sfUser = sfContext::getInstance();
$q = new document_trace();
$q->set('id_document',$this->getId());
$q
Pastebin your form. Obviously you do it wrong...
I don't have an example atm.
Alecs
sent via htc magic
On Jan 8, 2010 2:55 AM, "Gabo" wrote:
ERROR
500 | Internal Server Error | Doctrine_Validator_Exception Validation failed
in class document_trace
1 field had validation error:
* 1 validator
ERROR
500 | Internal Server Error | Doctrine_Validator_Exception Validation failed
in class document_trace
1 field had validation error:
* 1 validator failed on id_document (notnull)
is a new record ($ this-> getId ()), so it is empty.
2010/1/7 Stéphane
> $q->set('id_document', $author->
On 8 Jan 2010, at 00:19, Lee Bolding wrote:
>
> On 8 Jan 2010, at 00:02, Gabo wrote:
>
>>$q = new document_trace();
>>$q->set('id_document', $author);
>> //NOT WORK, ERROR
>
> Should be
> $q->set('id_document', $author->getId());
>
>
On 8 Jan 2010, at 00:02, Gabo wrote:
>
> HELP!!!
>
>
> I TRY THIS:
>
> //lib/model/doctrine/document.class.php
>
> public function save(Doctrine_Connection $conn = null) {
>
> $author= new document();
>
> $author->setName($this->getName());
> $author->setDocumentDescription($th
$q->set('id_document', $author->getId()); <- does it work ?
if you get error message, please copy/past them.
Cheers,
Before Printing, Think about Your Environmental Responsibility!
Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!
On Fri, Jan 8, 2010 at 1:02 AM, Gabo wrote:
HELP!!!
I TRY THIS:
//lib/model/doctrine/document.class.php
public function save(Doctrine_Connection $conn = null) {
$author= new document();
$author->setName($this->getName());
$author->setDocumentDescription($this->getDocumentDescription());
$author->save();
$sfUser = s
On Wed, 6 Jan 2010, Gabo wrote:
> HELP!!
>
> I try to capture the id of a new record for storage in an external table
> (document_trace) but not what brings me
The ID comes from the database but you haven't saved the object so it has
no ID yet.
--
--
You received this message because you
Hi Gabo,
i was working with embedforms and i need do this for my forms works well.
You need save the record that you want get the ID and after save the
record that needs the FK. Look this:
$author = new author();
... (set values for author object)
$author->save();
//now you save the book obje
You are trying to get the inserted id in the if block: if ($this->isNew()) ???
Well, you are wrinting it, the object is not yet saved!
Call parent::save($conn) and then you can get the id from the object.
Cheers, Daniel
On Jan 6, 2010, at 11:48 PM, Gabo wrote:
> HELP!!
>
>
> I try to captur
10 matches
Mail list logo