Hi Tony,

>  I'm working on an application to store information on lab specimens.
>  The lab receive specimens which are divided into aliquots which are
>  then put into boxes and in turn stored in freezers.
>
>  I want to create a function to find all unstored aliquots and display
>  a message on every page to alert the lab users that there are aliquots
>  that haven't been assigned to boxes yet. It's a simple query:
>
>  SELECT COUNT(aliquot.id)
>  FROM aliquots
>  WHERE aliquots.box_id IS NULL
>
>  The problem is that I can't quite decide where it belongs in the MVC
>  architecture. It seems like a helper since the alert message would
>  appear in the left column of every page. But it runs a query, so does
>  it belong in a model? The problem is that I want to retrieve the
>  information no matter which model is currently in use.

I would:

* create a method in your model to fetch the data
* create a method in your controller to access this data
* create an element that calls via 'requestAction' the data from the controller
* insert this element into your layout and add array('cache'=>'1 hour');

hth

jon


-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to