mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1467: Problem with @many to one entities and proxy #1842
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Nov 3, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user mickey_8:
Hi! i got that issue and i don't where it's came from...my config or doctrine?
Entities with @ManyToOne caused that error "e;Failed opening required 'C:\wamp\www\ayaou\application/../library/Custom/Entity/Proxy\CustomEntityRoleProxy.php' (include_path='C:\wamp\www\ayaou\application/../library;C:\wamp\www\ayaou\library;.;C:\php\pear') in C:\wamp\www\ayaou\library\Doctrine\ORM\Proxy\ProxyFactory.php on line 85 "e;
Here my application.ini :
[production]
;; ZF Resources
pluginPaths.Custom_Application_Resource = "Custom/Application/Resource"
;; ZF Application Config
appnamespace = "Application"
;; Autoloader
autoloaderNamespaces[] = Custom
autoloaderNamespaces[] = Custom_
autoloaderNamespaces[] = Doctrine
autoloaderNamespaces[] = ZendX
; ------------------------------------------------------------------------------
; Locale & Translate Configuration
; ------------------------------------------------------------------------------
resources.locale.default = "fr_FR"
resources.locale.force = true
;resources.session.save_path = APPLICATION_PATH "/../data/session"
resources.session.name = "ayaou_sid"
resources.session.use_cookies = true
resources.session.use_only_cookies = true
resources.session.cookie_httponly = true
;; Session expiration
resources.session.cache_expire = 5
resources.session.gc_maxlifetime = 1200
resources.session.remember_me_seconds = 864000
; ------------------------------------------------------------------------------
; Doctrine Cache Configuration
; ------------------------------------------------------------------------------
;; Points to default cache instance to be used. Optional is only one cache is defined
resources.doctrine.cache.defaultCacheInstance = default
;; Cache Instance configuration for "default" cache
;resources.doctrine.cache.instances.default.id = default
resources.doctrine.cache.instances.default.adapterClass = "Doctrine\Common\Cache\ArrayCache"
;resources.doctrine.cache.instances.default.namespace = "Application_"
;resources.doctrine.cache.instances.default.options.servers.0.host = localhost
;resources.doctrine.cache.instances.default.options.servers.0.port = 11211
;resources.doctrine.cache.instances.default.options.servers.0.persistent = true
;resources.doctrine.cache.instances.default.options.servers.0.weight = 1
;resources.doctrine.cache.instances.default.options.servers.0.timeout = 1
;resources.doctrine.cache.instances.default.options.servers.0.retryInterval = 15
;resources.doctrine.cache.instances.default.options.servers.0.status = true
; ------------------------------------------------------------------------------
; Doctrine DBAL Configuration
; ------------------------------------------------------------------------------
;; Points to default connection to be used. Optional if only one connection is defined
resources.doctrine.dbal.defaultConnection = default
;; DBAL Connection configuration for "default" connection
;resources.doctrine.dbal.connections.default.id = default
;resources.doctrine.dbal.connections.default.eventManagerClass = "Doctrine\Common\EventManager"
;resources.doctrine.dbal.connections.default.eventSubscribers[] = "DoctrineExtensions\Sluggable\SluggableSubscriber"
;resources.doctrine.dbal.connections.default.configurationClass = "Doctrine\DBAL\Configuration"
;resources.doctrine.dbal.connections.default.sqlLoggerClass = "Doctrine\DBAL\Logging\EchoSQLLogger"
;resources.doctrine.dbal.connections.default.types.zenddate = "DoctrineExtensions\Types\ZendDateType"
;; Database configuration
;resources.doctrine.dbal.connections.default.parameters.wrapperClass = ""
resources.doctrine.dbal.connections.default.parameters.driver = "pdo_mysql"
resources.doctrine.dbal.connections.default.parameters.dbname = "ayaou_db"
resources.doctrine.dbal.connections.default.parameters.host = "localhost"
resources.doctrine.dbal.connections.default.parameters.port = 3306
resources.doctrine.dbal.connections.default.parameters.user = "root"
resources.doctrine.dbal.connections.default.parameters.password = ""
;resources.doctrine.dbal.connections.default.parameters.driverOptions.ATTR_USE_BUFFERED_QUERIES = true
resources.doctrine.dbal.connections.default.parameters.driverOptions.charset = "utf8"
; ------------------------------------------------------------------------------
; Doctrine ORM Configuration
; ------------------------------------------------------------------------------
;; Points to default EntityManager to be used. Optional if only one EntityManager is defined
resources.doctrine.orm.defaultEntityManager = default
;; EntityManager configuration for "default" manager
;resources.doctrine.orm.entityManagers.default.id = default
;resources.doctrine.orm.entityManagers.default.entityManagerClass = "Doctrine\ORM\EntityManager"
;resources.doctrine.orm.entityManagers.default.configurationClass = "Doctrine\ORM\Configuration"
resources.doctrine.orm.entityManagers.default.entityNamespaces.app = "Custom\Entity"
resources.doctrine.orm.entityManagers.default.connection = default
resources.doctrine.orm.entityManagers.default.proxy.autoGenerateClasses = true
resources.doctrine.orm.entityManagers.default.proxy.namespace = "Custom\Entity\Proxy"
resources.doctrine.orm.entityManagers.default.proxy.dir = APPLICATION_PATH "/../library/Custom/Entity/Proxy"
resources.doctrine.orm.entityManagers.default.metadataCache = default
;resources.doctrine.orm.entityManagers.default.queryCache = default
;resources.doctrine.orm.entityManagers.default.resultCache = default
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.adapterClass = "Doctrine\ORM\Mapping\Driver\AnnotationDriver"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.mappingNamespace = "Custom\Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.mappingDirs[] = APPLICATION_PATH "/../library/Custom/Entity/Metadata"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.mappingDirs[] = APPLICATION_PATH "/../library/DoctrineExtensions/Versionable"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.annotationReaderClass = "Doctrine\Common\Annotations\AnnotationReader"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.annotationReaderCache = default
;resources.doctrine.orm.entityManagers.default.metadataDrivers.0.annotationReaderNamespaces.App = "Application\DoctrineExtensions\ORM\Mapping"
;resources.doctrine.orm.entityManagers.default.DQLFunctions.numeric.PI = "DoctrineExtensions\ORM\Query\Functions\Numeric\PiFunction"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Logging Resource
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
resources.log.stream.writerName = "Stream"
resources.log.stream.writerParams.stream = APPLICATION_PATH "/../data/application.log"
resources.log.stream.writerParams.mode = "a"
resources.log.stream.filterName = "Priority"
resources.log.stream.filterParams.priority = 7
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
....
Then The 2 Entities:
namespace Custom\Entity;
use Doctrine\ORM\Mapping as ORM;
/****
User
*
@Table(name="user")
@Entity
/
class User
{
/***
*
*/
private $uid;
/****
*
/****
*
*/
private $region;
/****
*
*/
private $role;
/****
*
*/
private $association;
.............................................................
other one :
namespace Custom\Entity;
use Doctrine\ORM\Mapping as ORM;
/****
Role
*
@Table(name="role")
@Entity(repositoryClass="Custom\Entity\Repository\RolesRepository")
/
class Role
{
/***
*
*/
private $rid;
/****
*
*/
private $name;
/****
*
*/
private $desc;
@doctrinebot commented on GitHub (Nov 3, 2011):
Comment created by mickey_8:
Thx in advance sir!
@doctrinebot commented on GitHub (Nov 3, 2011):
Comment created by mickey_8:
Plizzz @Benjamin Eberlei !!! I Took an account 4 the Job I'm supposed to finish it next week.
@doctrinebot commented on GitHub (Nov 14, 2011):
Comment created by @beberlei:
Do the proxies get generated into the directory?
This seems to be a configuration issue with ZF, not a Doctrine issue.
@doctrinebot commented on GitHub (Nov 16, 2011):
Comment created by mickey_8:
thanks for your answer ! i solved it or should i say i finally saw what happen! The auto generated proxies were named CustomEntityRoleProxy.php, i expected a file RoleProxy.php in my proxy folder so each time i deleted these files!
so now since i let file everythin' ok.
I wonder why the file is named CustomEntityRoleProxy.php for example when they supposed to be RoleProxy.
Anyway thank you for your time.
@doctrinebot commented on GitHub (Nov 16, 2011):
Comment created by mickey_8:
i almost forgot the answer to your question is yes proxy are generated in that directory!
PS : sorry 4 my bad english it because i speak french
@doctrinebot commented on GitHub (Nov 16, 2011):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 3 attachments from Jira into https://gist.github.com/3d9fbd13eaea586181c0