trigger = $trigger; $this->journal = $journal; } /** * @{inheritdoc} * * @see TriggerInterface::matchesAnything * * @return bool */ public function matchesAnything() { return $this->trigger->trigger_value === ""; } /** * @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; } }