Zendcasts Forum

A community of developers who work with the Zend Framework and other enterprise PHP technologies

You are not logged in.

#1 2010-02-13 05:19:36

akongz
New member
Registered: 2010-02-13
Posts: 8

zc21: many-to-many-with-zend-form-and-zend-db-part-1

Hi John I'm little bit confused about syntax insert to database..

In previously video I saw that code insert to database at Class Services,

But in this tutorial that code insert to database at Form Class..

Thanks.

Offline

#2 2010-02-14 21:18:40

Jon Lebensold
Administrator
Registered: 2009-06-27
Posts: 279

Re: zc21: many-to-many-with-zend-form-and-zend-db-part-1

Hi Akongz,

the Service layer is just a different architectural approach, where the service class acts as a Façade.

Offline

#3 2010-02-15 09:02:55

akongz
New member
Registered: 2010-02-13
Posts: 8

Re: zc21: many-to-many-with-zend-form-and-zend-db-part-1

Jon Lebensold wrote:

Hi Akongz,

the Service layer is just a different architectural approach, where the service class acts as a Façade.

Oh I got it.

So if I'm using architectural Facade, I put code insert DB or update DB or anything else in Service Class and  my Form Class only construct the form.

It is right?

Anyway thanks for the response

Last edited by akongz (2010-02-15 09:03:17)

Offline

#4 2010-02-17 03:09:55

Jon Lebensold
Administrator
Registered: 2009-06-27
Posts: 279

Re: zc21: many-to-many-with-zend-form-and-zend-db-part-1

that's the general idea! Also, I would suggest taking a look at the Doctrine screencasts... Doctrine could save you a bunch of time.

Offline

#5 2010-05-05 11:56:51

jujubee
New member
Registered: 2010-05-05
Posts: 1

Re: zc21: many-to-many-with-zend-form-and-zend-db-part-1

Jon, I just watched your vids on 1-many and many-many and I do have some questions.  Let me start by saying I am not a prof. developer.  I just play around with php/mysql/ and am new to zf.

1)  I noticed you created a UserService in Libarary/App and it seems to me that is really what is referred to as a Model?  Why not in the Model dir?

2)  I have a project I am working on (School Management System) and currently it uses MyISAM db .  Should I use innodb?  I really don't know much about transactions and my relationships are all dealt with in the code rather than the db.  Watching you vids I see you can put the constraints in the db itself... Cool.

Anyway, thanks for the vids.  Very nice.  I also like that you did not edit out the "Ooops's" as it shows what to do when errors arise, and they always do...

Offline

#6 2010-06-07 22:08:02

SocialEvil
New member
Registered: 2010-05-26
Posts: 6

Re: zc21: many-to-many-with-zend-form-and-zend-db-part-1

Hi,
I have one question. If i have a $value = "some string".
How can i fetch all the records from BOTH tables. If i have
"select * from table1, table2 where table1.title like %$value% AND table2.subtitle like %$value%"

Offline

#7 2010-06-15 00:39:38

Jon Lebensold
Administrator
Registered: 2009-06-27
Posts: 279

Re: zc21: many-to-many-with-zend-form-and-zend-db-part-1

Hi SocialEvil,
please accept my apologies for the late response.

in such a situation, where the tables are disjoint, you would make two separate queries.

Offline

Board footer

Powered by FluxBB