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 save to another table for example (date, id_user, id_document) of 
>> the creation of a document for an audit ...
>> 
>> I then keeping of large app / document to store the audit log .. but I have 
>> to take the new id_document

My suggestion above will work, but it's not the best way...

You should use the Doctrine auditable behavior (I think that's what it's 
called).

You could also use a stored procedure in the database. For a large app, I'd go 
with the stored procedure - it's keeping the work in the database, less 
requests, less network traffic/latency, and  offers greater decoupling (you 
still get the auditing, even if the database is manually changed, regardless of 
HOW it's changed)

There's probably other methods as well that would be better (another instance 
where AOP would be handy....)



-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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.


Reply via email to