Good evening,
I am currently converting a game content management application over
to CakePHP 1.3, and since this is my first try at baking I'd like to
check if I am doing things the Cake way :-)
The current model for a creature has four fields containing the ID of
3D textures. For each of these textures there is a separate model
name texture_info to track stats like gender of bounding radius of a
texture.
If a I understand the Cake way of doing model associations, I would
have to change the models to rather look like:
[code]
<?php
class Creatures extends AppModel {
var $name = 'Creature';
var $hasMany = 'TextureInfo';
}
?>
<?php
class TextureInfos extends AppModel {
var $name = 'TextureInfo';
var $belongsTo = 'Creature';
}
?>
[/code]
Thus I'd move the texture ID's currently living as columns inside the
creature out, and only having texture_info models which have a column
for creature_id linking them to the creature.
Would that be the Cake way of model associations?
With kind regards,
Daniel S. Reichenbach
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