Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orm.em.options / mappings (type = annotations) / namespace cannot be empty #8

Open
quazardous opened this issue Apr 9, 2013 · 9 comments

Comments

@quazardous
Copy link

In the ORM doc :
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html
You can have entity class without namespace.

but an error occurs if you let namespace option empty for annotations mapping.

@simensen
Copy link
Member

@quazardous Can you point to specific part of those docs that describe what you are saying? I'd be happy to look into this but most of the stuff I've looked at RE: annotations have still required a namespace.

Also, if you can share your specific use case that would be helpful.

I apologize for the delay on this.

@quazardous
Copy link
Author

First example in ORM doctrine doc:

// src/Product.php
/**
 * @Entity @Table(name="products")
 **/
class Product
{
  /** @Id @Column(type="integer") @GeneratedValue **/
  protected $id;
  /** @Column(type="string") **/
  protected $name;

  // .. (other code)
}

There is no namespace.

I tried something like that to learn:

"mappings" => array(
        // Using actual filesystem paths
        array(
            "type" => "annotation",
            "namespace" => "",
            "path" => __DIR__."/src",
        ),
....

But i got an error.

This is not very important in real case ;p

@simensen
Copy link
Member

OK. :) Mind if I close this issue then?

@quazardous
Copy link
Author

man it's your code ;p do as you pleaz ;p

@marcojanssen
Copy link
Contributor

Who doesn't use namespaces? :P

@dominikzogg
Copy link
Contributor

try "namespace" => "\"

@dominikzogg
Copy link
Contributor

@marcojanssen +1

@simensen
Copy link
Member

I believe the feedback I got from one of the Doctrine team people (can't remember who answered me anymore) was that it had to do with the chain driver requiring a namespace.

@dominikzogg Have you tested it with "namespace" => "\\"? If that actually works that can be the official suggestion and we can close this.

@dominikzogg
Copy link
Contributor

@simensen nah, it was only a suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants