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:onDeletePage event

Triggered by Cms_Page
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onDeletePage(Cms_Page $page)
$page Cms_Page specifies the page object to be deleted.
Triggered before a page is deleted. The event handler can throw an exception to prevent deletion of a specific page.
public function subscribeEvents()
{
  Backend::$events->addEvent('cms:onDeletePage', $this, 'page_deletion_check');
}

public function page_deletion_check($page)
{
  $in_use = Db_DbHelper::scalar(
    'select count(*) from shop_categories where page_id=:id', 
    array('id'=>$page->id)
  );

  if ($in_use)
    throw new Phpr_ApplicationException("Unable to delete page: it is used as a category landing page.");
}