Development

/plugins/sfEzcWorkflowPlugin/trunk/modules/sfEzcWorkflowDemo/lib/MyServiceObject.class.php

You must first sign up to be able to contribute.

root/plugins/sfEzcWorkflowPlugin/trunk/modules/sfEzcWorkflowDemo/lib/MyServiceObject.class.php

Revision 13440, 0.7 kB (checked in by cinxgler, 4 years ago)

Demonstration module added

Line 
1 <?php
2 /**
3 * Test class
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       //do whatever you need to do here ... ie. send an email
18       mail('root@localhost', 'Automatic email', $this->message);
19       // Manipulate the workflow.
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 }
Note: See TracBrowser for help on using the browser.