|
Revision 13440, 0.7 kB
(checked in by cinxgler, 4 years ago)
|
Demonstration module added
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
class MyServiceObject implements ezcWorkflowServiceObject |
|---|
| 7 |
{ |
|---|
| 8 |
private $message; |
|---|
| 9 |
|
|---|
| 10 |
public function __construct( $message ) |
|---|
| 11 |
{ |
|---|
| 12 |
$this->message = $message; |
|---|
| 13 |
} |
|---|
| 14 |
|
|---|
| 15 |
public function execute( ezcWorkflowExecution $execution ) |
|---|
| 16 |
{ |
|---|
| 17 |
|
|---|
| 18 |
mail('root@localhost', 'Automatic email', $this->message); |
|---|
| 19 |
|
|---|
| 20 |
// Does not affect the workflow, for illustration only. |
|---|
| 21 |
$execution->setVariable( 'email_sent', true ); |
|---|
| 22 |
return true; |
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
public function __toString() |
|---|
| 26 |
{ |
|---|
| 27 |
return "MyServiceObject, message {$this->message}"; |
|---|
| 28 |
} |
|---|
| 29 |
} |
|---|