interface CommerceLicenseInterface in Commerce License 7
Ensures basic required behavior for a license.
EntityBundlePluginProvideFieldsInterface also mandates a fields() method.
Hierarchy
- interface \EntityBundlePluginProvideFieldsInterface
- interface \CommerceLicenseInterface
Expanded class hierarchy of CommerceLicenseInterface
All classes that implement CommerceLicenseInterface
File
- includes/
plugins/ license_type/ base.inc, line 18 - Abstract and interface plugin implementation.
View source
interface CommerceLicenseInterface extends EntityBundlePluginProvideFieldsInterface {
/**
* Returns an html representation of the access details.
*
* The information contained within should be the required minimum
* for the customer to access the resource he purchased the rights to.
*
* If the customer purchased a file license, this method would output
* the link to that file.
* If the customer purchased a software subscription and the service
* returned access credentials, this method would return those
* access credentials.
*
* @return
* An html string with the access details.
*/
public function accessDetails();
/**
* Returns whether a license is configurable.
*
* Configurable licenses are editable by the customer, either through
* the add to cart form (via Inline Entity Form) or through a checkout pane.
*
* The output of this method determines whether form(), formValidate()
* and formSubmit() will be called.
*
* @return
* TRUE if the license is configurable, FALSE otherwise.
*/
public function isConfigurable();
/**
* Provides the license form.
*
* @param $form
* The license form. Might be embedded in another form through
* Inline Entity Form.
* @param $form_state
* The form state of the complete form.
* Always use drupal_array_get_nested_value() instead of accessing
* $form_state['values'] directly.
*/
public function form(&$form, &$form_state);
/**
* Validates the license form.
*
* @param $form
* The license form. Might be embedded in another form through
* Inline Entity Form, so form['#parents'] needs to be taken into account
* when fetching values and setting errors.
* @param $form_state
* The form state of the complete form.
* Always use drupal_array_get_nested_value() instead of accessing
* $form_state['values'] directly.
*/
public function formValidate($form, &$form_state);
/**
* Submits the license form.
*
* @param $form
* The license form. Might be embedded in another form through
* Inline Entity Form, so form['#parents'] needs to be taken into account
* when fetching values and setting errors.
* @param $form_state
* The form state of the complete form.
* Always use drupal_array_get_nested_value() instead of accessing
* $form_state['values'] directly.
*/
public function formSubmit(&$form, $form_state);
/**
* Returns the html message to be shown to the customer on checkout complete.
*
* Called by the commerce_license_complete checkout pane.
*
* @return
* The html message to be shown to the customer.
*/
public function checkoutCompletionMessage();
/**
* Activates the license.
*/
public function activate();
/**
* Expires the license.
*/
public function expire();
/**
* Suspends the license.
*/
public function suspend();
/**
* Revokes the license.
*/
public function revoke();
/**
* Renews the license.
*
* @param $expires
* The new expiration timestamp.
*/
public function renew($expires);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CommerceLicenseInterface:: |
public | function | Returns an html representation of the access details. | 1 |
CommerceLicenseInterface:: |
public | function | Activates the license. | 1 |
CommerceLicenseInterface:: |
public | function | Returns the html message to be shown to the customer on checkout complete. | 1 |
CommerceLicenseInterface:: |
public | function | Expires the license. | 1 |
CommerceLicenseInterface:: |
public | function | Provides the license form. | 1 |
CommerceLicenseInterface:: |
public | function | Submits the license form. | 1 |
CommerceLicenseInterface:: |
public | function | Validates the license form. | 1 |
CommerceLicenseInterface:: |
public | function | Returns whether a license is configurable. | 1 |
CommerceLicenseInterface:: |
public | function | Renews the license. | 1 |
CommerceLicenseInterface:: |
public | function | Revokes the license. | 1 |
CommerceLicenseInterface:: |
public | function | Suspends the license. | 1 |
EntityBundlePluginProvideFieldsInterface:: |
static | function | Returns the fields that are going to be used by this entity bundle. | 2 |