X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fdeferred%2FDataUpdate.php;h=ed9a7462f78e716e98027ff035d27859f30c7c4e;hb=fef9ed715ac5814e7a2346bc0daa437d6ac7d6dd;hp=d2d8bd7a319ec1e1e049a64d8777db097288246e;hpb=65d7d79d1ba09afc362f9e542b7df97b7ecc9c3e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/DataUpdate.php b/includes/deferred/DataUpdate.php index d2d8bd7a31..ed9a7462f7 100644 --- a/includes/deferred/DataUpdate.php +++ b/includes/deferred/DataUpdate.php @@ -28,6 +28,10 @@ abstract class DataUpdate implements DeferrableUpdate { /** @var mixed Result from LBFactory::getEmptyTransactionTicket() */ protected $ticket; + /** @var string Short update cause action description */ + protected $causeAction = 'unknown'; + /** @var string Short update cause user description */ + protected $causeAgent = 'unknown'; public function __construct() { // noop @@ -41,6 +45,29 @@ abstract class DataUpdate implements DeferrableUpdate { $this->ticket = $ticket; } + /** + * @param string $action Action type + * @param string $user User name + */ + public function setCause( $action, $user ) { + $this->causeAction = $action; + $this->causeAgent = $user; + } + + /** + * @return string + */ + public function getCauseAction() { + return $this->causeAction; + } + + /** + * @return string + */ + public function getCauseAgent() { + return $this->causeAgent; + } + /** * Convenience method, calls doUpdate() on every DataUpdate in the array. *