Zend Join Models -


There are models of my table and want to join using a model in opposition to a table. For example, instead:

 select  $ = $ this-> Select () - & gt; From (Ar ('p' = & gt; 'Product'), Array ('product_id', 'Product_name')) - & gt; Join (array ('L' = & gt; 'line_itum'), 'P.product_id = l.product_id', - & gt; boundary (20, 10);  

Where I Want to include table names and columns, which I want to join, can not I use my model?

  $ select = $ this-> gt; select () -> (array ('p' = & gt; 'product'), array ('product_id', 'product_name')) -> join (array ('l' = & gt; Model_Table1 :: tableName ()), 'P.product_id = L.product_id', - & gt; Segment (20, 10);  

Why not, if I Your model has a stable variable with the name and is a stable task to return the variable:

  protected static $ table = 'dbname'; public static function (not filename) Self: $ table;}  

Is it worth it? Is it ever possible to rename the table?


Comments