I want to adapt my folder structure to something similar:
app
└─── ...
bin
└─── ...
src
└───MyNamespace
├───Application
│ ├───Controller
│ │ └───UserController.php
│ ├───Entity
│ │ └───User
│ │ ├───User.php
│ │ └───UserFactory.php
vendor
└─── ...
web
└─── ...
my config.yml file in the orm section looks like:
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: false
mappings:
user:
type: php
dir: %kernel.root_dir%/../src/MyNamespace/Application/Entity/User/User
prefix: MyNamespace\Application\Entity\User\User
alias: User
is_bundle: false
and my User.php file starts with:
namespace MyNamespace\Application\Entity\User;
use Doctrine\ORM\Mapping as ORM;
/**
* User
*
* @ORM\Table()
* @ORM\Entity
*/
class User
{
...
}
And then I get the:
InvalidArgumentException: Specified non-existing directory "C:/www/myapp/app/../src/MyNamespace/Application/Entity/User/User" as Doctrine mapping source.
Btw, I'm using the Symfony2 framework.