Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you work with a relational database in Zend Framework?
    primarykey
    data
    text
    <p>I'm using the zend framework to write an app and I'm having lots of problems getting my relational database models to work. I've read the quickstart and the docs several times and I'm still not sure how to do this. I post a picture of the relationships between the different tables involved to avoid having to explain everything since English is not my first language and I tend not to make myself clear when I try to explain...well complex things. <img src="https://i.stack.imgur.com/YqQul.png" alt="enter image description here"></p> <p>The tables press_releases, social_networking, blog_posts, rss_feed, directorios, users and articulos are all set as foreign keys in the table named planilla_users. I coded my table models the way the quickstart shows:</p> <pre><code>class Application_Model_DbTable_PlanillaUsers extends Zend_Db_Table_Abstract { protected $_name = 'planilla_users'; protected $_referenceMap = array( 'User' =&gt; array( 'columns' =&gt; 'users_id', 'refTableClass' =&gt; 'Application_Model_DbTable_Users', 'refColumns' =&gt; 'id' ), 'Articulo' =&gt; array( 'columns' =&gt; 'art_id', 'refTableClass' =&gt; 'Application_Model_DbTable_Articulos', 'refColumns' =&gt; 'id' ),...etc </code></pre> <p>...and the rest following the format of:</p> <pre><code>class Application_Model_DbTable_Users extends Zend_Db_Table_Abstract { protected $_name = 'users'; protected $_dependentTables = array('Application_Model_DbTable_PlanillaUsers'); </code></pre> <p>I also have a model Planilla.php with all the setters and getters for the information to be stored/updated/retrieved/deleted,...however...I'm completely blank on what to do with the mapper. I don't know how it's supposed to work and I honestly haven't found a good example on how to do something like this yet. So any help would be mostly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload