This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

cms:onExtendPartialModel event

Triggered by Cms_Partial
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onExtendPartialModel(Cms_Partial $partial, string $context)
$partial Cms_Partial specifies the partial object to extend.
$context string specifies the execution context.
Allows to define new columns in the partial model. The event handler should accept two parameters - the partial object and the form execution context string. To add new columns to the partial model, call the define_column() method of the partial object. Before you add new columns to the model, you should add them to the database (the partials table).
public function subscribeEvents()
{
  Backend::$events->addEvent('cms:onExtendPartialModel', $this, 'extend_partial_model');
  Backend::$events->addEvent('cms:onExtendPartialForm', $this, 'extend_partial_form');
}

public function extend_partial_model($partial, $context)
{
  $partial->define_column('x_extra_description', 'Extra description');
}

public function extend_partial_form($partial, $context)
{
  $partial->add_form_field('x_extra_description');
}