An Iterator is only generated for hasMany relations... nothing to Iterate in a hasOne... use getRecord()


David A. Cheslow PhD
Saturna Software Systems - http://www.saturnasoftware.com
BOX 190
SATURNA ISLAND BC  V0N 2Y0
CANADA

(250) 539-3703



On 25-Mar-07, at 4:21 PM, Andy Jarrett wrote:

Hi there,

I cannot seem to get the "iterator" functions to work but cannot see
what I'm doing wrong either. Below is my Reactor File

<objects name="pets" alias="pets">
        <hasOne name="pet_breed">
                <relate from="pet_breed_id" to=pet_breed_id" />
        </hasOne>                                 
</objects>
        
<objects name="pet_breed" alias="pet_breed">
        <hasOne name="pets">
                <relate from="pet_breed_id" to="pet_breed_id" />
        </hasOne>
</objects>

The code
<cfset reactor = CreateObject("Component",
"reactor.reactorFactory").init(expandPath("/config/reactor.xml")) />
<cfset pet = reactor.createRecord("pets") />
<cfset pet.setpetid(1) />
<cfset pet.load() />
<cfdump var="#pet#">

I've set up the foreign keys from the Pets table on the pet_breed_id
column as well. Doesn't matter what I do there is no Iterator
available on pet_breed_id.

Any ideas on where I am going wrong?

Cheers, Andy


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to