Date index for Jan 2004


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [achievo] Re: email notifierfor new/finished projects



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Nele Vogel wrote:

> Is there a different approach to solve this problem?

I (re)discovered a function that I created a long time ago, but never
actually used. It might solve your problem!

Every attribute has an equal($rec1, $rec2) method to compare records.

The manytoonerelation overrides this equal method and performs its own
logic, so it might tell you the records are equal, even though a normal
== or value2db would tell you otherwise.

Your code could be modified like this:

function postUpdate($rec)
{
  $oldRecord = $rec["atkorgrec"];
  $newRecord = $rec;

  $customerAttr = $this->m_attribList["customer"];

  if (!$customerAttr->equal($oldRecord, $newRecord))
  {
    // do something
  }
}

Could you try if that solves the problem? If it doesn't, we could modify
the equal methods so they work as expected.

The equal() method for manytoonerelations can be found in
atk/relations/class.atkmanytoonerelation.inc

Greetings,
Ivo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAAp+b95NUnGFZm9cRAol+AKDsF3/V5uFsykBjJ7GR8d28cTOW6QCgu7CV
M6lu/Gj0b9pmvZ+VoFZ1+HQ=
=goo3
-----END PGP SIGNATURE-----


http://www.achievo.org/lists achievo.org - ©1999-2002 ibuildings.nl BV