trigger = $trigger; $this->journal = $journal; } /** * @{inheritdoc} * * @see TriggerInterface::matchesAnything * * @return bool */ public function matchesAnything() { return $this->trigger->trigger_value === ""; } /** * @return bool */ public function triggered() { $description = strtolower($this->journal->description); $search = strtolower($this->trigger->trigger_value); $part = substr($description, 0, strlen($search)); if ($part == $search) { Log::debug('"' . $description . '" starts with "' . $search . '". Return true.'); return true; } Log::debug('"' . $description . '" does not start with "' . $search . '". Return false.'); return false; } }