trigger = $trigger; $this->journal = $journal; } /** * @{inheritdoc} * * @see TriggerInterface::matchesAnything * * @return bool */ public function matchesAnything() { return $this->trigger->trigger_value === ""; } /** * @return bool */ public function triggered() { $toAccountName = strtolower($this->journal->destination_account->name); $search = strtolower($this->trigger->trigger_value); $strpos = strpos($toAccountName, $search); if (!($strpos === false)) { // found something Log::debug('"' . $toAccountName . '" contains the text "' . $search . '". Return true.'); return true; } // found nothing. Log::debug('"' . $toAccountName . '" does not contain the text "' . $search . '". Return false.'); return false; } }