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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:50:17+00:00 2026-05-26T20:50:17+00:00

i use two classes: namespace Test; use Doctrine\ORM\Mapping as ORM; /** *@Table() *@InheritanceType(Joined) *@DiscriminatorMap({baseclass=BaseClass,

  • 0

i use two classes:

namespace Test;
use Doctrine\ORM\Mapping as ORM;

/**
 *@Table()
 *@InheritanceType("Joined")
 *@DiscriminatorMap({"baseclass"="BaseClass", "subclass"="SubClass"}
 *@Entity
*/
class BaseClass{

     /**
      *@Column(name="id", type="integer")
      *@Id
      *@GeneratedValue(strategy="IDENTITY")
     */
     private $id;
}


namespace Test;
use Doctrine\ORM\Mapping as ORM;

/**
 *@Table()
 *@Entity
 */
class SubClass extends BaseClass{

     /**
      * @Column(name="v", type="string", nullable="false")
      */
      private $v;
}

I am not able to persist a SubClassObject. I receive the following errorMessage:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'dtype' in 'field list'

I am new to Doctrine and ORM so I need some help here.

Edit: After using the cli orm:create-schema:tool the baseclass has a dtype-field. Is it possible to create the entity without that field and what does this field stand for?

  • 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-26T20:50:18+00:00Added an answer on May 26, 2026 at 8:50 pm

    The dtype-field is the default @DiscriminatorColumn. You can change the column name as follows:

    @InheritanceType("Joined")
    @DiscriminatorColumn(name="[CHANGE]", type="string")
    @DiscriminatorMap({"baseclass"="BaseClass", "subclass"="SubClass"}
    

    In an inheritance hierarchy it is not possible to skip this field. This field maps the type to the appropriate class. In your example: Type subclass refers to the SubClass class.

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

Sidebar

Related Questions

If I have namespace with two classes. I want to use class from one
I have two classes; Area and LanguageArea . I use LanguageArea to handle translated
Can I use two different back ends for an .net Entity Framework project? I
I have two same project in which I have two classes under same namespace
I use two Spinner in my App. One of them is initially disabled because
Can you use two regex in preg_replace to match and replace items in an
I want to use two meta:resourcekey in single control is it possible? for example
Referenced here and here ...Why would I use two's complement over an epsilon method?
I am developing a Java webservice application (with JAX-WS) that has to use two
When we want to modify some value in one object we may use two

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.