Is the problem that you are expecting an active record object?

To my understanding:

Cake Models are more akin to static classes (any may oneday be
implemented that way).

Active record style features are achieved by first calling read() on
the model with the id param, which loads the specified record into
Model->data.

Then call  your instance method, which can change the fields in data,
and then call the save() function inside the instance method to change
the active record.

If you really want an active record object you'll have to create it
yourself or use another framework, but there are good reasons for this
approach - remember objects aren't 'free' in PHP (as I believe they
are in RoR, as everything's an object?).



On Jun 11, 5:00 pm, sancho21 <[EMAIL PROTECTED]> wrote:
> I'm Ruby on Rails user trying to learn CakePHP. I see many great
> features in CakePHP like how it handles relationship problems. But, I
> could not find how it handles model instance's methods. Like
>
> $medicine = new Medicine();
> $medicine->getPrice(date());
>
> or
>
> $doctor = new Doctor();
> $doctor->sign($prescription);
>
> It seems that CakePHP is working only on associated arrays. So.....
> how to solve the problem. I think this problem is common things in
> object oriented language. Or ... may be somebody want to suggest me
> other framework of PHP?
>
> Thank you so much
--~--~---------~--~----~------------~-------~--~----~
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