Source of file NotifyOnThis.php
Size: 1,865 Bytes - Last Modified: 2021-12-23T10:20:21+00:00
/var/www/docs.ssmods.com/process/src/code/tests/NotifyOnThis.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 | <?php /** * @author marcus@silverstripe.com.au * @license http://silverstripe.org/bsd-license/ */ class NotifyOnThis extends DataObject implements NotifiedOn, TestOnly { public static $db = array( 'Title' => 'Varchar', 'NotifyBy' => 'SS_Datetime', 'Status' => 'Varchar', ); protected $availableKeywords; /** * Return a list of all available keywords in the format * * array( * 'keyword' => 'A description' * ) * * @return array */ public function getAvailableKeywords() { if (!$this->availableKeywords) { $objectFields = Object::combined_static($this->class, 'db'); // $objectFields = array_combine(array_keys($objectFields), array_keys($objectFields)); $objectFields['Created'] = 'Created'; $objectFields['LastEdited'] = 'LastEdited'; $this->availableKeywords = array(); foreach ($objectFields as $key => $value) { $this->availableKeywords[$key] = array('short'=>$key, 'long'=>$key); } } return $this->availableKeywords; } /** * Gets an associative array of data that can be accessed in * notification fields and templates * @return array */ public function getNotificationTemplateData() { return array(); } /** * Gets the list of recipients for a given notification event, based on this object's * state. * * @param string $event * The Identifier of the notification being sent */ public function getRecipients($event) { $member = new Member; $member->Email = 'dummy@nowhere.com'; $member->FirstName = "First"; $member->Surname = "Last"; return array($member); } } |