| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Freemius |
| 4 |
* @copyright Copyright (c) 2015, Freemius, Inc. |
| 5 |
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 |
| 6 |
* @since 1.0.3 |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
class FS_User extends FS_Scope_Entity { |
| 14 |
|
| 15 |
#region Properties |
| 16 |
|
| 17 |
/** |
| 18 |
* @var string |
| 19 |
*/ |
| 20 |
public $email; |
| 21 |
/** |
| 22 |
* @var string |
| 23 |
*/ |
| 24 |
public $first; |
| 25 |
/** |
| 26 |
* @var string |
| 27 |
*/ |
| 28 |
public $last; |
| 29 |
/** |
| 30 |
* @var bool |
| 31 |
*/ |
| 32 |
public $is_verified; |
| 33 |
/** |
| 34 |
* @author Leo Fajardo (@leorw) |
| 35 |
* @since 2.3.0 |
| 36 |
* |
| 37 |
* @var bool |
| 38 |
*/ |
| 39 |
public $is_beta; |
| 40 |
/** |
| 41 |
* @var string|null |
| 42 |
*/ |
| 43 |
public $customer_id; |
| 44 |
/** |
| 45 |
* @var float |
| 46 |
*/ |
| 47 |
public $gross; |
| 48 |
|
| 49 |
#endregion Properties |
| 50 |
|
| 51 |
/** |
| 52 |
* @param object|bool $user |
| 53 |
*/ |
| 54 |
function __construct( $user = false ) { |
| 55 |
parent::__construct( $user ); |
| 56 |
} |
| 57 |
|
| 58 |
function get_name() { |
| 59 |
return trim( ucfirst( trim( is_string( $this->first ) ? $this->first : '' ) ) . ' ' . ucfirst( trim( is_string( $this->last ) ? $this->last : '' ) ) ); |
| 60 |
} |
| 61 |
|
| 62 |
function is_verified() { |
| 63 |
return ( isset( $this->is_verified ) && true === $this->is_verified ); |
| 64 |
} |
| 65 |
|
| 66 |
/** |
| 67 |
* @author Leo Fajardo (@leorw) |
| 68 |
* @since 2.3.0 |
| 69 |
* |
| 70 |
* @return bool |
| 71 |
*/ |
| 72 |
function is_beta() { |
| 73 |
return ( isset( $this->is_beta ) && true === $this->is_beta ); |
| 74 |
} |
| 75 |
|
| 76 |
static function get_type() { |
| 77 |
return 'user'; |
| 78 |
} |
| 79 |
} |