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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:55:41+00:00 2026-06-08T20:55:41+00:00

when doctrine builds model files for a table, it generates three files, essentially BaseModel.class.php

  • 0

when doctrine builds model files for a table, it generates three files, essentially BaseModel.class.php, Model.class.php and ModelTable.class.php. Common knowledge requires that any modifications be done to Model.class.php or ModelTable.class.php vs BaseModel.class.php.

But when do you choose between either Model.class.php vs ModelTable.class.php. From what I gather is that Model.class.php is for a single instance and ModelTable.class.php is for multiple instances.

Can anyone shed any light here?

  • 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-08T20:55:44+00:00Added an answer on June 8, 2026 at 8:55 pm

    it’s so simple!

    suppose you have a Model Called Article. you will have three classes called BaseArticle.class.php and Article.class.php and ArticleTable.class.php

    here is the definition for each class:

    BaseArticle.class.php : this class has your model definition(or your table definition). you don’t want to edit this class Ever!

    Article.class.php : is a place for your override methods that you can write for your models. you only have access to these functions when you have an instance of Article Class.
    so you can call them only by an object. for example:

    class Album extends BaseArticle {
    
        public function getSummary(){
             ....
        }
    
    }
    

    for using it you should do this:

    $article=new Article();
    $article->getSummary();
    

    ArticleTable.class.php : and this is where you want to write your functions that are for your whole Article talbe(or it’s better to say for your whole Article model).
    for examlpe you want to find most popular articles, you can’t write this function to your Article Class because it works only on an object. but you want to do this on your whole Table. so:

    class AlbumTable extends Doctrine_Table {
        public static function getPopularArticles() {
        }
    }
    

    and you have to use it like this if your functions are static:

    ArticleTable::getPopularArticles();
    

    and if your functions are not static you can call them using:

    Doctrine_Core::getTable('Product')->your_nonstatic_function();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Doctrine 1.2 has a method called generateModelFromDb, documented here , that generates model files
I'm trying to doctrine:generate-migrations-diff, symfony it seems to be ignored files in dirs lib\model\doctirne\PLUGINNAME
I am having troubles generating a simple database form model. I am using: Doctrine
I'm using PHP with the Symfony framework (with Doctrine as my ORM) to build
I'm using the PHP Doctrine ORM to build my queries. However, I can't quite
Having this Entity for example: <?php namespace Gitek\HotelBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** *
What's the problem here? generator: class: sfDoctrineGenerator param: model_class: Builds theme: admin non_verbose_templates: true
I have a database with a table named order . When i run php
how to resolve this symfony error : C:\inetpub\wwwroot\project\trunk\preprod\signup>php symfony doctrine:build-schema --trace >> doctrine generating
I'm using Zend Framework and doctrine 1.2.x Is there a way to define index-table

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.