Skip to content

Instantly share code, notes, and snippets.

@Floby
Created July 30, 2012 13:58
Show Gist options
  • Save Floby/3207066 to your computer and use it in GitHub Desktop.
Save Floby/3207066 to your computer and use it in GitHub Desktop.
Connecting signals in Centurion
<?php
class Search_Bootstrap extends Centurion_Application_Module_Bootstrap
{
protected function _initSignals()
{
Centurion_Signal::factory('post_delete')->connect(array($this, 'postDeleteRow'), 'Centurion_Db_Table_Row_Abstract');
}
public function postDeleteRow()
{
$args = func_get_args();
/* $signal = */array_shift($args);
$sender = array_shift($args);
if (Search_Model_Manager::deleteRow($sender)) {
$this->getApplication()->getResource('cachemanager')->cleanCache(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('search'));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment