Internal API (function overview)

Overview

Enwikuna License Manager has functions that you can use internally to customize licenses & generators. Below you will find an overview of all functions that can be used for this purpose. Please note that these functions are only available when the plugin is active.

The listed methods abstract only existing classes and their methods. As an experienced developer, we recommend that you use the methods of a class by importing the class directly into PHP.

Here is an example

use Enwikuna\Enwikuna_License_Manager\ELM_License;

$license = ELM_License::get_instance()->find( $license_id );

However, if you don’t want to use imports, you can fall back on methods that already do this import and pass your request to the executing method of the respective class.

Here is an example

$license = elm_find_license_by( array $where );

License

Below you will find all the functions to modify licenses.


elm_create_license()

/**
 * Creates a new license in the database
 *
 * @param array $license_data
 *
 * @return ELM_Data_Store_License_Model|false
 */
function elm_create_license( array $license_data );

Description

This function creates a new license inside the database.


Parameter

$license_data (array) The license data (must match the columns of the licenses table)


elm_update_license()

/**
 * Updates a license in the database
 *
 * @param array $license_update_data
 * @param ELM_Data_Store_License_Model $license
 * @param bool $skip_before_functions
 *
 * @return ELM_Data_Store_License_Model|false
 */
function elm_update_license( array $license_update_data, ELM_Data_Store_License_Model $license, bool $skip_before_functions = false );

Description

This function updates a license inside the database.


Parameter

$license_update_data (array) The license update data (must match the columns of the licenses table)

$license (ELM_Data_Store_License_Model) The license object

$skip_before_functions (bool) Whether the before functions should be skipped or not


elm_update_license_by()

/**
 * Updates a license in the database
 *
 * @param array $license_update_data
 * @param array $where
 * @param bool $skip_before_functions
 *
 * @return bool|ELM_Data_Store_License_Model[]
 */
function elm_update_license_by( array $license_update_data, array $where, bool $skip_before_functions = false );

Description

This function updates a license inside the database.


Parameter

$license_update_data (array) The license update data (must match the columns of the licenses table)

$where (array) The license localization data (must match the columns of the licenses table).

$skip_before_functions (bool) Whether the before functions should be skipped or not


elm_find_license()

/**
 * Finds a license in the database
 *
 * @param int $license_id
 *
 * @return bool|ELM_Data_Store_License_Model
 */
function elm_find_license( int $license_id );

Description

This function searches for a license inside the database.


Parameter

$license_id (int) The license ID


elm_find_license_by()

/**
 * Finds a license in the database
 *
 * @param array $where
 * @param array|null $order_by
 *
 * @return bool|ELM_Data_Store_License_Model
 */
function elm_find_license_by( array $where, array $order_by = null );

Description

This function searches for a license inside the database.


Parameter

$where (array) The license localization data (must match the columns of the licenses table).

$order_by (array) The data for ordering


elm_lock_license()

/**
 * Locks a license in the database
 *
 * @param ELM_Data_Store_License_Model $license
 *
 * @return bool|ELM_Data_Store_License_Model
 */
function elm_lock_license( ELM_Data_Store_License_Model $license );

Description

This function locks a license inside the database.


Parameter

$license (ELM_Data_Store_License_Model) The license object


elm_unlock_license()

/**
 * Unlocks a license in the database
 *
 * @param ELM_Data_Store_License_Model $license
 *
 * @return bool|ELM_Data_Store_License_Model
 */
function elm_unlock_license( ELM_Data_Store_License_Model $license );

Description

This function unlocks a license inside the database.


Parameter

$license (ELM_Data_Store_License_Model) The license object


elm_change_license_status()

/**
 * Changes a license status
 *
 * @param ELM_Data_Store_License_Model $license
 * @param string $status
 *
 * @return bool|ELM_Data_Store_License_Model
 */
function elm_change_license_status( ELM_Data_Store_License_Model $license, string $status );

Description

This function changes the status of a license inside the database.


Parameter

$license (ELM_Data_Store_License_Model) The license object

$status (string) The license status


elm_delete_license()

/**
 * Deletes a license from the database
 *
 * @param ELM_Data_Store_License_Model $license
 *
 * @return bool
 */
function elm_delete_license( ELM_Data_Store_License_Model $license ): bool;

Description

This function deletes a license from the database.


Parameter

$license (ELM_Data_Store_License_Model) The license object


elm_delete_license_by()

/**
 * Deletes a license from the database
 *
 * @param array $where
 *
 * @return bool
 */
function elm_delete_license_by( array $where ): bool;

Description

This function deletes a license from the database.


Parameter

$where (array) The license localization data (must match the columns of the licenses table).


License activation

Below you will find all the functions to modify license activations.


elm_create_license_activation()

/**
 * Creates a new license activation in the database
 *
 * @param array $license_activation_data
 *
 * @return ELM_Data_Store_License_Activation_Model|false
 */
function elm_create_license_activation( array $license_activation_data );

Description

This function creates a new license activation inside the database.


Parameter

$license_activation_data (array) The license activation data (must match the columns of the license activations table)


