original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: return the last version id
  
  @param \Cake\Datasource\EntityInterface $entity Entity.
  @return int
docstring_tokens: return the last version id