Stop logging of certain database updates

31 views
Skip to first unread message

Kye Etherton

unread,
Jun 1, 2012, 3:30:11 PM6/1/12
to diem-users
I have a query which runs on every page load and updates a row in the
database. For some annoying reason it's logging them all.

How can I get it to stop logging them on this single query?

Stéphane

unread,
Jun 2, 2012, 10:55:49 AM6/2/12
to diem-...@googlegroups.com
Which logging ?
dmDoctrineRecord log ?

If so, look at the ->notify() method of dmDoctrineRecord.
Overload this method within your model class.

Regards,

Kye Etherton

unread,
Jun 2, 2012, 11:02:45 AM6/2/12
to diem-...@googlegroups.com
Yea, I've had to write raw SQL to stop the object editing from appearing on every page load.
Yours Sincerely

Kye Etherton
Managing Director

Sugar Cube Productions Ltd

Company Registered in England and Wales, registration number: 07856043

Stéphane

unread,
Jun 2, 2012, 7:33:25 PM6/2/12
to diem-...@googlegroups.com
I think this is the best solution anyway.

:)

Michal Filip

unread,
Aug 3, 2012, 4:41:02 AM8/3/12
to diem-...@googlegroups.com
Have a look at the following code - might be helpful:

<code>
class xyzPluginConfiguration extends sfPluginConfiguration{

  public function initialize(){
    $this->dispatcher->connect('dm.record.modification', array($this, 'listenToRecordModificationEvent'));
  }
  
  //suppress video hits update flooding
  public function listenToRecordModificationEvent(sfEvent $e) {
      if($e['type'] == 'update'
      && ($e->getSubject() instanceof SmVideo
          || $e->getSubject() instanceof SmContestItem))
                $e->setProcessed(true);
  }
}
</code>

Dne pátek, 1. června 2012 21:30:11 UTC+2 Kye Etherton napsal(a):
Reply all
Reply to author
Forward
0 new messages