Magento 2 Certification Questions List | How to use upgrade script for different versions of module

UpgradeSchema.php only provides one method: upgrade. What method do you use to determine what code to execute for what method?

Answer:
  • Use PHP's version_compare method to compare the $context->getVersion() with the required version.
Prepear for Magento 2 certefication with our interactive quiz