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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:09:10+00:00 2026-06-12T18:09:10+00:00

Is it possible to override values from Model->fetchAll() so it work globally. I have

  • 0

Is it possible to override values from Model->fetchAll() so it work globally. I have tried to override this in model, but does not work:

class Application_Model_DbTable_OdbcPush extends Zend_Db_Table_Abstract
{

    public function __get(string $col)
    {
        $res = parent::__get($col);
        if ($col == "lastrun") {
            $res = ($res == "1912-12-12 00:00:00+07" ? NULL : $res);
        }
        return $res;
    }
    //...
}

In a controller:

    $odbcModel = new Application_Model_DbTable_OdbcPush();
    $rs = $odbcModel->fetchAll( $select );

I want to override value returned from fetchAll(), find() etc when col name is “lastrun”;

  • 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-06-12T18:09:11+00:00Added an answer on June 12, 2026 at 6:09 pm

    Found the answer, for community i share here 😀
    http://framework.zend.com/manual/1.12/en/zend.db.table.row.html

    So we have to overload Zend_Db_Table_Row and assign it to model/dbtable:

    class Application_Model_DbTable_Row_OdbcPush  extends  Zend_Db_Table_Row_Abstract
    {
    
         // do some override here
    
    }
    
    
    class Application_Model_DbTable_OdbcPush extends Zend_Db_Table_Abstract
    {
    
        protected    $_name = 'odbcpush';
        protected    $_primary = 'id';
        private      $_global = null;
        protected    $_rowClass = "Application_Model_DbTable_Row_OdbcPush";
    
        // etc
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some console.log commands spread through my site. Is it possible to override
Possible Duplicate: Java: Always override equals? should I override equals function for any class
If possible, how can I override a min-height property of a class for a
I have a blog-like application with stories and categories: class Category(models.Model): ... class Story(models.Model):
Given this code, how do I get the values from the checkbox- and textpreference
I have a ViewModel. something like this public class ViewModel { public int Id
In a current project, I have a model called Box that stores items from
Hi I have a question. Wondering how do I get certain values from the
Is it possible to override the GetHashCode method for a string, int, int32 etc..
Is it possible to override reflection functionality ?

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.