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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:34:35+00:00 2026-05-16T17:34:35+00:00

I am working through the doctrine 2 (Beta3) sandbox and trying to apply the

  • 0

I am working through the doctrine 2 (Beta3) sandbox and trying to apply the Zend Framework coding convention of placing a leading underscore to private class members. When I query Address, while its private members are NOT underscored, i retrieve the object as expected. When I add the underscores, regenerate and repopulate the db, and then run the same query I get the following error messages:

PHP Notice: Undefined index: id in … Doctrine/ORM/Internal/Hydration/AbstractHydrator.php on line 184

PHP Fatal error: Uncaught exception ‘Doctrine\DBAL\DBALException’ with message ‘Unknown column type requested.’ in … Doctrine/DBAL/DBALException.php:81

The DQL query:

$q = $em->createQuery('select u from Entities\Address u where u.id = ?1');
$q->setParameter(1, '1');
$address = $q->getSingleResult();

The ZFed Address class:

<?php

namespace Entities;

/** @Entity @Table(name="addresses") */
class Address
{
    /**
     * @Id @Column(type="integer", length=11, name="id")
     * @GeneratedValue(strategy="AUTO")
     */
    private $_id;
    
    /** @Column(type="string", length=255, name="street") */
    private $_street;

    public function getId()
    {
        return $this->_id;
    }

    public function getStreet()
    {
        return $this->_street;
    }

    public function setStreet($street)
    {
        $this->_street = $street;
    }

}
  • 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-16T17:34:37+00:00Added an answer on May 16, 2026 at 5:34 pm

    You would have to write _ in front of all your DQL Queries yes.

    Underscores in front of variables are some kind hungarian notation, which we as Doctrine team don’t like. Even Zend Framework will drop that style for new code as far as i understood. Many other projects did the same and PEAR2 even changed their standard in this regard.

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

Sidebar

Related Questions

I am working through a Zend framework book and is stuck for days on
Working through a zend tutorial & get this message, & not sure where to
Working through C++ Primer Plus and am trying to cin data to a dynamically
After working through the Django tutorial I'm now trying to build a very simple
I'm working through R Murphy's JQuery Fundamentals and am trying to make sense of
Working through this step by step guide. I am trying to create the inheritance
Working through the NerdDinner Tutorial , I'm trying to figure out a good way
I'm working through previous years ACM Programming Competition problems trying to get better at
Still working through JQuery to get data and repopulate portions of a page. Right
In working through the issues with another question, I've found text files with embedded

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.