elm_update_license_activation()

/**
 * Updates a license activation in the database
 *
 * @param array $license_activation_update_data
 * @param ELM_Data_Store_License_Activation_Model $license_activation
 *
 * @return ELM_Data_Store_License_Activation_Model|false
 */
function elm_update_license_activation( array $license_activation_update_data, ELM_Data_Store_License_Activation_Model $license_activation );

Description

This function updates a license activation inside the database.


Parameter

$license_activation_update_data (array) The license activation update data (must match the columns of the license activations table)

$license_activation (ELM_Data_Store_License_Activation_Model) The license activation object


elm_find_license_activation()

/**
 * Finds a license activation in the database
 *
 * @param int $license_activation_id
 *
 * @return bool|ELM_Data_Store_License_Activation_Model
 */
function elm_find_license_activation( int $license_activation_id );

Description

This function searches for a license activation inside the database.


Parameter

$license_activation_id (int) The license activation ID


elm_find_license_activation_by()

/**
 * Finds a license activation in the database
 *
 * @param array $where
 * @param array|null $order_by
 *
 * @return bool|ELM_Data_Store_License_Activation_Model
 */
function elm_find_license_activation_by( array $where, array $order_by = null );

Description

This function searches for a license activation inside the database.


Parameter

$where (array) The license activation localization data (must match the columns of the license activations table)

$order_by (array) The data for ordering


elm_delete_license_activation()

/**
 * Deletes a license activation from the database
 *
 * @param ELM_Data_Store_License_Activation_Model $license_activation
 *
 * @return bool
 */
function elm_delete_license_activation( ELM_Data_Store_License_Activation_Model $license_activation ): bool;

Description

This function deletes a license activation from the database.


Parameter

$license_activation (ELM_Data_Store_License_Activation_Model) The license activation object


elm_delete_license_activation_by()

/**
 * Deletes a license activation from the database
 *
 * @param array $where
 *
 * @return bool
 */
function elm_delete_license_activation_by( array $where ): bool;

Description

This function deletes a license activation from the database.


Parameter

$where (array) The license activation localization data (must match the columns of the license activations table)


Generator

Below you will find all the functions to modify generators.


elm_create_generator()

/**
 * Creates a new generator in the database
 *
 * @param array $generator_data
 *
 * @return ELM_Data_Store_Generator_Model|false
 */
function elm_create_generator( array $generator_data );

Description

This function creates a new generator inside the database.


Parameter

$generator_data (array) The generator data (must match the columns of the generators table)


elm_update_generator()

/**
 * Updates a generator in the database
 *
 * @param array $generator_update_data
 * @param ELM_Data_Store_Generator_Model $generator
 *
 * @return ELM_Data_Store_Generator_Model|false
 */
function elm_update_generator( array $generator_update_data, ELM_Data_Store_Generator_Model $generator );

Description

This function updates a generator inside the database.


Parameter

$generator_update_data (array) The generator update data (must match the generators table columns)

$generator (ELM_Data_Store_Generator_Model) The generator object


elm_find_generator()

/**
 * Finds a generator in the database
 *
 * @param int $generator_id
 *
 * @return ELM_Data_Store_Generator_Model|false
 */
function elm_find_generator( int $generator_id );

Description

This function searches for a generator inside the database.


Parameter

$generator_id (int) The generator ID


elm_delete_generator()

/**
 * Deletes a generator from the database
 *
 * @param ELM_Data_Store_Generator_Model $generator
 *
 * @return bool
 */
function elm_delete_generator( ELM_Data_Store_Generator_Model $generator ): bool;

Description

This function deletes a generator from the database.


Parameter

$generator (ELM_Data_Store_Generator_Model) The generator object


Release (Pro)

Below you will find all the functions to modify releases.


elmp_create_release()

/**
 * Creates a new release in the database
 *
 * @param array $release_data
 *
 * @return ELMP_Data_Store_Release_Model|false
 */
function elmp_create_release( array $release_data )

Description

This function creates a new release inside the database.


Parameter

$release_data (array) The release data (must match the columns of the release table)


elmp_update_release()

/**
 * Updates a release in the database
 *
 * @param array $release_update_data
 * @param ELMP_Data_Store_Release_Model $release
 *
 * @return ELMP_Data_Store_Release_Model|false
 */
function elmp_update_release( array $release_update_data, ELMP_Data_Store_Release_Model $release )

Description

This function updates a release inside the database.


elmp_find_release()

/**
 * Finds a release in the database
 *
 * @param int $release_id
 *
 * @return bool|ELMP_Data_Store_Release_Model
 */
function elmp_find_release( int $release_id )

Description

This function searches for a release inside the database.


Parameter

$release_id (int) The release ID


elmp_delete_release()

/**
 * Deletes a release from the database
 *
 * @param ELMP_Data_Store_Release_Model $release
 *
 * @return bool
 */
function elmp_delete_release( ELMP_Data_Store_Release_Model $release ): bool

Description

This function deletes a release from the database.


Parameter

$release (ELMP_Data_Store_Release_Model) The release object