/**
  * 2.2 version
  * {@inheritdoc}
  */
 protected function hydrateAllData()
 {
     $listener = $this->getTranslatableListener();
     $listener->setSkipOnLoad(true);
     $result = parent::hydrateAllData();
     $listener->setSkipOnLoad(false);
     return $result;
 }
 /**
  * {@inheritdoc}
  */
 protected function _hydrateAll()
 {
     $listener = $this->_hints[TranslationWalker::HINT_TRANSLATION_LISTENER];
     $listener->setSkipOnLoad(true);
     $result = parent::_hydrateAll();
     $listener->setSkipOnLoad(false);
     return $result;
 }
 protected function hydrateRowData(array $sqlResult, array &$cache, array &$result)
 {
     parent::hydrateRowData($sqlResult, $cache, $result);
     if (empty($this->aliasInvokers)) {
         return;
     }
     $invokers = reset($this->aliasInvokers);
     $dqlAlias = key($this->aliasInvokers);
     $class = $this->aliasMetadata[$dqlAlias];
     $entity = end($result);
     $this->lifecycleEventsInvoker->invoke($class, Events::postLoadRelations, $entity, new LifecycleEventArgs($entity, $this->_em), $invokers);
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 protected function _hydrateRow(array $data, array &$cache, array &$result)
 {
     if (isset($this->_hints[TranslationWalker::HINT_TRANSLATION_FALLBACKS])) {
         foreach ($this->_hints[TranslationWalker::HINT_TRANSLATION_FALLBACKS] as $field => $alias) {
             if ($data[$field] && !$data[$alias]) {
                 $data[$alias] = $data[$field];
             }
             unset($data[$field]);
         }
     }
     return parent::_hydrateRow($data, $cache, $result);
 }
 /**
  * {@inheritdoc}
  */
 protected function cleanup()
 {
     parent::cleanup();
     $listener = $this->getTranslatableListener();
     $listener->setSkipOnLoad($this->savedSkipOnLoad !== null ? $this->savedSkipOnLoad : false);
 }
 /**
  * Hydrates all rows from the current statement instance at once.
  *
  * @return Collection
  */
 protected function hydrateAllData()
 {
     return new Collection(parent::hydrateAllData());
 }