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

  • SEARCH
  • Home
  • 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 798703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:00:51+00:00 2026-05-14T23:00:51+00:00

I have a model which is referenced to a table registries extending Zend_Db and

  • 0

I have a model which is referenced to a table registries extending Zend_Db and some methods which bascially uses fetchAll() all the time.

What happens is: my table has a DATE field and I’d like it to output already formated when I call $row->reg_date. Is it possible by doing something in the model or do I have to manually format?

  • 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-14T23:00:51+00:00Added an answer on May 14, 2026 at 11:00 pm

    You’ve got a couple of options:

    • Overwrite Zend_Db_Table_Row_Abstract::__get() in your table when asking for the reg_date
    • Format it in the view with your own view helper, something like <?= $this->formatDate($this->row->reg_date, 'fancy'); ?>

    Doctrine probably has the answer you would like, the following is cut from http://www.doctrine-project.org/documentation/manual/1_2/en/introduction-to-models#generating-models:

    class User extends BaseUser
    {
        public function setPassword($password)
        {
            return $this->_set('password', md5($password));
        }
    }
    
    $user = new User();
    $user->username = 'jwage';
    $user->password = 'changeme';
    
    echo $user->password; // outputs md5 hash and not changeme
    

    If I were you, I’d go with the view helper-option. You could add custom CSS there and have it all ready to go. If you’d need it changed, you’d change it in one place and your application’s renewed.

    Besides, if you ever wanted to do something with the date (compare it to another date, get just the month, localize it, etc.) you want a clean starting point which is what you’d store in the database (i.e. 2010-05-16 or 2010-05-16 16:55:00). Therefore: view settings belongs in the view.

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

Sidebar

Related Questions

I have a basic model in which i have specified some of the fields
I have a django application which has one main table/model which references various 'lookup'
Lets suppose I have a scenario with the following model: An Animal table which
In Rails, I have a model named Director which references a table with a
I have model Foo which has field bar. The bar field should be unique,
I have a model which gets its data from a parser object. I'm thinking
I'm using ASP.NET MVC and have a model which has an image (byte array)
I have a model Foo which have a ForeignKey to the User model. Later,
I have a model Task which will HABTM many TaskTargets. When it comes to
I have an Entry model which has many Tag s. Tag s are added

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.