Skip to content

Commit

Permalink
check if AbstractWrapper exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ychadwick committed Mar 3, 2016
1 parent e3e1691 commit 5d0adc7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Exporter/Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,13 @@ public function createCsv(EntityMap $entityMap, $results)
*/
protected function getTranslatableValue(TranslatableFieldMap $field, $entity)
{
$wrapped = Gedmo\Tool\Wrapper\AbstractWrapper::wrap($entity, $field->getAdapter()->getObjectManager());
$data = $field->getAdapter()->findTranslation($wrapped, $field->getLocale(), $field->getPropertyPath(), $field->getTranslatableClass(), $field->getClass());
if(class_exists('\Gedmo\Tool\Wrapper\AbstractWrapper')){
$wrapped = \Gedmo\Tool\Wrapper\AbstractWrapper::wrap($entity, $field->getAdapter()->getObjectManager());
$data = $field->getAdapter()->findTranslation($wrapped, $field->getLocale(), $field->getPropertyPath(), $field->getTranslatableClass(), $field->getClass());
return $data->getContent();
}

return $data->getContent();
return $this->getColumnData($entity, $field->getPropertyPath());
}

/**
Expand Down

0 comments on commit 5d0adc7

Please sign in to comment.