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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:56:26+00:00 2026-05-25T16:56:26+00:00

I get number of problems trying to implement CTI First of all I use

  • 0

I get number of problems trying to implement CTI

First of all I use a custom loader for my entity classes

class My_AutoLoader implements Zend_Loader_Autoloader_Interface
{

    public function autoload($class)
    {
        $class = trim(str_replace('\\', '/', $class), '/');
        if (@include(APPLICATION_PATH . '/Entities/' . $class . '.php')) {
            return $class;
        } else {
            throw new Zend_Loader_Exception('Cannot load ' . $class . '.');
        }
    }

}

The idea is to use application\Entities for classes that have no namespace
like $user = new Users();

Then I have defined class inheritance

Profiles:
  type: entity
  table: profiles
  repositoryClass: Repositories\Base
  inheritanceType: JOINED
  discriminatorColumn:
    name: profiletype
    type: integer
    length: 11
  discriminatorMap:
    1: Personal
    2: Work
    3: Business
  id:
    id:
      type: integer
      generator:
        strategy: AUTO
  fields:
    firstname:
      type: string
      length: 255
      fixed: false
      nullable: true
    ...


Work:
  type: entity
  table: work
  repositoryClass: Repositories\Base
  fields:
    position:
      type: string
      length: 255
      fixed: false
      nullable: true

then I have manually created the class Work to extend Profiles

class Work extends Profiles
{
}

The first problem begun with 2.0.0 (2.0.1), when I use console tool’s generate-entities I get the error that I don’t have id’s for the Work class, it is odd because IMHO it contradicts with the idea that Work extends Profiles and id is already defined.

However I tried to add a column id for the Work class, but then I get a message that I already have a column id. DOH!

I tried to add some other column name for PK but I actually get an extra column that is unnecessary because the proper inherited column id is also created. In CTI i should have a single FK column and there are no other PK’s with auto-generated values.

So I did the bad thing to hack the doctrine classes and remove the checks for missing id’s. Ugly but it worked. The entities start to generate properly and the db structure is just fine.

I later found that all that strange behavior is due to a bug in doctrine 2 and it is fixed in 2.0.5.

Well, I tried 2.0.5 and had exactly the same problem, so I thought the mistake is in my code.

I filed a bug in doctrine’s jira and I got answered that my definitions are wrong and I need id’s for subclasses (and got referred to the documentation that all we know is quite poor, especially for YAML mapping). I gave up and sticked with my hack.

Later I tried with 2.0.6 and 2.1 but with those versions my entities are no longer updated but each time i use generate-entities the new class definitions are being append to the end so there are duplicates.

My question is:

Is this a problem with doctrine or I am doing it wrong?

If it is in me what is the proper way of mapping CI

  • 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-25T16:56:26+00:00Added an answer on May 25, 2026 at 4:56 pm

    Taken from your question:

    Update:
    I found that the problem is actually a bug in Doctrine which always prefix the namespace with “\” when updating entities and my custom autoloader loads only classes without namespace. In addition there is a bug with inheriting properties (ids)

    Both will be fixed in 2.1.1

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

Sidebar

Related Questions

I'm messing with core.time.Duration s - in particular, I'm trying to properly get number
Im trying to get random number between -5 and 5. Im using this code:
I'm trying to implement a iGoogle like dashboard interface using widgets that get their
I'm trying to get Rails to capitalize the first character of a string, and
As a learning exercise, I'm trying to implement a class which will emulate the
I am trying to get this result: <li class=beatle_1>Paul</li> <li class=beatle_2>John</li> <li class=beatle_3>George</li> <li
I am trying to define an interface and classes which implement the interface as
trying to use a concurrent skip list map. i had problems with how to
I cannot get my code to work! I am trying to implement the quick
I am trying to implement the following convenience method: /** * Counts the number

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.