public function elementExists($name)
{
if ($this->mode == 'update') {
// get the id of the event type we are updating, and check if an element with this name exists for that event
return ElementType::model()->find('event_type_id=:eventTypeId and name=:elementName', array('eventTypeId' => @$_POST['EventTypeModuleEventType'], ':elementName' => $name)) != null;
}
return false;
}