Teddy,
The reason you’re seeing this error with
the shorthand is because the deleted method returns void, not a record. So, by
chaining these calls together you’re not setting anything into the region
variable so you can’t ask it if it’s deleted.
This isn’t a bug, this is how CF
works.
Thanks,
Doug Hughes
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Teddy Payne
Sent: Sunday, June 04, 2006 11:51
AM
To: [email protected]
Subject: [Reactor for CF]
IsDeleted()
I have found that there is a curious behavior with the IsDeleted()
method of the record factory.
The following code is deleting a record. This does not generate an error
for the IsDeleted() method.
<cfscript>
Reactor = CreateObject("Component","reactor.reactorFactory").init(expandPath("reactor.xml"));
Region = Reactor.createRecord("Region").load(RegionID=5);
Region.delete();
Deleted = Region.IsDeleted();
</cfscript>
The following shorthand version does cause an error.
<cfscript>
Reactor = CreateObject("Component","reactor.reactorFactory").init(expandPath("
reactor.xml"));
Region = Reactor.createRecord("Region").delete(RegionID=5);
Deleted = Region.IsDeleted();
</cfscript>
If I do not have a load() method prior to the IsDeleted() check, an error is
generated. I suspect the shorthand notation deconstructs the region
record object and therefore does not provide the IsDeleted() method a valid
object to reference.
Is this a bug? Or is this just how the IsDeleted() behaves and requires the
prerequisite of a load()?
Thanks,
--
<cf payne />
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|