Hello Paul,

yes THIS REALLY HELPS.
Now I start to _understand_ how to use the find() like I used to do
sql :) thanks a lot.

To comment your suggestion about habtm on meals:
Each request means a customer will arrive having ordered a firstMeal
on arrivalDay meal1
Each request means a customer will leave having ordered a lastMeal on
leavingDay meal2
Each request means a customer will stay having ordered a KindofMeal
during he stays meal0
with meal means breakfast, full  board or half board, ...

so I did
(*crippled code!!*)
class Request extends AppModel {
var $hasOne = array('Booking' => array(
var $belongsTo = array( 'Customer' 'Meal0' 'Meal1' 'Meal2'
'Occasion' (
var $hasAndBelongsToMany = array( 'Material' 'Room'

instead of a habtm

... thanks for suggesting a better way to do, but no scale need this
for :)

btw: just discoverd a great tool on cake: visualize to draw diagram of
databse-model works fantastic!
http://bakery.cakephp.org/articles/view/visualize-schema-task
http://www.assembla.com/code/mi/subversion/nodes/branches/base/vendors/shells/visualize.php
http://pastebin.com/f78f99e58
http://www.graphviz.org/About.php

Thanks and HTH ^|^

Michael
On 23 Apr., 09:08, WebbedIT <[email protected]> wrote:
> My main tip: Stop trying to force your own model names and fieldnames
> and use cakes conventions, makes life a whole lot easier!
>
> Why are you joining Meal/meals when you're not pulling any fields from
> it, or have you missed out some fields?
>
> If you were conforming to Cake's conventions you would run the
> following (I have included an echo debug at the bottom so you can see
> the way the data array is structured which tells you how to access the
> data in your view.):
>
> $this->data = $this->BookingPosition->find('all', array(
>   'fields' => array(
>     'DISTINCT BookingPosition.anreise_datum',
>     'BookingPosition.abreise_datum',
>     'Request.name',
>     'Request.anzahl_erwachsene',
>     'Request.anzahl_jugendliche',
>     'Request.anzahl_kinder',
>     'Request.meal_0_id', // for scalability I would replace these with
> a hasMany association
>     'Request.meal_1_id', // for scalability I would replace these with
> a hasMany association
>     'Request.meal_2_id', // for scalability I would replace these with
> a hasMany association
>     'Booking.name',
>     'Lodging.zimmernummer',
>     'CONCAT (CS.name, ': ', CS.Firma, ': ', CS.Vorname, ', ',
> CS.Nachname) AS kunde'
>   ),
>   'order' => array('BookingPosition.anreise_datum')
> ));
> echo debug($this->data);
>
> HTH
>
> Paul
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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