Events hook
Permalink
I have an existing system that was built for me. I have a problem in that an event hook fires off when ever an entry is added or edited in the custom object. What I really want is for the event to fire off only when a new entry is added, so not when an existing one is edited. The controller code is below. Any help appreciated.
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); class DashboardChurchesAddChurchController extends Controller { public function on_start() { $this->error = Loader::helper('validation/error'); Loader::model('attribute/categories/churches', 'churches'); } public function view(){ $html = Loader::helper('html'); $form = Loader::helper('form'); $this->set('form', $form); } private function saveData($Church) { Loader::model('attribute/categories/churches', 'churches'); $attribs = ChurchesAttributeKey::getList();
Viewing 15 lines of 70 lines. View entire code block.
below
in the add function that should fix your issue.