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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:45:12+00:00 2026-05-30T07:45:12+00:00

I am studying namespace in php and Doctrine 2.2 for a week. I explorered

  • 0

I am studying namespace in php and Doctrine 2.2 for a week.

I explorered several blogs and read several articles about namespace in php.

I understand that, when we want to use different namepaces in different php pages, we must write: include('php page that belong namespace we want to use');

But Doctrine 2.2 doesn’t use any include or require or require_once statements for using namespace. Almost all script in Doctrine 2.2 like that :

Doctrine\ORM\EntityManager.php

<?php
namespace Doctrine\ORM;

use Closure, Exception,
    Doctrine\Common\EventManager,
    Doctrine\Common\Persistence\ObjectManager,
    Doctrine\DBAL\Connection,
    Doctrine\DBAL\LockMode,
    Doctrine\ORM\Mapping\ClassMetadata,
    Doctrine\ORM\Mapping\ClassMetadataFactory,
    Doctrine\ORM\Query\ResultSetMapping,
    Doctrine\ORM\Proxy\ProxyFactory,
    Doctrine\ORM\Query\FilterCollection;
class EntityManager implements ObjectManager
{
    /**
     * The used Configuration.
     *
     * @var \Doctrine\ORM\Configuration
    .............
    ..................................
    ..................................
    ..................................
    ..................................
?>

There isn’t any include or require statement in Doctrine 2.2.

But we run the page (Doctrine\ORM\EntityManager.php) appear fatal error,

Fatal error: Interface ‘Doctrine\Common\Persistence\ObjectManager’ not found
in C:\xampp\htdocs\www\DoctrineExplained\DoctrineORM\Doctrine\ORM\EntityManager.php on line 45

Although Doctrine 2.2 is stable version of Doctrine ORM, why doesn’t use include or require for namespaces and uses?

  • 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-30T07:45:14+00:00Added an answer on May 30, 2026 at 7:45 am

    Most PHP 5.3 code out there is like that. Doctrine expects autoload to be set-up before you start using it. You can define your own __autoload() function, use spl_register_autoload() or use one of the implementations bundled with many of the frameworks out there.

    This could be done for a long time too. It just took time before the conventions were adapted and namespaces pushed for that change.

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

Sidebar

Related Questions

Since I started studying object-oriented programming, I frequently read articles/blogs saying functions are better,
After studying TCP/UDP difference all week, I just can't decide which to use. I
I am studying business models and UML. I read that a 'Model' is a
I am new to studying jquery.ajax. I want to paste some data from a.php
I'm studying ObjC and iOS development. Every components that I use in my apps
Studying compilers course, I am left wondering why use registers at all. It is
While studying about JMX, I have seen one of the important feature of it
Sorry if this question was asked already. I started studying C# and noticed that
While studying the Collection API, we find that some methods ( add , remove
While studying C# in ASP.net I have trouble understanding several classes. In which scenario

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.