Message from discussion
Behavior afterFind on associated Model
Received: by 10.36.127.14 with SMTP id z14mr1555897nzc.1181589943862;
Mon, 11 Jun 2007 12:25:43 -0700 (PDT)
Return-Path: <joshben...@gmail.com>
Received: from pbu.edu (pbu.edu [209.92.135.66])
by mx.google.com with ESMTP id h71si1351968nzf.2007.06.11.12.25.43;
Mon, 11 Jun 2007 12:25:43 -0700 (PDT)
Received-SPF: neutral (google.com: 209.92.135.66 is neither permitted nor denied by domain of joshben...@gmail.com)
Received: from [10.1.3.30] ([::ffff:10.1.3.30])
(AUTH: LOGIN jbenner)
by mail.pbu.edu with esmtp; Mon, 11 Jun 2007 15:25:43 -0400
id 00000000001176AD.00000000466DA1B7.0000074B
Message-ID: <466DA1B6.5020300@gmail.com>
Date: Mon, 11 Jun 2007 15:25:42 -0400
From: Joshua Benner <joshben...@gmail.com>
User-Agent: Thunderbird 1.5.0.12 (X11/20070604)
MIME-Version: 1.0
To: cake-php@googlegroups.com
Subject: Behavior afterFind on associated Model
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
ModelA hasMany ModelB
ModelB actsAs SomeBehavior
SomeBehavior defines afterFind()
ModelAController::someAction() has:
$this->ModelA->recursive = 1;
$this->ModelA->findAll();
Will SomeBehavior::afterFind() be triggered for ModelB, since ModelB
will be retrieved via association to ModelA?
So far in my testing, the afterFind on the behavior does not seem to be
called. Is this normal? Is this on purpose?
The $primary argument in behavior functions would seem to suggest that
the behavior functions should still be called even if the model acting
as the behavior is being queried as a result of an association.
I may be confused on this, though. Any help?
--
Joshua Benner
http://bennerweb.com