Airship\Engine\Continuum\Updaters\UpdateInfo::getVersion PHP Method

getVersion() public method

Get the version for this particular update
public getVersion ( ) : string
return string
    public function getVersion() : string
    {
        return $this->version;
    }

Usage Example

Example #1
0
 /**
  * Update the version identifier stored in the gadgets.json file
  *
  * @param UpdateInfo $info
  * @param array $metaData
  */
 public function updateJSON(UpdateInfo $info, array $metaData = [])
 {
     if (!empty($metaData['cabin'])) {
         $gadgetConfigFile = ROOT . '/Cabin/' . $metaData['cabin'] . '/config/gadgets.json';
     } else {
         $gadgetConfigFile = ROOT . '/config/gadgets.json';
     }
     $gadgetConfig = \Airship\loadJSON($gadgetConfigFile);
     foreach ($gadgetConfig as $i => $gadget) {
         if ($gadget['supplier'] === $info->getSupplierName()) {
             if ($gadget['name'] === $info->getPackageName()) {
                 $gadgetConfig[$i]['version'] = $info->getVersion();
                 break;
             }
         }
     }
     \Airship\saveJSON($gadgetConfigFile, $gadgetConfig);
 }