operation = $operation; $this->level = $level; $this->message = $message; $this->retryInterval = $retryInterval; $this->subscribersErrors = $subscribersErrors; } /** * @return string */ public function getOperation() { return $this->operation; } /** * @return string */ public function getLevel() { return $this->level; } /** * @return null|string */ public function getMessage() { return $this->message; } /** * @return int|null */ public function getRetryInterval() { return $this->retryInterval; } /** * @return SubscriberError[] */ public function getSubscriberErrors() { return $this->subscribersErrors; } public function getMessageWithFailedSubscribers() { $message = $this->message ?: ''; if (!$this->subscribersErrors) { return $message; } $message .= $this->message ? ' ' : ''; if (count($this->subscribersErrors) === 1) { $message .= __('Unprocessed subscriber:', 'mailpoet') . ' '; } else { $message .= __('Unprocessed subscribers:', 'mailpoet') . ' '; } $message .= implode( ', ', array_map(function (SubscriberError $subscriberError) { return "($subscriberError)"; }, $this->subscribersErrors) ); return $message; } }