mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Added method for triggers to check whether they match all transactions
This commit is contained in:
@@ -62,4 +62,11 @@ class AmountExactly implements TriggerInterface
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this trigger will match all transactions
|
||||||
|
* For example: amount > 0 or description starts with ''
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function matchesAnything() { return false; }
|
||||||
}
|
}
|
||||||
|
@@ -62,4 +62,11 @@ class AmountLess implements TriggerInterface
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this trigger will match all transactions
|
||||||
|
* For example: amount > 0 or description starts with ''
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function matchesAnything() { return false; }
|
||||||
}
|
}
|
||||||
|
@@ -62,4 +62,13 @@ class AmountMore implements TriggerInterface
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this trigger will match all transactions
|
||||||
|
* This happens when the trigger_value is zero
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function matchesAnything() {
|
||||||
|
return bccomp('0', $this->trigger->trigger_value) === 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -63,4 +63,13 @@ class DescriptionContains implements TriggerInterface
|
|||||||
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 === "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -72,4 +72,14 @@ class DescriptionEnds implements TriggerInterface
|
|||||||
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 === "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -58,4 +58,11 @@ class DescriptionIs implements TriggerInterface
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this trigger will match all transactions
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function matchesAnything() { return false; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -60,4 +60,14 @@ class DescriptionStarts implements TriggerInterface
|
|||||||
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 === "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -62,4 +62,14 @@ class FromAccountContains implements TriggerInterface
|
|||||||
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 === "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -72,4 +72,15 @@ class FromAccountEnds implements TriggerInterface
|
|||||||
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 === "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -58,4 +58,11 @@ class FromAccountIs implements TriggerInterface
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this trigger will match all transactions
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function matchesAnything() { return false; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -60,4 +60,15 @@ class FromAccountStarts implements TriggerInterface
|
|||||||
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 === "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -62,4 +62,15 @@ class ToAccountContains implements TriggerInterface
|
|||||||
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 === "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -72,4 +72,14 @@ class ToAccountEnds implements TriggerInterface
|
|||||||
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 === "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -58,4 +58,11 @@ class ToAccountIs implements TriggerInterface
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this trigger will match all transactions
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function matchesAnything() { return false; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -60,4 +60,15 @@ class ToAccountStarts implements TriggerInterface
|
|||||||
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 === "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -57,4 +57,11 @@ class TransactionType implements TriggerInterface
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this trigger will match all transactions
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function matchesAnything() { return false; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -32,4 +32,11 @@ interface TriggerInterface
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function triggered();
|
public function triggered();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this trigger will match all transactions
|
||||||
|
* For example: amount > 0 or description starts with ''
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function matchesAnything();
|
||||||
}
|
}
|
||||||
|
@@ -53,4 +53,10 @@ class UserAction implements TriggerInterface
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether this trigger will match all transactions
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function matchesAnything() { return true; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user