concrete/src/Entity/File/File.php
public function getVersion($fvID = null)
    {
        if (!$fvID) {
            return $this->getApprovedVersion();
        }

        $em = \ORM::entityManager();
        $r = $em->getRepository('\Concrete\Core\Entity\File\Version');

        return $r->findOneBy(['file' => $this, 'fvID' => $fvID]);
    }
public function getVersion($fvID = null)
    {
        if (!$fvID) {
            return $this->getApprovedVersion();
        }

        $em = \ORM::entityManager();
        $r = $em->getRepository('\Concrete\Core\Entity\File\Version');

        return $r->findOneBy(['file' => $this, 'fvID' => $fvID]);
    }
public function getVersion ( $ fvID = null ) { if ( ! $ fvID ) { return $ this -> getApprovedVersion ( ) ; } $ em = \ ORM :: entityManager ( ) ; $ r = $ em -> getRepository ( '\Concrete\Core\Entity\File\Version' ) ; return $ r -> findOneBy ( [ 'file' => $ this , 'fvID' => $ fvID ] ) ; }
returns the FileVersion object for the provided fvID
if none provided returns the approved version.

@param int $fvID

@return Version
returns the FileVersion object for the provided fvID if none provided returns the approved version .