Zend Framework Models -
I am trying to understand how the Zand Framework works. Are there models designed to do something like this? I just have a basic setup, so I can use something like this in my controllers like this:
$ db-> query ($ -hy-> select all)
Can you also give me an example of how to use it on the controller?
expand the country of the country Zend_Db_Table {protected $ _name = 'country'; Select Public Function All () {Return 'SELECT * FROM'. $ This- & gt; _name ''; }}
Best regards!
Zend models are linked to a table that are desigend and will help you interact with a table .
class BugsProductsZend_Db_Table_Abstract {protected $ _name = 'bugs_products'; Protected $ _primary = array ('bug_id', 'product_id'); } $ Table = new bug product (); $ Rows = $ table- & gt; Fetch ALL ('bug_status = "NEW"', 'bug_id asc', 10, 0); $ Rows = $ table- & gt; Obtain ($ table-> Select) - & gt; Where ('bug_status =?', 'NEW') - & gt; Order ('bug_id ASC') - & gt; Range (10, 0)); // Getting a Single Line $ line = $ table- & amp;; FetchRow ('bug_status = "NEW"', 'bug_id ASC'); $ Row = $ table- & gt; FetchRow ($ table-> Selection () -> where ('bug_status =?', 'NEW') - & gt; Orders ('bug_id asc')); More information in
Comments
Post a Comment