Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3667270
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:58:48+00:00 2026-05-19T01:58:48+00:00

I am creating an application in zend framework. Now i am stuck in the

  • 0

I am creating an application in zend framework. Now i am stuck in the Zend table relationships.

I have 2 tables. I have set the primary key and the corresponding references in other tables.
Now i want to join the two tables using the relationships (not with the join functions). Is it possible in zend?

the tables structures are like the one below

Schemetable

scheme_id primary key

Scheme_name

Scheme_Desc

Ratestable

rate_id

Scheme_id *foreign key ref scheme_id*

rates:

Time periods:

There is an one to many relation b/w the scheme and rates

I have done some coding in the model classes

Scheme.php

class Scheme extends Zend_Db_Table_Abstract {


 protected $_name = 'schemetable';

 protected $_dependentTables = array('rates');
}

Rates.php

class Rates extends Zend_Db_Table_Abstract {


 protected $_name = 'ratetable';

 protected $_referenceMap = array(
   'Scheme' => array(
   'columns' => array('scheme_id'),  
   'refColumns' => array('scheme_id'), 
   'refTableClass' => 'Scheme',  
  ),
 );
}

How can i fetch every scheme and their corresponding rates?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:58:49+00:00Added an answer on May 19, 2026 at 1:58 am

    Please,
    see the DOCS:

    http://framework.zend.com/manual/en/zend.db.table.relationships.html

    Fetching a Dependent Rowset

    If you have a Row object as the result
    of a query on a parent table, you can
    fetch rows from dependent tables that
    reference the current row. Use the
    method:

    $row->findDependentRowset($table);
    

    Example #4 Fetching Dependent Rowsets
    using the Magic Method

    This example shows finding dependent
    Rowsets equivalent to those in the
    previous examples. In this case, the
    application uses the magic method
    invocation instead of specifying the
    table and rule as strings.

      $accountsTable = new Accounts();
      $accountsRowset = $accountsTable->find(1234);
      $user1234 = $accountsRowset->current();
    
      // Use the default reference rule
      $bugsReportedBy = $user1234->findBugs();
    
      // Specify the reference rule
      $bugsAssignedTo = $user1234->findBugsByEngineer();
    

    Fetching a parent row

    If you have a Row object as the result
    of a query on a dependent table, you
    can fetch the row in the parent to
    which the dependent row refers. Use
    the method:

    $row->findParentRow($table);
    

    This example shows finding parent Rows
    equivalent to those in the previous
    examples. In this case, the
    application uses the magic method
    invocation instead of specifying the
    table and rule as strings.

      $bugsTable = new Bugs();
      $bugsRowset = $bugsTable->fetchAll(array('bug_status = ?', 'NEW'));
      $bug1 = $bugsRowset->current();
    
      // Use the default reference rule
      $reporter = $bug1->findParentAccounts();
    
      // Specify the reference rule
      $engineer = $bug1->findParentAccountsByEngineer();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to learn how to set up a Zend framework web application from
I am creating an application in which I have two mxml components, MainPanel.mxml and
When creating a web application, and lets say you have a User object denoting
In Zend Framework 1.8, using Zend_Tool, the framework now generates controllers, actions, etc. automatically.
I am integrating Zend Framework into an existing application. I want to switch the
I've started reading on zend framework and it's use with Doctrine and have implemented
I'm creating an application which lets you define events with a time frame. I
I'm creating an application that will store a hierarchical collection of items in an
I'm currently creating an application for a customer that will allow them to automatically
I am creating an application in java which will be the part of an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.