trigger = $trigger; $this->journal = $journal; } /** * @return bool */ public function triggered() { $search = strtolower($this->trigger->trigger_value); $source = strtolower($this->journal->description); $strpos = strpos($source, $search); if (!($strpos === false)) { // found something Log::debug('"' . $source . '" contains the text "' . $search . '". Return true.'); return true; } // found nothing. Log::debug('"' . $source . '" does not contain the text "' . $search . '". Return false.'); return false; } /** * Checks whether this trigger will match all transactions * This happens when the trigger_value is empty * @return bool */ public function matchesAnything() { return $this->trigger->trigger_value === ""; } }