Re: Models, find/findAll and object programming

2006-09-01 Thread [EMAIL PROTECTED]
hmm the data arrays are just "formats" to exchange information between controllers, functions etc. you could refactor this to be object-style, but imo this doesnt have much to do with OOprogramming. cause the "real" objects in OOP are fixed entities (like the models that we use in cake), in real

Re: Models, find/findAll and object programming

2006-09-01 Thread Tony
Thanks all ;) I know of limitations of OO in PHP4. I "prefer" version 5 ... if I'm able to choose not to use it :D Bret writes : "to override the core of cakePHP's behavior and write code that takes cake's array format and converts it to objects" That's what I have done (adding some findOO meth

Re: Models, find/findAll and object programming

2006-08-31 Thread Bret Kuhns
[EMAIL PROTECTED] wrote: > So, yes [PHP4] does support OO programming. It just doesn't do it well and > in the truest since of the term. Neither does PHP5... something like Java is a "true" OO language, PHP5 is still mostly procedural augmented with OO functionality. But like Chris said... that

Re: Models, find/findAll and object programming

2006-08-31 Thread Chris Hartjes
Okay, you win. But I don't think it really helps Tony fix the problem that started this thread. It's not a PHP 4 vs. PHP 5 issue, no matter how many words you devote to telling me that PHP 5 is true objected-oriented programming. It's a style issue, and if Tony needs to mix functional programm

Re: Models, find/findAll and object programming

2006-08-31 Thread [EMAIL PROTECTED]
Not TRUE object oriented programming. That is the whole revelation of PHP5 and why most frameworks aren't available to PHP4. Sure it has it by being VERY careful in what you are doing. But it still is cumbersome, prone to errors, and slow as compared to PHP5. Which again, is why most framework

Re: Models, find/findAll and object programming

2006-08-31 Thread Chris Hartjes
Hold on there, cowboy. PHP 4 does support object-oriented programming. On 8/31/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Plus CakePHP works with PHP4 which doesn't support OO programming. So, > that limitation means that to keep CakePHP working for PHP4 and PHP5 > they would need to

Re: Models, find/findAll and object programming

2006-08-31 Thread [EMAIL PROTECTED]
Plus CakePHP works with PHP4 which doesn't support OO programming. So, that limitation means that to keep CakePHP working for PHP4 and PHP5 they would need to write a whole PHP engine to handle the differences at the PHP level and bring the true OO when PHP5 is used instead of 4. --~--~

Re: Models, find/findAll and object programming

2006-08-31 Thread Bret Kuhns
Tony, I agree, the retuning of arrays doesn't support good object-oriented practices. But arrays are extremely flexible and easy to work with in PHP, so that's probably why the developers chose to use them in CakePHP. Version 2 of Cake, however, is supposively going to completely change the way m

Models, find/findAll and object programming

2006-08-31 Thread Tony
Hi there ! New to Cake, I discover the framework. I currently use Rails also. Is there a reason for find/findAll methods to return an array, rather than an object (instance of the model class) ? Is there other methods, not documented, returning object rather than array ? If returning an object