Add hash to Subject
The hash gives us a new column in our table, which we can use to query a specific combination of args and key more efficient [MAILPOET-4966]
This commit is contained in:
@@ -27,10 +27,15 @@ class Subject {
|
||||
return $this->args;
|
||||
}
|
||||
|
||||
public function hash(): string {
|
||||
return md5($this->getKey() . Json::encode($this->getArgs()));
|
||||
}
|
||||
|
||||
public function toArray(): array {
|
||||
return [
|
||||
'key' => $this->getKey(),
|
||||
'args' => Json::encode($this->getArgs()),
|
||||
'hash' => $this->hash(),
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user