<?php
/**
 * Author: Rymera Web Co
 *
 * @package SAAI\Abstracts
 */

namespace SAAI\Abstracts;

use SAAI\Traits\Magic_Get_Trait;

/**
 * Abstract Update class.<br>
 * Update classes should extend this abstract class and implement the `actions()` method. It should do whatever is
 * needed to update the plugin except updating the version number in database as that is already done by default by the
 * abstract class, unless, `run()` method is overridden.
 *
 * @since 1.0.0
 */
abstract class Abstract_Update extends Abstract_Class {

    use Magic_Get_Trait;

    /**
     * Run updates.
     *
     * @since 1.0.0
     */
    public function run() {

        $this->actions();

        update_option( SAAI_INSTALLED_VERSION, SAAI_VERSION );
    }

    /**
     * Perform update actions.
     *
     * @return void
     */
    abstract public function actions();
}
