| 1 |
<?php |
| 2 |
namespace LWS\WOOREWARDS\PointsFlow\Methods; |
| 3 |
|
| 4 |
// don't call the file directly |
| 5 |
if( !defined( 'ABSPATH' ) ) exit(); |
| 6 |
|
| 7 |
/** Get the total points for users. |
| 8 |
* @warning Sumo support float values, |
| 9 |
* that will be rounded (floor) at import in MyRewards (points are integer). */ |
| 10 |
class MyCred extends \LWS\WOOREWARDS\PointsFlow\Methods\MetaKey |
| 11 |
{ |
| 12 |
/** @return (array) the json that will be send, |
| 13 |
* An array with each entries as {email, points} */ |
| 14 |
public function export($value, $arg) |
| 15 |
{ |
| 16 |
return parent::export($arg, false); |
| 17 |
} |
| 18 |
|
| 19 |
public function getTitle() |
| 20 |
{ |
| 21 |
return __("myCRED", 'woorewards-lite'); |
| 22 |
} |
| 23 |
|
| 24 |
/** allow free user input */ |
| 25 |
public function supportFreeArgs() |
| 26 |
{ |
| 27 |
return false; |
| 28 |
} |
| 29 |
|
| 30 |
public function getArgs() |
| 31 |
{ |
| 32 |
$optionId = \apply_filters('mycred_get_option_id', 'mycred_types'); |
| 33 |
|
| 34 |
$pointTypes = \get_option($optionId, array()); |
| 35 |
if( $pointTypes && \is_array($pointTypes) ) |
| 36 |
return $pointTypes; |
| 37 |
else |
| 38 |
return array(); |
| 39 |
} |
| 40 |
} |
| 41 |
|