DDC-52: Eager Load with allowPartialObjects set to TRUE #63

Closed
opened 2026-01-22 12:25:45 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 15, 2009).

Jira issue originally created by user purnama:

Hello,

DDC-51 Works fine with allowPartialObjects set to FALSE, i will continue work with this setting.

but if i set allowPartial objects to TRUE or i commented it out in my DataAccess class. it will not eager load the definitions, proverbs and relation.

this is my DataAccess class part

$config = new ORM\Configuration();
$config->setMetadataCacheImpl(self::$metadataCache);
$config->setQueryCacheImpl(self::$queryCache);
$config->setProxyDir(realpath(DOCTRINE*PROXIES*PATH));
$config->setProxyNamespace('kateglo\proxies');

self::$entityManager = ORM\EntityManager::create($conn, $config);
//self::$entityManager->getConfiguration()->setAllowPartialObjects(false);

and this is the code that i tried with the allowPartialObject commented out (i tried it with True too and its the same).

$query = utilities\DataAccess::getEntityManager()->createQuery("SELECT p, d FROM ".models\Phrase::CLASS_NAME." p JOIN p.definitions d WHERE p.phrase = '$phrase'");        
$result = $query->getResult();
$definitions = $result[0]->getDefinitions();
echo count($definitions);

the result of the echo is 0

and i even try this one too, and the result is 000

$query = utilities\DataAccess::getEntityManager()->createQuery("SELECT p, pv, d, r FROM ".models\Phrase::CLASS_NAME." p JOIN p.proverbs pv JOIN p.definitions d JOIN p.relations r WHERE p.phrase = '$phrase'");        
$result = $query->getResult();
$proverbs = $result[0]->getProverbs();
$definitions = $result[0]->getDefinitions();
$relations = $result[0]->getRelations();
echo count($proverbs);
echo count($definitions);
echo count($relations);
Originally created by @doctrinebot on GitHub (Oct 15, 2009). Jira issue originally created by user purnama: Hello, [DDC-51](http://www.doctrine-project.org/jira/browse/DDC-51) Works fine with allowPartialObjects set to FALSE, i will continue work with this setting. but if i set allowPartial objects to TRUE or i commented it out in my DataAccess class. it will not eager load the definitions, proverbs and relation. this is my DataAccess class part ``` $config = new ORM\Configuration(); $config->setMetadataCacheImpl(self::$metadataCache); $config->setQueryCacheImpl(self::$queryCache); $config->setProxyDir(realpath(DOCTRINE*PROXIES*PATH)); $config->setProxyNamespace('kateglo\proxies'); self::$entityManager = ORM\EntityManager::create($conn, $config); //self::$entityManager->getConfiguration()->setAllowPartialObjects(false); ``` and this is the code that i tried with the allowPartialObject commented out (i tried it with True too and its the same). ``` $query = utilities\DataAccess::getEntityManager()->createQuery("SELECT p, d FROM ".models\Phrase::CLASS_NAME." p JOIN p.definitions d WHERE p.phrase = '$phrase'"); $result = $query->getResult(); $definitions = $result[0]->getDefinitions(); echo count($definitions); ``` the result of the echo is 0 and i even try this one too, and the result is 000 ``` $query = utilities\DataAccess::getEntityManager()->createQuery("SELECT p, pv, d, r FROM ".models\Phrase::CLASS_NAME." p JOIN p.proverbs pv JOIN p.definitions d JOIN p.relations r WHERE p.phrase = '$phrase'"); $result = $query->getResult(); $proverbs = $result[0]->getProverbs(); $definitions = $result[0]->getDefinitions(); $relations = $result[0]->getRelations(); echo count($proverbs); echo count($definitions); echo count($relations); ```
admin added the Bug label 2026-01-22 12:25:45 +01:00
admin closed this issue 2026-01-22 12:25:46 +01:00
Author
Owner

@doctrinebot commented on GitHub (Oct 15, 2009):

Comment created by romanb:

Are you sure there is a difference? The allowPartialObjects option is not used anymore. I just removed all references to it in the code itself and removed the option on the Configuration class also.

If you're using the latest code from trunk, this option does not exist anymore.

@doctrinebot commented on GitHub (Oct 15, 2009): Comment created by romanb: Are you sure there is a difference? The allowPartialObjects option is not used anymore. I just removed all references to it in the code itself and removed the option on the Configuration class also. If you're using the latest code from trunk, this option does not exist anymore.
Author
Owner

@doctrinebot commented on GitHub (Oct 15, 2009):

Comment created by purnama:

please stand by,

my latest ist rev.6524
im updating now to the latest rev.

@doctrinebot commented on GitHub (Oct 15, 2009): Comment created by purnama: please stand by, my latest ist rev.6524 im updating now to the latest rev.
Author
Owner

@doctrinebot commented on GitHub (Oct 16, 2009):

Issue was closed with resolution "Cannot Reproduce"

@doctrinebot commented on GitHub (Oct 16, 2009): Issue was closed with resolution "Cannot Reproduce"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#63