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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:52:51+00:00 2026-05-16T08:52:51+00:00

Following situation: Parent: namespace Base; /** @Entity @Table(name=section) */ class Section extends Skeleton {

  • 0

Following situation:

Parent:

namespace Base;

/** @Entity @Table(name="section") */
class Section extends Skeleton {
/** 
 * @Id @Column(type="integer") 
 * @GeneratedValue(strategy="AUTO")
 */
protected $id;

/** @Column(length=256) */
protected $title;

/** @Column(length=256) */
protected $stylesheet;
}

Child:

namespace Base2;

use \Base\Section AS BaseSection;

/** @Entity @Table(name="tbl_section") */
class Section extends BaseSection {
/**
 * @Id @Column(type="integer")
 * @GeneratedValue(strategy="AUTO")
 */
protected $id;

/** @Column(length=256) */
protected $title;

/** @Column(length=256) */
protected $stylesheet;
}

When I try to retrieve an Section from the database it throws an error:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.id' 
in 'where clause' in /var/www/eage_new_zf/library/Doctrine/DBAL/Connection.php 
on line 567 Call Stack #TimeMemoryFunctionLocation 10.0004489704{main}( 
)../index.php:0 20.03193296632Zend_Controller_Front->dispatch( ???, ??? 
)../index.php:27 30.04574505172Zend_Controller_Dispatcher_Standard->dispatch( 
object(Zend_Controller_Request_Http)[39], object(Zend_Controller_Response_Http)[40] 
)../Front.php:954 Variables in local scope (#3) 

The query it tries to execute is:

SELECT 
    t1.id AS id2, 
    t1.title AS title3, 
    t1.stylesheet AS stylesheet4 
FROM 
    tbl_section t1 
WHERE 
    t0.id = ?

t0 is not defined so technically it is correct I get an error. But how to solve this? Is it a bug in Doctrine 2? Or am I doing something wrong.

  • 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-16T08:52:51+00:00Added an answer on May 16, 2026 at 8:52 am

    You can either use Single Table or Joined Table Inheritance. The difference is using either one table with nullable columns, or use many tables depending on the child classes. See the manual for mroe information:

    http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/inheritance-mapping.html

    In your case on the topmost/root class (Base\Section)

    /**
     * @Entity @Table(name="section")
     * @InheritanceType("SINGLE_TABLE")
     * @DiscriminatorColumn(name="discr", type="string")
     * @DiscriminatorMap({"base" = "Base\Section", "child" = "Base2\Section"})
     */
    

    Naming classes is a bad practice btw, you should name your classes with regard to what they are doing implementation wise. Even if it duplicates words already included in the namespace, i.e. Base\BaseSection and BAse2\Base2Section in your example.

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

Sidebar

Ask A Question

Stats

  • Questions 512k
  • Answers 512k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You are using method ToString() as Property change s[0].ToString ->… May 16, 2026 at 5:45 pm
  • Editorial Team
    Editorial Team added an answer This is because javascript uses American formatting for dates, also… May 16, 2026 at 5:45 pm
  • Editorial Team
    Editorial Team added an answer It's as easy as: $('#UseUsername').change(function(){ if($(this).is(':checked')){ $('#div').show(); } else {… May 16, 2026 at 5:45 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have the following situation in my python code: class Parent(object): def run(self): print
I have the following situation, presented in the picture. Grey div is the parent
How would I setup my controls for the following situation?: I have a parent-container
I've the following situation: module type M = sig type s = ... end
I have the following situation (pseudocode): function f: pid = fork() if pid ==
I have the following situation. Im getting data from an external system in the
I've recently come across the following situation. I have a UserControl that can show
I have the following situation: I have a few hundred resources at my disposal
I've got the following situation, Private Sub MyButton_Click(sender as Object, args as EventArgs) Handles
I have the following situation (caused by a defect in the code): There's a

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.