src/Compo/Sonata/AdminBundle/Listener/LogRevisionsListenerExtend.php
private function getOriginalEntityData($entity)
    {
        $class = $this->em->getClassMetadata(\get_class($entity));
        $data = $this->uow->getOriginalEntityData($entity);
        if ($class->isVersioned) {
            $versionField = $class->versionField;
            $data[$versionField] = $class->reflFields[$versionField]->getValue($entity);
        }

        return $data;
    }
private function getOriginalEntityData($entity)
    {
        $class = $this->em->getClassMetadata(\get_class($entity));
        $data = $this->uow->getOriginalEntityData($entity);
        if ($class->isVersioned) {
            $versionField = $class->versionField;
            $data[$versionField] = $class->reflFields[$versionField]->getValue($entity);
        }

        return $data;
    }
private function getOriginalEntityData ( $ entity ) { $ class = $ this -> em -> getClassMetadata ( \ get_class ( $ entity ) ) ; $ data = $ this -> uow -> getOriginalEntityData ( $ entity ) ; if ( $ class -> isVersioned ) { $ versionField = $ class -> versionField ; $ data [ $ versionField ] = $ class -> reflFields [ $ versionField ] -> getValue ( $ entity ) ; } return $ data ; }
get original entity data, including versioned field, if "version" constraint is used.

@param mixed $entity

@return array
get original entity data including versioned field if version constraint is used .