/** * Method to check if the condition is valid * * @param object CRM_Civirules_EventData_EventData $eventData * @return bool * @access public */ public function isConditionValid(CRM_Civirules_EventData_EventData $eventData) { //not the right event. The event data should contain also if (!$eventData instanceof CRM_Civirules_EventData_Interface_OriginalData) { return false; } $entity = $this->getEntity(); if ($entity != $eventData->getOriginalEntity()) { return false; } $fieldData = $this->getFieldData($eventData); $originalData = $this->getOriginalFieldData($eventData); if (empty($fieldData) && empty($originalData)) { return false; //both original and new data are null so assume not changed } elseif ($fieldData == $originalData) { return false; //both data are equal so assume not changed } return true; }