doctrine - Entity alias in new symfony 2.7 directory structure -


after adapting new recommended structure in symfony 2.7 i'm not able access entity alias through $em->getrepository('bundle:entity').

this directory structure:

mybundle     - component         - catalog             - model                 product.php 

and mapping definitition in config.yml:

mappings:     mybundle:         type:      annotation         dir:       %kernel.root_dir%/../src/mybundle/component/product/model         prefix:    mybundle\component\product\model         alias:     ??? # tried different things 

what should write in $em->getrepository('mybundle:product') instead of mybundle:product succesfully accesing entity?

if possible use default symfony alias, don't need specify alias every entity in config.yml

actually didn't need generate:bundle it's not real bundle namespace , logical organization of files.

the solution specify complete namespace in getrespository():

$em->getrepository('mybundle\\component\\product\\model\\cfgproduct) 

thanks


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -