PluginProbe
MyRewards / trunk
MyRewards vtrunk
5.7.8 5.7.7 5.7.6 trunk 1.2.2 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.1 2.2.0 2.3.0 2.4.0 2.4.1 2.5.0 2.6.4 2.6.6 3.0.0.0 3.1.0 3.1.2 3.1.2.1 3.10.4 3.10.9 All 165 releases
woorewards / include / pointsflow / exportmethod.php

exportmethod.php in MyRewards trunk, at include/pointsflow/exportmethod.php

51 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace LWS\WOOREWARDS\PointsFlow;
3
4 // don't call the file directly
5 if( !defined( 'ABSPATH' ) ) exit();
6
7 /** Point export method extends this abstract and are placed in methods/ subdir. */
8 abstract class ExportMethod
9 {
10 /** @return (array) the json that will be send,
11 * An array with each entries as {email, points} */
12 abstract public function export($value, $arg);
13
14 /** @return (string) human readable name */
15 abstract public function getTitle();
16
17 /** @return (string) method identifier */
18 public function getKey()
19 {
20 return $this->formatKey($this);
21 }
22
23 /** @return (array) additionnal argument to pass to export.
24 * array is associatvie, only the key is passed to export, value is for display only. */
25 public function getArgs()
26 {
27 return array();
28 }
29
30 /** allow free user input.
31 * If no need of args, should return true */
32 public function supportFreeArgs()
33 {
34 return true;
35 }
36
37 /** @return (bool) appear in method combobox */
38 public function isVisible()
39 {
40 return true;
41 }
42
43 function formatKey($class)
44 {
45 if( is_object($class) )
46 $class = get_class($class);
47 return str_replace('\\', '_', strtolower($class));
48 }
49
50 }
51