Hi again
This is all interesting. So basically you mean that there can not be
no such a term in MVC for PHP, like there is for ROR? I am curious
what you think about Propel as a tool to 'emulate' models in php mvc?
Though I would still agree that this is again just an ORM and not more
than that.

To be honest, I do not use any of these ORM things. I am still making
SQL queries myself or with some visual software.

I created my own 'model controller' with the methods like insert,
delete, etc. which actually just creating queries which are being sent
later to ADODB php library. so from this 'model controller' I inherit
all my models.

Otherwise, I think there will be too much mass in my code.

I am curious what others do with the missing Model Controller?? ;)

Cheers,
Mikhail


On 9/27/06, Victor Bolshov <[EMAIL PROTECTED]> wrote:
Michael Yevdokimov wrote:
> Hello Victor,
>
> Could you please explain what the Model should be or how it should be
> presented in ZF in your opinion?
> Example is simple: I would like to use the model the same way as I do it
> in Rails, i.e. putting all the database manipulations and data
> validation into it.
>
> Thank you very much in advance.
>

One cannot simply port Rails-ActiveRecord to PHP (there are certain
features used that are not yet implemented in PHP, possibly will be in
PHP6).

In *my* opinion, a model, indeed, should look like that of Rails. In
LIMB-project ( http://limb-project.com ) they've recently have made a
step towards making their model much like Rails' one. You may also take
look at php-doctrine.

But the *original* question was about "a model in MVC". To me, it looks
like a senseless set of words. In MVC you are free to use any kind of
model. Zend_Db_* does *NOT* provide you with an ActiveRecord, nor does
it provide a means for validation and object-relational mapping. It is
*just* what it is: a DBAL, a query-object, a Table-gateway and a
Row-gateway. You may use it your application, and your application is
free to acquire MVC architecture or some other architecture as well.

Although there is sometimes a need for an advanced ORM in an
application, the means provided by Zend_Db_*, should, as I believe,
satisfy developer in 80-90% of cases. And, there is a strong doubt that
a large-and-heavy ORM tool could really solve all the problems regarding
application-RDBMS relation.

Regards,

Victor.

PS. The question you have asked (if before we refer to the original
question), should not be "what the Model should be or how it should be
presented in *ZF* in your opinion?" - but instead "what the Model should
be or how it should be presented in *MVC* in your opinion?". I cannot
answer this question, and think nobody can.




--
Michael Yevdokimov
E-mail: [EMAIL PROTECTED]
Tel. +31 (0) 61 4599307

Reply via email to