Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>class Users extends Zend_Db_Table_Abstract { protected $_name = 'users'; protected $_rowClass = 'User'; protected $_dependentTables = array ('UserMetadata', 'UserPassword'); ... class UserMetadata extends Zend_Db_Table_Abstract { protected $_name = 'user_metadata'; protected $_referenceMap = array ( 'Users'=&gt; array ( 'columns'=&gt;'user_id', 'refTableClass'=&gt;'Users', 'refColumns'=&gt;'id' ) ); ... class UserPassword extends Zend_Db_Table_Abstract { protected $_name = 'user_password'; protected $_referenceMap = array ( 'Users'=&gt; array ( 'columns'=&gt;'user_id', 'refTableClass'=&gt;'Users', 'refColumns'=&gt;'id' ) ); </code></pre> <p>Fetching data:</p> <pre><code>$id = //get your user id from somewhere $users = new Users(); $user = $users-&gt;fetchRow('id=?', $id); if ($user-&gt;authMethod == 0) { $metadata = $user-&gt;findDependentRowset('UserMetadata')-&gt;current(); } </code></pre> <p>or</p> <pre><code>$user = $users-&gt;fetchRow($users-&gt;select() -&gt;where('gender=?, 'M') -&gt;order('email ASC'); </code></pre> <p>... etc.</p> <p>Inserting data:</p> <pre><code>$newRow = $users-&gt;fetchNew(); $newRow-&gt;email = me@domain.com; $newRow-&gt;save(); </code></pre> <p>or</p> <pre><code>$users = new Users(); $data = array('email' =&gt; 'me@domain.com', 'firstname' =&gt; 'Me'); $users-&gt;insert($data); </code></pre> <p>Updating:</p> <pre><code>$user-&gt;email = 'me@domain.org'; $user-&gt;save(); </code></pre> <p>Deleting a row:</p> <pre><code>$user-&gt;delete(); </code></pre> <p>Using transaction:</p> <pre><code>$db-&gt;beginTransaction(); $db-&gt;commit(); $db-&gt;rollback(); </code></pre> <p>etc... it's all in the <a href="http://framework.zend.com/manual/en/" rel="noreferrer">ZF Manual</a>!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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