Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 3 comments

1 participant

@doctrinebot

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);
@doctrinebot

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

Comment created by purnama:

please stand by,

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

@doctrinebot

Issue was closed with resolution "Cannot Reproduce"

@doctrinebot doctrinebot added this to the 2.0-ALPHA3 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.