Re: Object Index
[prev]
[thread]
[next]
[Date index for 2005/04/19]
On Tue, 2005-04-19 at 10:19 +1000, Jason Galea wrote:
> If you create an object (which has an auto_increment id), then retrieve
> another copy of that object and change a field value, your original
> object won't get the changes.
>
> I think what is happening is that the object index won't index the newly
> created item as it doesn't have it's id. When the copy is retrieved it
> is indexed but the original object has no connection to the indexed object.
That's all correct.
> Modifying the _create method in Class/DBI.pm to call _init before
> returning appears to fix the problem but I can't see it being the best
> solution.
Call it a second time you mean? A better solution would be to create an
"add_to_object_index()" method and call that after the primary key is
filled in. I'll see if I can add this to Tim Bunce's patch that I'm
messing with right now.
- Perrin
|
|
Re: Object Index
Perrin Harkins 03:19 on 19 Apr 2005
|