public function getVersionId(EntityInterface $entity)
    {
        $table = TableRegistry::get($this->_config['versionTable']);
        $preexistent = $table->find()
            ->select(['version_id'])
            ->where([
                    'model' => $this->_config['referenceName']
                ] + $this->_extractForeignKey($entity))
            ->order(['id desc'])
            ->limit(1)
            ->enableHydration(false)
            ->toArray();

        return Hash::get($preexistent, '0.version_id', 0);
    }
public function getVersionId(EntityInterface $entity)
    {
        $table = TableRegistry::get($this->_config['versionTable']);
        $preexistent = $table->find()
            ->select(['version_id'])
            ->where([
                    'model' => $this->_config['referenceName']
                ] + $this->_extractForeignKey($entity))
            ->order(['id desc'])
            ->limit(1)
            ->enableHydration(false)
            ->toArray();

        return Hash::get($preexistent, '0.version_id', 0);
    }
public function getVersionId ( EntityInterface $ entity ) { $ table = TableRegistry :: get ( $ this -> _config [ 'versionTable' ] ) ; $ preexistent = $ table -> find ( ) -> select ( [ 'version_id' ] ) -> where ( [ 'model' => $ this -> _config [ 'referenceName' ] ] + $ this -> _extractForeignKey ( $ entity ) ) -> order ( [ 'id desc' ] ) -> limit ( 1 ) -> enableHydration ( false ) -> toArray ( ) ; return Hash :: get ( $ preexistent , '0.version_id' , 0 ) ; }
return the last version id

@param \Cake\Datasource\EntityInterface $entity Entity.
@return int
return the last version id