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());
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 =
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 =
$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
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());
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());
I want to
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 stephane.er...@gmail.com
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 gabopo...@gmail.com wrote:
ERROR
500 | Internal Server Error | Doctrine_Validator_Exception Validation failed
in class document_trace
1 field had validation
HELP!!
I try to capture the id of a new record for storage in an external table
(document_trace) but not what brings me
/lib/model/doctrine/template.class.php
public function save(Doctrine_Connection $conn = null) {
if ($this-isNew()) {
$sfUser =sfContext::getInstance();
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 capture
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
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 are
12 matches
Mail list logo