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 627283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:30:41+00:00 2026-05-13T19:30:41+00:00

I want to extend Zend_Db_Table_Row_Abstract to have some additional fields besides those from table.

  • 0

I want to extend Zend_Db_Table_Row_Abstract to have some additional fields besides those from table.

Example.

I have

class Automobili_Model_Car extends Zend_Db_Table_Abstract { 
        protected $_name = 'car'; 
        protected $_rowClass = 'Automobili_Model_Row_Car'; 
} 

and

class Automobili_Model_Row_Car extends Zend_Db_Table_Row_Abstract { 
} 

Car table have model_id, which refers to model table (corsa, clio…), I want Automobili_Model_Row_Car to have model loaded from dependent table model, not just model_id from car table.

What is the right weay to do it?

Regards,
Sasa Stamenkovic.

  • 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-13T19:30:41+00:00Added an answer on May 13, 2026 at 7:30 pm

    You have a few options:

    You have the findDependentRowset() and findParentRow() methods mentioned before. For those I would say read the documentation: http://framework.zend.com/manual/en/zend.db.table.relationships.html. I’ve never really gotten the hang of this method so I won’t say too much about it.

    Another option is Zend_Db_Table_Row_Abstract has an init() function that you can override. You can load the other row from there and every time a Car object is created, it will load the model. This can be expensive though as for every object you have another query to your database. If you load 50 rows in one query you have 50 more queries that will executed when the Car object is created.

    Another option is to add a getModel() function to the Car class. This function will lazy load the Model class when requested.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this table class: class Songs extends Zend_Db_Table_Abstract { protected $_name = 'songs';
In following code, I want to extend the behaviour of a class by deriving/subclassing
I have a class that extends Zend_Db_Table lets call it 'Users' that uses the
I have an abstract class defined as follows: abstract class Abstract Parent extends Zend_Db_Table_Abstract
I want to extend a base class in apache commons email, the base class
If all tables I want to delete from have the column gamer_id can i
I have a NewsModel which extends Zend_Db_Table_Abstract. the news-table consists of: newsid, title, text
Hello I need help with displaying data from 2 table. So i Have 2
I want to extend a WPF application with database functionality. Which database engine would
I want to extend the basic ControlCollection in VB.NET so I can just add

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.