Completed
Branch release-gh-workflow (107bf7)
by
unknown
06:53 queued 05:10
created
core/db_classes/EE_Event_Question_Group.class.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,23 +6,23 @@
 block discarded – undo
6 6
 class EE_Event_Question_Group extends EE_Base_Class
7 7
 {
8 8
 
9
-    /**
10
-     * @param array $props_n_values
11
-     * @return EE_Event_Question_Group|mixed
12
-     */
13
-    public static function new_instance($props_n_values = array())
14
-    {
15
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__);
16
-        return $has_object ? $has_object : new self($props_n_values);
17
-    }
9
+	/**
10
+	 * @param array $props_n_values
11
+	 * @return EE_Event_Question_Group|mixed
12
+	 */
13
+	public static function new_instance($props_n_values = array())
14
+	{
15
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
16
+		return $has_object ? $has_object : new self($props_n_values);
17
+	}
18 18
 
19 19
 
20
-    /**
21
-     * @param array $props_n_values
22
-     * @return EE_Event_Question_Group
23
-     */
24
-    public static function new_instance_from_db($props_n_values = array())
25
-    {
26
-        return new self($props_n_values, true);
27
-    }
20
+	/**
21
+	 * @param array $props_n_values
22
+	 * @return EE_Event_Question_Group
23
+	 */
24
+	public static function new_instance_from_db($props_n_values = array())
25
+	{
26
+		return new self($props_n_values, true);
27
+	}
28 28
 }
Please login to merge, or discard this patch.
core/db_classes/EE_Status.class.php 2 patches
Indentation   +138 added lines, -138 removed lines patch added patch discarded remove patch
@@ -12,142 +12,142 @@
 block discarded – undo
12 12
 class EE_Status extends EE_Base_Class
13 13
 {
14 14
 
15
-    /**
16
-     * @param array $props_n_values
17
-     * @return EE_Status
18
-     */
19
-    public static function new_instance($props_n_values = array())
20
-    {
21
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__);
22
-        return $has_object ? $has_object : new self($props_n_values);
23
-    }
24
-
25
-
26
-    /**
27
-     * @param array $props_n_values
28
-     * @return EE_Status
29
-     */
30
-    public static function new_instance_from_db($props_n_values = array())
31
-    {
32
-        return new self($props_n_values, true);
33
-    }
34
-
35
-
36
-    /**
37
-     * Gets code
38
-     *
39
-     * @param bool   $plural
40
-     * @param string $schema
41
-     * @return string
42
-     */
43
-    public function code($plural = false, $schema = 'upper')
44
-    {
45
-        $id = $this->get('STS_ID');
46
-        $code = EEM_Status::instance()->localized_status(array($id => $this->get('STS_code')), $plural, $schema);
47
-        return $code[ $id ];
48
-    }
49
-
50
-
51
-    /**
52
-     * Sets code
53
-     *
54
-     * @param string $code
55
-     * @return boolean
56
-     */
57
-    public function set_code($code)
58
-    {
59
-        $this->set('STS_code', $code);
60
-    }
61
-
62
-
63
-    /**
64
-     * Gets desc
65
-     *
66
-     * @return string
67
-     */
68
-    public function desc()
69
-    {
70
-        return $this->get('STS_desc');
71
-    }
72
-
73
-
74
-    /**
75
-     * Sets desc
76
-     *
77
-     * @param string $desc
78
-     * @return boolean
79
-     */
80
-    public function set_desc($desc)
81
-    {
82
-        $this->set('STS_desc', $desc);
83
-    }
84
-
85
-
86
-    /**
87
-     * Gets type
88
-     *
89
-     * @return string
90
-     */
91
-    public function type()
92
-    {
93
-        return $this->get('STS_type');
94
-    }
95
-
96
-
97
-    /**
98
-     * Sets type
99
-     *
100
-     * @param string $type
101
-     * @return boolean
102
-     */
103
-    public function set_type($type)
104
-    {
105
-        $this->set('STS_type', $type);
106
-    }
107
-
108
-
109
-    /**
110
-     * Gets can_edit
111
-     *
112
-     * @return boolean
113
-     */
114
-    public function can_edit()
115
-    {
116
-        return $this->get('STS_can_edit');
117
-    }
118
-
119
-
120
-    /**
121
-     * Sets can_edit
122
-     *
123
-     * @param boolean $can_edit
124
-     * @return boolean
125
-     */
126
-    public function set_can_edit($can_edit)
127
-    {
128
-        $this->set('STS_can_edit', $can_edit);
129
-    }
130
-
131
-
132
-    /**
133
-     * Gets open
134
-     *
135
-     * @return boolean
136
-     */
137
-    public function open()
138
-    {
139
-        return $this->get('STS_open');
140
-    }
141
-
142
-
143
-    /**
144
-     * Sets open
145
-     *
146
-     * @param boolean $open
147
-     * @return boolean
148
-     */
149
-    public function set_open($open)
150
-    {
151
-        $this->set('STS_open', $open);
152
-    }
15
+	/**
16
+	 * @param array $props_n_values
17
+	 * @return EE_Status
18
+	 */
19
+	public static function new_instance($props_n_values = array())
20
+	{
21
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
22
+		return $has_object ? $has_object : new self($props_n_values);
23
+	}
24
+
25
+
26
+	/**
27
+	 * @param array $props_n_values
28
+	 * @return EE_Status
29
+	 */
30
+	public static function new_instance_from_db($props_n_values = array())
31
+	{
32
+		return new self($props_n_values, true);
33
+	}
34
+
35
+
36
+	/**
37
+	 * Gets code
38
+	 *
39
+	 * @param bool   $plural
40
+	 * @param string $schema
41
+	 * @return string
42
+	 */
43
+	public function code($plural = false, $schema = 'upper')
44
+	{
45
+		$id = $this->get('STS_ID');
46
+		$code = EEM_Status::instance()->localized_status(array($id => $this->get('STS_code')), $plural, $schema);
47
+		return $code[ $id ];
48
+	}
49
+
50
+
51
+	/**
52
+	 * Sets code
53
+	 *
54
+	 * @param string $code
55
+	 * @return boolean
56
+	 */
57
+	public function set_code($code)
58
+	{
59
+		$this->set('STS_code', $code);
60
+	}
61
+
62
+
63
+	/**
64
+	 * Gets desc
65
+	 *
66
+	 * @return string
67
+	 */
68
+	public function desc()
69
+	{
70
+		return $this->get('STS_desc');
71
+	}
72
+
73
+
74
+	/**
75
+	 * Sets desc
76
+	 *
77
+	 * @param string $desc
78
+	 * @return boolean
79
+	 */
80
+	public function set_desc($desc)
81
+	{
82
+		$this->set('STS_desc', $desc);
83
+	}
84
+
85
+
86
+	/**
87
+	 * Gets type
88
+	 *
89
+	 * @return string
90
+	 */
91
+	public function type()
92
+	{
93
+		return $this->get('STS_type');
94
+	}
95
+
96
+
97
+	/**
98
+	 * Sets type
99
+	 *
100
+	 * @param string $type
101
+	 * @return boolean
102
+	 */
103
+	public function set_type($type)
104
+	{
105
+		$this->set('STS_type', $type);
106
+	}
107
+
108
+
109
+	/**
110
+	 * Gets can_edit
111
+	 *
112
+	 * @return boolean
113
+	 */
114
+	public function can_edit()
115
+	{
116
+		return $this->get('STS_can_edit');
117
+	}
118
+
119
+
120
+	/**
121
+	 * Sets can_edit
122
+	 *
123
+	 * @param boolean $can_edit
124
+	 * @return boolean
125
+	 */
126
+	public function set_can_edit($can_edit)
127
+	{
128
+		$this->set('STS_can_edit', $can_edit);
129
+	}
130
+
131
+
132
+	/**
133
+	 * Gets open
134
+	 *
135
+	 * @return boolean
136
+	 */
137
+	public function open()
138
+	{
139
+		return $this->get('STS_open');
140
+	}
141
+
142
+
143
+	/**
144
+	 * Sets open
145
+	 *
146
+	 * @param boolean $open
147
+	 * @return boolean
148
+	 */
149
+	public function set_open($open)
150
+	{
151
+		$this->set('STS_open', $open);
152
+	}
153 153
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
     {
45 45
         $id = $this->get('STS_ID');
46 46
         $code = EEM_Status::instance()->localized_status(array($id => $this->get('STS_code')), $plural, $schema);
47
-        return $code[ $id ];
47
+        return $code[$id];
48 48
     }
49 49
 
50 50
 
Please login to merge, or discard this patch.
core/db_classes/EE_Term.class.php 2 patches
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -12,87 +12,87 @@
 block discarded – undo
12 12
 class EE_Term extends EE_Base_Class
13 13
 {
14 14
 
15
-    public $post_type;
15
+	public $post_type;
16 16
 
17
-    /**
18
-     * Sets some dynamic defaults
19
-     *
20
-     * @param array  $fieldValues
21
-     * @param bool   $bydb
22
-     * @param string $timezone
23
-     */
24
-    protected function __construct($fieldValues = array(), $bydb = false, $timezone = '')
25
-    {
26
-        if (! isset($fieldValues['slug'])) {
27
-            $fieldValues['slug'] = $fieldValues['name'];
28
-        }
29
-        parent::__construct($fieldValues, $bydb, $timezone);
30
-    }
17
+	/**
18
+	 * Sets some dynamic defaults
19
+	 *
20
+	 * @param array  $fieldValues
21
+	 * @param bool   $bydb
22
+	 * @param string $timezone
23
+	 */
24
+	protected function __construct($fieldValues = array(), $bydb = false, $timezone = '')
25
+	{
26
+		if (! isset($fieldValues['slug'])) {
27
+			$fieldValues['slug'] = $fieldValues['name'];
28
+		}
29
+		parent::__construct($fieldValues, $bydb, $timezone);
30
+	}
31 31
 
32 32
 
33
-    /**
34
-     * @param array $props_n_values
35
-     * @return EE_Term|mixed
36
-     */
37
-    public static function new_instance($props_n_values = array())
38
-    {
39
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__);
40
-        return $has_object ? $has_object : new self($props_n_values);
41
-    }
33
+	/**
34
+	 * @param array $props_n_values
35
+	 * @return EE_Term|mixed
36
+	 */
37
+	public static function new_instance($props_n_values = array())
38
+	{
39
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
40
+		return $has_object ? $has_object : new self($props_n_values);
41
+	}
42 42
 
43 43
 
44
-    /**
45
-     * @param array $props_n_values
46
-     * @return EE_Term
47
-     */
48
-    public static function new_instance_from_db($props_n_values = array())
49
-    {
50
-        return new self($props_n_values, true);
51
-    }
44
+	/**
45
+	 * @param array $props_n_values
46
+	 * @return EE_Term
47
+	 */
48
+	public static function new_instance_from_db($props_n_values = array())
49
+	{
50
+		return new self($props_n_values, true);
51
+	}
52 52
 
53 53
 
54
-    /**
55
-     * Gets name
56
-     *
57
-     * @return string
58
-     */
59
-    public function name()
60
-    {
61
-        return $this->get('name');
62
-    }
54
+	/**
55
+	 * Gets name
56
+	 *
57
+	 * @return string
58
+	 */
59
+	public function name()
60
+	{
61
+		return $this->get('name');
62
+	}
63 63
 
64 64
 
65
-    /**
66
-     * Sets name
67
-     *
68
-     * @param string $name
69
-     * @return boolean
70
-     */
71
-    public function set_name($name)
72
-    {
73
-        $this->set('name', $name);
74
-    }
65
+	/**
66
+	 * Sets name
67
+	 *
68
+	 * @param string $name
69
+	 * @return boolean
70
+	 */
71
+	public function set_name($name)
72
+	{
73
+		$this->set('name', $name);
74
+	}
75 75
 
76 76
 
77
-    /**
78
-     * Gets slug
79
-     *
80
-     * @return string
81
-     */
82
-    public function slug()
83
-    {
84
-        return $this->get('slug');
85
-    }
77
+	/**
78
+	 * Gets slug
79
+	 *
80
+	 * @return string
81
+	 */
82
+	public function slug()
83
+	{
84
+		return $this->get('slug');
85
+	}
86 86
 
87 87
 
88
-    /**
89
-     * Sets slug
90
-     *
91
-     * @param string $slug
92
-     * @return boolean
93
-     */
94
-    public function set_slug($slug)
95
-    {
96
-        $this->set('slug', $slug);
97
-    }
88
+	/**
89
+	 * Sets slug
90
+	 *
91
+	 * @param string $slug
92
+	 * @return boolean
93
+	 */
94
+	public function set_slug($slug)
95
+	{
96
+		$this->set('slug', $slug);
97
+	}
98 98
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     protected function __construct($fieldValues = array(), $bydb = false, $timezone = '')
25 25
     {
26
-        if (! isset($fieldValues['slug'])) {
26
+        if ( ! isset($fieldValues['slug'])) {
27 27
             $fieldValues['slug'] = $fieldValues['name'];
28 28
         }
29 29
         parent::__construct($fieldValues, $bydb, $timezone);
Please login to merge, or discard this patch.
core/db_classes/EE_Registration_Payment.class.php 1 patch
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -14,98 +14,98 @@
 block discarded – undo
14 14
 class EE_Registration_Payment extends EE_Base_Class
15 15
 {
16 16
 
17
-    /**
18
-     *
19
-     * @param array  $props_n_values
20
-     * @param string $timezone
21
-     * @return EE_Registration_Payment
22
-     */
23
-    public static function new_instance($props_n_values = array(), $timezone = '', $date_formats = array())
24
-    {
25
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
26
-        return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
27
-    }
28
-
29
-
30
-    /**
31
-     * @param array  $props_n_values
32
-     * @param string $timezone
33
-     * @return EE_Registration_Payment
34
-     */
35
-    public static function new_instance_from_db($props_n_values = array(), $timezone = '')
36
-    {
37
-        return new self($props_n_values, true, $timezone);
38
-    }
39
-
40
-
41
-    /**
42
-     * registration_ID
43
-     *
44
-     * @access    public
45
-     * @return    int
46
-     */
47
-    public function registration_ID()
48
-    {
49
-        return $this->get('REG_ID');
50
-    }
51
-
52
-
53
-    /**
54
-     * payment_ID
55
-     *
56
-     * @access    public
57
-     * @return    int
58
-     */
59
-    public function payment_ID()
60
-    {
61
-        return $this->get('PAY_ID');
62
-    }
63
-
64
-
65
-    /**
66
-     * amount
67
-     *
68
-     * @access    public
69
-     * @return    float
70
-     */
71
-    public function amount()
72
-    {
73
-        return $this->get('RPY_amount');
74
-    }
75
-
76
-
77
-    /**
78
-     * amount
79
-     *
80
-     * @access    public
81
-     * @param float $amount
82
-     */
83
-    public function set_amount($amount = 0.000)
84
-    {
85
-        $this->set('RPY_amount', $amount);
86
-    }
87
-
88
-
89
-    /**
90
-     * registration
91
-     *
92
-     * @access    public
93
-     * @return \EE_Registration
94
-     */
95
-    public function registration()
96
-    {
97
-        return $this->get_first_related('Registration');
98
-    }
99
-
100
-
101
-    /**
102
-     * payment
103
-     *
104
-     * @access    public
105
-     * @return \EE_Payment
106
-     */
107
-    public function payment()
108
-    {
109
-        return $this->get_first_related('Payment');
110
-    }
17
+	/**
18
+	 *
19
+	 * @param array  $props_n_values
20
+	 * @param string $timezone
21
+	 * @return EE_Registration_Payment
22
+	 */
23
+	public static function new_instance($props_n_values = array(), $timezone = '', $date_formats = array())
24
+	{
25
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
26
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
27
+	}
28
+
29
+
30
+	/**
31
+	 * @param array  $props_n_values
32
+	 * @param string $timezone
33
+	 * @return EE_Registration_Payment
34
+	 */
35
+	public static function new_instance_from_db($props_n_values = array(), $timezone = '')
36
+	{
37
+		return new self($props_n_values, true, $timezone);
38
+	}
39
+
40
+
41
+	/**
42
+	 * registration_ID
43
+	 *
44
+	 * @access    public
45
+	 * @return    int
46
+	 */
47
+	public function registration_ID()
48
+	{
49
+		return $this->get('REG_ID');
50
+	}
51
+
52
+
53
+	/**
54
+	 * payment_ID
55
+	 *
56
+	 * @access    public
57
+	 * @return    int
58
+	 */
59
+	public function payment_ID()
60
+	{
61
+		return $this->get('PAY_ID');
62
+	}
63
+
64
+
65
+	/**
66
+	 * amount
67
+	 *
68
+	 * @access    public
69
+	 * @return    float
70
+	 */
71
+	public function amount()
72
+	{
73
+		return $this->get('RPY_amount');
74
+	}
75
+
76
+
77
+	/**
78
+	 * amount
79
+	 *
80
+	 * @access    public
81
+	 * @param float $amount
82
+	 */
83
+	public function set_amount($amount = 0.000)
84
+	{
85
+		$this->set('RPY_amount', $amount);
86
+	}
87
+
88
+
89
+	/**
90
+	 * registration
91
+	 *
92
+	 * @access    public
93
+	 * @return \EE_Registration
94
+	 */
95
+	public function registration()
96
+	{
97
+		return $this->get_first_related('Registration');
98
+	}
99
+
100
+
101
+	/**
102
+	 * payment
103
+	 *
104
+	 * @access    public
105
+	 * @return \EE_Payment
106
+	 */
107
+	public function payment()
108
+	{
109
+		return $this->get_first_related('Payment');
110
+	}
111 111
 }
Please login to merge, or discard this patch.
core/db_classes/EE_Question_Group_Question.class.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,23 +6,23 @@
 block discarded – undo
6 6
 class EE_Question_Group_Question extends EE_Base_Class
7 7
 {
8 8
 
9
-    /**
10
-     * @param array $props_n_values
11
-     * @return EE_Question_Group_Question|mixed
12
-     */
13
-    public static function new_instance($props_n_values = array())
14
-    {
15
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__);
16
-        return $has_object ? $has_object : new self($props_n_values);
17
-    }
9
+	/**
10
+	 * @param array $props_n_values
11
+	 * @return EE_Question_Group_Question|mixed
12
+	 */
13
+	public static function new_instance($props_n_values = array())
14
+	{
15
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
16
+		return $has_object ? $has_object : new self($props_n_values);
17
+	}
18 18
 
19 19
 
20
-    /**
21
-     * @param array $props_n_values
22
-     * @return EE_Question_Group_Question
23
-     */
24
-    public static function new_instance_from_db($props_n_values = array())
25
-    {
26
-        return new self($props_n_values, true);
27
-    }
20
+	/**
21
+	 * @param array $props_n_values
22
+	 * @return EE_Question_Group_Question
23
+	 */
24
+	public static function new_instance_from_db($props_n_values = array())
25
+	{
26
+		return new self($props_n_values, true);
27
+	}
28 28
 }
Please login to merge, or discard this patch.
core/db_classes/EE_State.class.php 1 patch
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -11,104 +11,104 @@
 block discarded – undo
11 11
 class EE_State extends EE_Base_Class
12 12
 {
13 13
 
14
-    /**
15
-     * @param array $props_n_values
16
-     * @return EE_State|mixed
17
-     */
18
-    public static function new_instance($props_n_values = array())
19
-    {
20
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__);
21
-        return $has_object ? $has_object : new self($props_n_values);
22
-    }
23
-
24
-
25
-    /**
26
-     * @param array $props_n_values
27
-     * @return EE_State
28
-     */
29
-    public static function new_instance_from_db($props_n_values = array())
30
-    {
31
-        return new self($props_n_values, true);
32
-    }
33
-
34
-
35
-    /**
36
-     * @return string
37
-     */
38
-    public function country_iso()
39
-    {
40
-        return $this->get('CNT_ISO');
41
-    }
42
-
43
-
44
-    /**
45
-     * @return string
46
-     */
47
-    public function abbrev()
48
-    {
49
-        return $this->get('STA_abbrev');
50
-    }
51
-
52
-
53
-    /**
54
-     * @return bool
55
-     */
56
-    public function active()
57
-    {
58
-        return $this->get('STA_active');
59
-    }
60
-
61
-
62
-    /**
63
-     * @return string
64
-     */
65
-    public function name()
66
-    {
67
-        return $this->get('STA_name');
68
-    }
69
-
70
-
71
-    /**
72
-     * @return EE_Country
73
-     */
74
-    public function country()
75
-    {
76
-        return $this->get_first_related('Country');
77
-    }
78
-
79
-
80
-    /**
81
-     * @param $iso
82
-     */
83
-    public function set_country_iso($iso)
84
-    {
85
-        $this->set('CNT_ISO', $iso);
86
-    }
87
-
88
-
89
-    /**
90
-     * @param $abbrev
91
-     */
92
-    public function set_abbrev($abbrev)
93
-    {
94
-        $this->set('STA_abbrev', $abbrev);
95
-    }
96
-
97
-
98
-    /**
99
-     * @param $active
100
-     */
101
-    public function set_active($active)
102
-    {
103
-        $this->set('STA_active', $active);
104
-    }
105
-
106
-
107
-    /**
108
-     * @param $name
109
-     */
110
-    public function set_name($name)
111
-    {
112
-        $this->set('STA_name', $name);
113
-    }
14
+	/**
15
+	 * @param array $props_n_values
16
+	 * @return EE_State|mixed
17
+	 */
18
+	public static function new_instance($props_n_values = array())
19
+	{
20
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__);
21
+		return $has_object ? $has_object : new self($props_n_values);
22
+	}
23
+
24
+
25
+	/**
26
+	 * @param array $props_n_values
27
+	 * @return EE_State
28
+	 */
29
+	public static function new_instance_from_db($props_n_values = array())
30
+	{
31
+		return new self($props_n_values, true);
32
+	}
33
+
34
+
35
+	/**
36
+	 * @return string
37
+	 */
38
+	public function country_iso()
39
+	{
40
+		return $this->get('CNT_ISO');
41
+	}
42
+
43
+
44
+	/**
45
+	 * @return string
46
+	 */
47
+	public function abbrev()
48
+	{
49
+		return $this->get('STA_abbrev');
50
+	}
51
+
52
+
53
+	/**
54
+	 * @return bool
55
+	 */
56
+	public function active()
57
+	{
58
+		return $this->get('STA_active');
59
+	}
60
+
61
+
62
+	/**
63
+	 * @return string
64
+	 */
65
+	public function name()
66
+	{
67
+		return $this->get('STA_name');
68
+	}
69
+
70
+
71
+	/**
72
+	 * @return EE_Country
73
+	 */
74
+	public function country()
75
+	{
76
+		return $this->get_first_related('Country');
77
+	}
78
+
79
+
80
+	/**
81
+	 * @param $iso
82
+	 */
83
+	public function set_country_iso($iso)
84
+	{
85
+		$this->set('CNT_ISO', $iso);
86
+	}
87
+
88
+
89
+	/**
90
+	 * @param $abbrev
91
+	 */
92
+	public function set_abbrev($abbrev)
93
+	{
94
+		$this->set('STA_abbrev', $abbrev);
95
+	}
96
+
97
+
98
+	/**
99
+	 * @param $active
100
+	 */
101
+	public function set_active($active)
102
+	{
103
+		$this->set('STA_active', $active);
104
+	}
105
+
106
+
107
+	/**
108
+	 * @param $name
109
+	 */
110
+	public function set_name($name)
111
+	{
112
+		$this->set('STA_name', $name);
113
+	}
114 114
 }
Please login to merge, or discard this patch.
core/db_classes/EE_Attendee.class.php 2 patches
Indentation   +742 added lines, -742 removed lines patch added patch discarded remove patch
@@ -25,746 +25,746 @@
 block discarded – undo
25 25
 class EE_Attendee extends EE_CPT_Base implements EEI_Contact, EEI_Address, EEI_Admin_Links, EEI_Attendee
26 26
 {
27 27
 
28
-    /**
29
-     * Sets some dynamic defaults
30
-     *
31
-     * @param array  $fieldValues
32
-     * @param bool   $bydb
33
-     * @param string $timezone
34
-     * @param array  $date_formats
35
-     * @throws EE_Error
36
-     */
37
-    protected function __construct($fieldValues = null, $bydb = false, $timezone = null, $date_formats = array())
38
-    {
39
-        if (! isset($fieldValues['ATT_full_name'])) {
40
-            $fname = isset($fieldValues['ATT_fname']) ? $fieldValues['ATT_fname'] . ' ' : '';
41
-            $lname = isset($fieldValues['ATT_lname']) ? $fieldValues['ATT_lname'] : '';
42
-            $fieldValues['ATT_full_name'] = $fname . $lname;
43
-        }
44
-        if (! isset($fieldValues['ATT_slug'])) {
45
-            // $fieldValues['ATT_slug'] = sanitize_key(wp_generate_password(20));
46
-            $fieldValues['ATT_slug'] = sanitize_title($fieldValues['ATT_full_name']);
47
-        }
48
-        if (! isset($fieldValues['ATT_short_bio']) && isset($fieldValues['ATT_bio'])) {
49
-            $fieldValues['ATT_short_bio'] = substr($fieldValues['ATT_bio'], 0, 50);
50
-        }
51
-        parent::__construct($fieldValues, $bydb, $timezone, $date_formats);
52
-    }
53
-
54
-
55
-    /**
56
-     * @param array  $props_n_values          incoming values
57
-     * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
58
-     *                                        used.)
59
-     * @param array  $date_formats            incoming date_formats in an array where the first value is the
60
-     *                                        date_format and the second value is the time format
61
-     * @return EE_Attendee
62
-     * @throws EE_Error
63
-     */
64
-    public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array())
65
-    {
66
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
67
-        return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
68
-    }
69
-
70
-
71
-    /**
72
-     * @param array  $props_n_values  incoming values from the database
73
-     * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
74
-     *                                the website will be used.
75
-     * @return EE_Attendee
76
-     */
77
-    public static function new_instance_from_db($props_n_values = array(), $timezone = null)
78
-    {
79
-        return new self($props_n_values, true, $timezone);
80
-    }
81
-
82
-
83
-    /**
84
-     *        Set Attendee First Name
85
-     *
86
-     * @access        public
87
-     * @param string $fname
88
-     * @throws EE_Error
89
-     */
90
-    public function set_fname($fname = '')
91
-    {
92
-        $this->set('ATT_fname', $fname);
93
-    }
94
-
95
-
96
-    /**
97
-     *        Set Attendee Last Name
98
-     *
99
-     * @access        public
100
-     * @param string $lname
101
-     * @throws EE_Error
102
-     */
103
-    public function set_lname($lname = '')
104
-    {
105
-        $this->set('ATT_lname', $lname);
106
-    }
107
-
108
-
109
-    /**
110
-     *        Set Attendee Address
111
-     *
112
-     * @access        public
113
-     * @param string $address
114
-     * @throws EE_Error
115
-     */
116
-    public function set_address($address = '')
117
-    {
118
-        $this->set('ATT_address', $address);
119
-    }
120
-
121
-
122
-    /**
123
-     *        Set Attendee Address2
124
-     *
125
-     * @access        public
126
-     * @param        string $address2
127
-     * @throws EE_Error
128
-     */
129
-    public function set_address2($address2 = '')
130
-    {
131
-        $this->set('ATT_address2', $address2);
132
-    }
133
-
134
-
135
-    /**
136
-     *        Set Attendee City
137
-     *
138
-     * @access        public
139
-     * @param        string $city
140
-     * @throws EE_Error
141
-     */
142
-    public function set_city($city = '')
143
-    {
144
-        $this->set('ATT_city', $city);
145
-    }
146
-
147
-
148
-    /**
149
-     *        Set Attendee State ID
150
-     *
151
-     * @access        public
152
-     * @param        int $STA_ID
153
-     * @throws EE_Error
154
-     */
155
-    public function set_state($STA_ID = 0)
156
-    {
157
-        $this->set('STA_ID', $STA_ID);
158
-    }
159
-
160
-
161
-    /**
162
-     *        Set Attendee Country ISO Code
163
-     *
164
-     * @access        public
165
-     * @param        string $CNT_ISO
166
-     * @throws EE_Error
167
-     */
168
-    public function set_country($CNT_ISO = '')
169
-    {
170
-        $this->set('CNT_ISO', $CNT_ISO);
171
-    }
172
-
173
-
174
-    /**
175
-     *        Set Attendee Zip/Postal Code
176
-     *
177
-     * @access        public
178
-     * @param        string $zip
179
-     * @throws EE_Error
180
-     */
181
-    public function set_zip($zip = '')
182
-    {
183
-        $this->set('ATT_zip', $zip);
184
-    }
185
-
186
-
187
-    /**
188
-     *        Set Attendee Email Address
189
-     *
190
-     * @access        public
191
-     * @param        string $email
192
-     * @throws EE_Error
193
-     */
194
-    public function set_email($email = '')
195
-    {
196
-        $this->set('ATT_email', $email);
197
-    }
198
-
199
-
200
-    /**
201
-     *        Set Attendee Phone
202
-     *
203
-     * @access        public
204
-     * @param        string $phone
205
-     * @throws EE_Error
206
-     */
207
-    public function set_phone($phone = '')
208
-    {
209
-        $this->set('ATT_phone', $phone);
210
-    }
211
-
212
-
213
-    /**
214
-     *        set deleted
215
-     *
216
-     * @access        public
217
-     * @param        bool $ATT_deleted
218
-     * @throws EE_Error
219
-     */
220
-    public function set_deleted($ATT_deleted = false)
221
-    {
222
-        $this->set('ATT_deleted', $ATT_deleted);
223
-    }
224
-
225
-
226
-    /**
227
-     * Returns the value for the post_author id saved with the cpt
228
-     *
229
-     * @since 4.5.0
230
-     * @return int
231
-     * @throws EE_Error
232
-     */
233
-    public function wp_user()
234
-    {
235
-        return $this->get('ATT_author');
236
-    }
237
-
238
-
239
-    /**
240
-     *        get Attendee First Name
241
-     *
242
-     * @access        public
243
-     * @return string
244
-     * @throws EE_Error
245
-     */
246
-    public function fname()
247
-    {
248
-        return $this->get('ATT_fname');
249
-    }
250
-
251
-
252
-    /**
253
-     * echoes out the attendee's first name
254
-     *
255
-     * @return void
256
-     * @throws EE_Error
257
-     */
258
-    public function e_full_name()
259
-    {
260
-        echo $this->full_name();
261
-    }
262
-
263
-
264
-    /**
265
-     * Returns the first and last name concatenated together with a space.
266
-     *
267
-     * @param bool $apply_html_entities
268
-     * @return string
269
-     * @throws EE_Error
270
-     */
271
-    public function full_name($apply_html_entities = false)
272
-    {
273
-        $full_name = array(
274
-            $this->fname(),
275
-            $this->lname(),
276
-        );
277
-        $full_name = array_filter($full_name);
278
-        $full_name = implode(' ', $full_name);
279
-        return $apply_html_entities ? htmlentities($full_name, ENT_QUOTES, 'UTF-8') : $full_name;
280
-    }
281
-
282
-
283
-    /**
284
-     * This returns the value of the `ATT_full_name` field which is usually equivalent to calling `full_name()` unless
285
-     * the post_title field has been directly modified in the db for the post (espresso_attendees post type) for this
286
-     * attendee.
287
-     *
288
-     * @param bool $apply_html_entities
289
-     * @return string
290
-     * @throws EE_Error
291
-     */
292
-    public function ATT_full_name($apply_html_entities = false)
293
-    {
294
-        return $apply_html_entities
295
-            ? htmlentities($this->get('ATT_full_name'), ENT_QUOTES, 'UTF-8')
296
-            : $this->get('ATT_full_name');
297
-    }
298
-
299
-
300
-    /**
301
-     *        get Attendee Last Name
302
-     *
303
-     * @access        public
304
-     * @return string
305
-     * @throws EE_Error
306
-     */
307
-    public function lname()
308
-    {
309
-        return $this->get('ATT_lname');
310
-    }
311
-
312
-
313
-    /**
314
-     * Gets the attendee's full address as an array so client code can decide hwo to display it
315
-     *
316
-     * @return array numerically indexed, with each part of the address that is known.
317
-     * Eg, if the user only responded to state and country,
318
-     * it would be array(0=>'Alabama',1=>'USA')
319
-     * @return array
320
-     * @throws EE_Error
321
-     */
322
-    public function full_address_as_array()
323
-    {
324
-        $full_address_array = array();
325
-        $initial_address_fields = array('ATT_address', 'ATT_address2', 'ATT_city',);
326
-        foreach ($initial_address_fields as $address_field_name) {
327
-            $address_fields_value = $this->get($address_field_name);
328
-            if (! empty($address_fields_value)) {
329
-                $full_address_array[] = $address_fields_value;
330
-            }
331
-        }
332
-        // now handle state and country
333
-        $state_obj = $this->state_obj();
334
-        if ($state_obj instanceof EE_State) {
335
-            $full_address_array[] = $state_obj->name();
336
-        }
337
-        $country_obj = $this->country_obj();
338
-        if ($country_obj instanceof EE_Country) {
339
-            $full_address_array[] = $country_obj->name();
340
-        }
341
-        // lastly get the xip
342
-        $zip_value = $this->zip();
343
-        if (! empty($zip_value)) {
344
-            $full_address_array[] = $zip_value;
345
-        }
346
-        return $full_address_array;
347
-    }
348
-
349
-
350
-    /**
351
-     *        get Attendee Address
352
-     *
353
-     * @return string
354
-     * @throws EE_Error
355
-     */
356
-    public function address()
357
-    {
358
-        return $this->get('ATT_address');
359
-    }
360
-
361
-
362
-    /**
363
-     *        get Attendee Address2
364
-     *
365
-     * @return string
366
-     * @throws EE_Error
367
-     */
368
-    public function address2()
369
-    {
370
-        return $this->get('ATT_address2');
371
-    }
372
-
373
-
374
-    /**
375
-     *        get Attendee City
376
-     *
377
-     * @return string
378
-     * @throws EE_Error
379
-     */
380
-    public function city()
381
-    {
382
-        return $this->get('ATT_city');
383
-    }
384
-
385
-
386
-    /**
387
-     *        get Attendee State ID
388
-     *
389
-     * @return string
390
-     * @throws EE_Error
391
-     */
392
-    public function state_ID()
393
-    {
394
-        return $this->get('STA_ID');
395
-    }
396
-
397
-
398
-    /**
399
-     * @return string
400
-     * @throws EE_Error
401
-     */
402
-    public function state_abbrev()
403
-    {
404
-        return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : '';
405
-    }
406
-
407
-
408
-    /**
409
-     * Gets the state set to this attendee
410
-     *
411
-     * @return EE_State
412
-     * @throws EE_Error
413
-     */
414
-    public function state_obj()
415
-    {
416
-        return $this->get_first_related('State');
417
-    }
418
-
419
-
420
-    /**
421
-     * Returns the state's name, otherwise 'Unknown'
422
-     *
423
-     * @return string
424
-     * @throws EE_Error
425
-     */
426
-    public function state_name()
427
-    {
428
-        if ($this->state_obj()) {
429
-            return $this->state_obj()->name();
430
-        } else {
431
-            return '';
432
-        }
433
-    }
434
-
435
-
436
-    /**
437
-     * either displays the state abbreviation or the state name, as determined
438
-     * by the "FHEE__EEI_Address__state__use_abbreviation" filter.
439
-     * defaults to abbreviation
440
-     *
441
-     * @return string
442
-     * @throws EE_Error
443
-     */
444
-    public function state()
445
-    {
446
-        if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) {
447
-            return $this->state_abbrev();
448
-        }
449
-        return $this->state_name();
450
-    }
451
-
452
-
453
-    /**
454
-     *    get Attendee Country ISO Code
455
-     *
456
-     * @return string
457
-     * @throws EE_Error
458
-     */
459
-    public function country_ID()
460
-    {
461
-        return $this->get('CNT_ISO');
462
-    }
463
-
464
-
465
-    /**
466
-     * Gets country set for this attendee
467
-     *
468
-     * @return EE_Country
469
-     * @throws EE_Error
470
-     */
471
-    public function country_obj()
472
-    {
473
-        return $this->get_first_related('Country');
474
-    }
475
-
476
-
477
-    /**
478
-     * Returns the country's name if known, otherwise 'Unknown'
479
-     *
480
-     * @return string
481
-     * @throws EE_Error
482
-     */
483
-    public function country_name()
484
-    {
485
-        if ($this->country_obj()) {
486
-            return $this->country_obj()->name();
487
-        }
488
-        return '';
489
-    }
490
-
491
-
492
-    /**
493
-     * either displays the country ISO2 code or the country name, as determined
494
-     * by the "FHEE__EEI_Address__country__use_abbreviation" filter.
495
-     * defaults to abbreviation
496
-     *
497
-     * @return string
498
-     * @throws EE_Error
499
-     */
500
-    public function country()
501
-    {
502
-        if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) {
503
-            return $this->country_ID();
504
-        }
505
-        return $this->country_name();
506
-    }
507
-
508
-
509
-    /**
510
-     *        get Attendee Zip/Postal Code
511
-     *
512
-     * @return string
513
-     * @throws EE_Error
514
-     */
515
-    public function zip()
516
-    {
517
-        return $this->get('ATT_zip');
518
-    }
519
-
520
-
521
-    /**
522
-     *        get Attendee Email Address
523
-     *
524
-     * @return string
525
-     * @throws EE_Error
526
-     */
527
-    public function email()
528
-    {
529
-        return $this->get('ATT_email');
530
-    }
531
-
532
-
533
-    /**
534
-     *        get Attendee Phone #
535
-     *
536
-     * @return string
537
-     * @throws EE_Error
538
-     */
539
-    public function phone()
540
-    {
541
-        return $this->get('ATT_phone');
542
-    }
543
-
544
-
545
-    /**
546
-     *    get deleted
547
-     *
548
-     * @return        bool
549
-     * @throws EE_Error
550
-     */
551
-    public function deleted()
552
-    {
553
-        return $this->get('ATT_deleted');
554
-    }
555
-
556
-
557
-    /**
558
-     * Gets registrations of this attendee
559
-     *
560
-     * @param array $query_params
561
-     * @return EE_Registration[]
562
-     * @throws EE_Error
563
-     */
564
-    public function get_registrations($query_params = array())
565
-    {
566
-        return $this->get_many_related('Registration', $query_params);
567
-    }
568
-
569
-
570
-    /**
571
-     * Gets the most recent registration of this attendee
572
-     *
573
-     * @return EE_Registration
574
-     * @throws EE_Error
575
-     */
576
-    public function get_most_recent_registration()
577
-    {
578
-        return $this->get_first_related(
579
-            'Registration',
580
-            array('order_by' => array('REG_date' => 'DESC'))
581
-        ); // null, 'REG_date', 'DESC', '=', 'OBJECT_K');
582
-    }
583
-
584
-
585
-    /**
586
-     * Gets the most recent registration for this attend at this event
587
-     *
588
-     * @param int $event_id
589
-     * @return EE_Registration
590
-     * @throws EE_Error
591
-     */
592
-    public function get_most_recent_registration_for_event($event_id)
593
-    {
594
-        return $this->get_first_related(
595
-            'Registration',
596
-            array(array('EVT_ID' => $event_id), 'order_by' => array('REG_date' => 'DESC'))
597
-        );
598
-    }
599
-
600
-
601
-    /**
602
-     * returns any events attached to this attendee ($_Event property);
603
-     *
604
-     * @return array
605
-     * @throws EE_Error
606
-     */
607
-    public function events()
608
-    {
609
-        return $this->get_many_related('Event');
610
-    }
611
-
612
-
613
-    /**
614
-     * Gets the billing info array where keys match espresso_reg_page_billing_inputs(),
615
-     * and keys are their cleaned values. @see EE_Attendee::save_and_clean_billing_info_for_payment_method() which was
616
-     * used to save the billing info
617
-     *
618
-     * @param EE_Payment_Method $payment_method the _gateway_name property on the gateway class
619
-     * @return EE_Form_Section_Proper|null
620
-     * @throws EE_Error
621
-     */
622
-    public function billing_info_for_payment_method($payment_method)
623
-    {
624
-        $pm_type = $payment_method->type_obj();
625
-        if (! $pm_type instanceof EE_PMT_Base) {
626
-            return null;
627
-        }
628
-        $billing_info = $this->get_post_meta($this->get_billing_info_postmeta_name($payment_method), true);
629
-        if (! $billing_info) {
630
-            return null;
631
-        }
632
-        $billing_form = $pm_type->billing_form();
633
-        // double-check the form isn't totally hidden, in which case pretend there is no form
634
-        $form_totally_hidden = true;
635
-        foreach ($billing_form->inputs_in_subsections() as $input) {
636
-            if (! $input->get_display_strategy() instanceof EE_Hidden_Display_Strategy) {
637
-                $form_totally_hidden = false;
638
-                break;
639
-            }
640
-        }
641
-        if ($form_totally_hidden) {
642
-            return null;
643
-        }
644
-        if ($billing_form instanceof EE_Form_Section_Proper) {
645
-            $billing_form->receive_form_submission(array($billing_form->name() => $billing_info), false);
646
-        }
647
-
648
-        return $billing_form;
649
-    }
650
-
651
-
652
-    /**
653
-     * Gets the postmeta key that holds this attendee's billing info for the
654
-     * specified payment method
655
-     *
656
-     * @param EE_Payment_Method $payment_method
657
-     * @return string
658
-     * @throws EE_Error
659
-     */
660
-    public function get_billing_info_postmeta_name($payment_method)
661
-    {
662
-        if ($payment_method->type_obj() instanceof EE_PMT_Base) {
663
-            return 'billing_info_' . $payment_method->type_obj()->system_name();
664
-        }
665
-        return null;
666
-    }
667
-
668
-
669
-    /**
670
-     * Saves the billing info to the attendee. @see EE_Attendee::billing_info_for_payment_method() which is used to
671
-     * retrieve it
672
-     *
673
-     * @param EE_Billing_Attendee_Info_Form $billing_form
674
-     * @param EE_Payment_Method             $payment_method
675
-     * @return boolean
676
-     * @throws EE_Error
677
-     */
678
-    public function save_and_clean_billing_info_for_payment_method($billing_form, $payment_method)
679
-    {
680
-        if (! $billing_form instanceof EE_Billing_Attendee_Info_Form) {
681
-            EE_Error::add_error(__('Cannot save billing info because there is none.', 'event_espresso'));
682
-            return false;
683
-        }
684
-        $billing_form->clean_sensitive_data();
685
-        return update_post_meta(
686
-            $this->ID(),
687
-            $this->get_billing_info_postmeta_name($payment_method),
688
-            $billing_form->input_values(true)
689
-        );
690
-    }
691
-
692
-
693
-    /**
694
-     * Return the link to the admin details for the object.
695
-     *
696
-     * @return string
697
-     * @throws EE_Error
698
-     * @throws InvalidArgumentException
699
-     * @throws InvalidDataTypeException
700
-     * @throws InvalidInterfaceException
701
-     * @throws ReflectionException
702
-     */
703
-    public function get_admin_details_link()
704
-    {
705
-        return $this->get_admin_edit_link();
706
-    }
707
-
708
-
709
-    /**
710
-     * Returns the link to the editor for the object.  Sometimes this is the same as the details.
711
-     *
712
-     * @return string
713
-     * @throws EE_Error
714
-     * @throws InvalidArgumentException
715
-     * @throws ReflectionException
716
-     * @throws InvalidDataTypeException
717
-     * @throws InvalidInterfaceException
718
-     */
719
-    public function get_admin_edit_link()
720
-    {
721
-        EE_Registry::instance()->load_helper('URL');
722
-        return EEH_URL::add_query_args_and_nonce(
723
-            array(
724
-                'page'   => 'espresso_registrations',
725
-                'action' => 'edit_attendee',
726
-                'post'   => $this->ID(),
727
-            ),
728
-            admin_url('admin.php')
729
-        );
730
-    }
731
-
732
-
733
-    /**
734
-     * Returns the link to a settings page for the object.
735
-     *
736
-     * @return string
737
-     * @throws EE_Error
738
-     * @throws InvalidArgumentException
739
-     * @throws InvalidDataTypeException
740
-     * @throws InvalidInterfaceException
741
-     * @throws ReflectionException
742
-     */
743
-    public function get_admin_settings_link()
744
-    {
745
-        return $this->get_admin_edit_link();
746
-    }
747
-
748
-
749
-    /**
750
-     * Returns the link to the "overview" for the object (typically the "list table" view).
751
-     *
752
-     * @return string
753
-     * @throws EE_Error
754
-     * @throws InvalidArgumentException
755
-     * @throws ReflectionException
756
-     * @throws InvalidDataTypeException
757
-     * @throws InvalidInterfaceException
758
-     */
759
-    public function get_admin_overview_link()
760
-    {
761
-        EE_Registry::instance()->load_helper('URL');
762
-        return EEH_URL::add_query_args_and_nonce(
763
-            array(
764
-                'page'   => 'espresso_registrations',
765
-                'action' => 'contact_list',
766
-            ),
767
-            admin_url('admin.php')
768
-        );
769
-    }
28
+	/**
29
+	 * Sets some dynamic defaults
30
+	 *
31
+	 * @param array  $fieldValues
32
+	 * @param bool   $bydb
33
+	 * @param string $timezone
34
+	 * @param array  $date_formats
35
+	 * @throws EE_Error
36
+	 */
37
+	protected function __construct($fieldValues = null, $bydb = false, $timezone = null, $date_formats = array())
38
+	{
39
+		if (! isset($fieldValues['ATT_full_name'])) {
40
+			$fname = isset($fieldValues['ATT_fname']) ? $fieldValues['ATT_fname'] . ' ' : '';
41
+			$lname = isset($fieldValues['ATT_lname']) ? $fieldValues['ATT_lname'] : '';
42
+			$fieldValues['ATT_full_name'] = $fname . $lname;
43
+		}
44
+		if (! isset($fieldValues['ATT_slug'])) {
45
+			// $fieldValues['ATT_slug'] = sanitize_key(wp_generate_password(20));
46
+			$fieldValues['ATT_slug'] = sanitize_title($fieldValues['ATT_full_name']);
47
+		}
48
+		if (! isset($fieldValues['ATT_short_bio']) && isset($fieldValues['ATT_bio'])) {
49
+			$fieldValues['ATT_short_bio'] = substr($fieldValues['ATT_bio'], 0, 50);
50
+		}
51
+		parent::__construct($fieldValues, $bydb, $timezone, $date_formats);
52
+	}
53
+
54
+
55
+	/**
56
+	 * @param array  $props_n_values          incoming values
57
+	 * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
58
+	 *                                        used.)
59
+	 * @param array  $date_formats            incoming date_formats in an array where the first value is the
60
+	 *                                        date_format and the second value is the time format
61
+	 * @return EE_Attendee
62
+	 * @throws EE_Error
63
+	 */
64
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array())
65
+	{
66
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
67
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
68
+	}
69
+
70
+
71
+	/**
72
+	 * @param array  $props_n_values  incoming values from the database
73
+	 * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
74
+	 *                                the website will be used.
75
+	 * @return EE_Attendee
76
+	 */
77
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null)
78
+	{
79
+		return new self($props_n_values, true, $timezone);
80
+	}
81
+
82
+
83
+	/**
84
+	 *        Set Attendee First Name
85
+	 *
86
+	 * @access        public
87
+	 * @param string $fname
88
+	 * @throws EE_Error
89
+	 */
90
+	public function set_fname($fname = '')
91
+	{
92
+		$this->set('ATT_fname', $fname);
93
+	}
94
+
95
+
96
+	/**
97
+	 *        Set Attendee Last Name
98
+	 *
99
+	 * @access        public
100
+	 * @param string $lname
101
+	 * @throws EE_Error
102
+	 */
103
+	public function set_lname($lname = '')
104
+	{
105
+		$this->set('ATT_lname', $lname);
106
+	}
107
+
108
+
109
+	/**
110
+	 *        Set Attendee Address
111
+	 *
112
+	 * @access        public
113
+	 * @param string $address
114
+	 * @throws EE_Error
115
+	 */
116
+	public function set_address($address = '')
117
+	{
118
+		$this->set('ATT_address', $address);
119
+	}
120
+
121
+
122
+	/**
123
+	 *        Set Attendee Address2
124
+	 *
125
+	 * @access        public
126
+	 * @param        string $address2
127
+	 * @throws EE_Error
128
+	 */
129
+	public function set_address2($address2 = '')
130
+	{
131
+		$this->set('ATT_address2', $address2);
132
+	}
133
+
134
+
135
+	/**
136
+	 *        Set Attendee City
137
+	 *
138
+	 * @access        public
139
+	 * @param        string $city
140
+	 * @throws EE_Error
141
+	 */
142
+	public function set_city($city = '')
143
+	{
144
+		$this->set('ATT_city', $city);
145
+	}
146
+
147
+
148
+	/**
149
+	 *        Set Attendee State ID
150
+	 *
151
+	 * @access        public
152
+	 * @param        int $STA_ID
153
+	 * @throws EE_Error
154
+	 */
155
+	public function set_state($STA_ID = 0)
156
+	{
157
+		$this->set('STA_ID', $STA_ID);
158
+	}
159
+
160
+
161
+	/**
162
+	 *        Set Attendee Country ISO Code
163
+	 *
164
+	 * @access        public
165
+	 * @param        string $CNT_ISO
166
+	 * @throws EE_Error
167
+	 */
168
+	public function set_country($CNT_ISO = '')
169
+	{
170
+		$this->set('CNT_ISO', $CNT_ISO);
171
+	}
172
+
173
+
174
+	/**
175
+	 *        Set Attendee Zip/Postal Code
176
+	 *
177
+	 * @access        public
178
+	 * @param        string $zip
179
+	 * @throws EE_Error
180
+	 */
181
+	public function set_zip($zip = '')
182
+	{
183
+		$this->set('ATT_zip', $zip);
184
+	}
185
+
186
+
187
+	/**
188
+	 *        Set Attendee Email Address
189
+	 *
190
+	 * @access        public
191
+	 * @param        string $email
192
+	 * @throws EE_Error
193
+	 */
194
+	public function set_email($email = '')
195
+	{
196
+		$this->set('ATT_email', $email);
197
+	}
198
+
199
+
200
+	/**
201
+	 *        Set Attendee Phone
202
+	 *
203
+	 * @access        public
204
+	 * @param        string $phone
205
+	 * @throws EE_Error
206
+	 */
207
+	public function set_phone($phone = '')
208
+	{
209
+		$this->set('ATT_phone', $phone);
210
+	}
211
+
212
+
213
+	/**
214
+	 *        set deleted
215
+	 *
216
+	 * @access        public
217
+	 * @param        bool $ATT_deleted
218
+	 * @throws EE_Error
219
+	 */
220
+	public function set_deleted($ATT_deleted = false)
221
+	{
222
+		$this->set('ATT_deleted', $ATT_deleted);
223
+	}
224
+
225
+
226
+	/**
227
+	 * Returns the value for the post_author id saved with the cpt
228
+	 *
229
+	 * @since 4.5.0
230
+	 * @return int
231
+	 * @throws EE_Error
232
+	 */
233
+	public function wp_user()
234
+	{
235
+		return $this->get('ATT_author');
236
+	}
237
+
238
+
239
+	/**
240
+	 *        get Attendee First Name
241
+	 *
242
+	 * @access        public
243
+	 * @return string
244
+	 * @throws EE_Error
245
+	 */
246
+	public function fname()
247
+	{
248
+		return $this->get('ATT_fname');
249
+	}
250
+
251
+
252
+	/**
253
+	 * echoes out the attendee's first name
254
+	 *
255
+	 * @return void
256
+	 * @throws EE_Error
257
+	 */
258
+	public function e_full_name()
259
+	{
260
+		echo $this->full_name();
261
+	}
262
+
263
+
264
+	/**
265
+	 * Returns the first and last name concatenated together with a space.
266
+	 *
267
+	 * @param bool $apply_html_entities
268
+	 * @return string
269
+	 * @throws EE_Error
270
+	 */
271
+	public function full_name($apply_html_entities = false)
272
+	{
273
+		$full_name = array(
274
+			$this->fname(),
275
+			$this->lname(),
276
+		);
277
+		$full_name = array_filter($full_name);
278
+		$full_name = implode(' ', $full_name);
279
+		return $apply_html_entities ? htmlentities($full_name, ENT_QUOTES, 'UTF-8') : $full_name;
280
+	}
281
+
282
+
283
+	/**
284
+	 * This returns the value of the `ATT_full_name` field which is usually equivalent to calling `full_name()` unless
285
+	 * the post_title field has been directly modified in the db for the post (espresso_attendees post type) for this
286
+	 * attendee.
287
+	 *
288
+	 * @param bool $apply_html_entities
289
+	 * @return string
290
+	 * @throws EE_Error
291
+	 */
292
+	public function ATT_full_name($apply_html_entities = false)
293
+	{
294
+		return $apply_html_entities
295
+			? htmlentities($this->get('ATT_full_name'), ENT_QUOTES, 'UTF-8')
296
+			: $this->get('ATT_full_name');
297
+	}
298
+
299
+
300
+	/**
301
+	 *        get Attendee Last Name
302
+	 *
303
+	 * @access        public
304
+	 * @return string
305
+	 * @throws EE_Error
306
+	 */
307
+	public function lname()
308
+	{
309
+		return $this->get('ATT_lname');
310
+	}
311
+
312
+
313
+	/**
314
+	 * Gets the attendee's full address as an array so client code can decide hwo to display it
315
+	 *
316
+	 * @return array numerically indexed, with each part of the address that is known.
317
+	 * Eg, if the user only responded to state and country,
318
+	 * it would be array(0=>'Alabama',1=>'USA')
319
+	 * @return array
320
+	 * @throws EE_Error
321
+	 */
322
+	public function full_address_as_array()
323
+	{
324
+		$full_address_array = array();
325
+		$initial_address_fields = array('ATT_address', 'ATT_address2', 'ATT_city',);
326
+		foreach ($initial_address_fields as $address_field_name) {
327
+			$address_fields_value = $this->get($address_field_name);
328
+			if (! empty($address_fields_value)) {
329
+				$full_address_array[] = $address_fields_value;
330
+			}
331
+		}
332
+		// now handle state and country
333
+		$state_obj = $this->state_obj();
334
+		if ($state_obj instanceof EE_State) {
335
+			$full_address_array[] = $state_obj->name();
336
+		}
337
+		$country_obj = $this->country_obj();
338
+		if ($country_obj instanceof EE_Country) {
339
+			$full_address_array[] = $country_obj->name();
340
+		}
341
+		// lastly get the xip
342
+		$zip_value = $this->zip();
343
+		if (! empty($zip_value)) {
344
+			$full_address_array[] = $zip_value;
345
+		}
346
+		return $full_address_array;
347
+	}
348
+
349
+
350
+	/**
351
+	 *        get Attendee Address
352
+	 *
353
+	 * @return string
354
+	 * @throws EE_Error
355
+	 */
356
+	public function address()
357
+	{
358
+		return $this->get('ATT_address');
359
+	}
360
+
361
+
362
+	/**
363
+	 *        get Attendee Address2
364
+	 *
365
+	 * @return string
366
+	 * @throws EE_Error
367
+	 */
368
+	public function address2()
369
+	{
370
+		return $this->get('ATT_address2');
371
+	}
372
+
373
+
374
+	/**
375
+	 *        get Attendee City
376
+	 *
377
+	 * @return string
378
+	 * @throws EE_Error
379
+	 */
380
+	public function city()
381
+	{
382
+		return $this->get('ATT_city');
383
+	}
384
+
385
+
386
+	/**
387
+	 *        get Attendee State ID
388
+	 *
389
+	 * @return string
390
+	 * @throws EE_Error
391
+	 */
392
+	public function state_ID()
393
+	{
394
+		return $this->get('STA_ID');
395
+	}
396
+
397
+
398
+	/**
399
+	 * @return string
400
+	 * @throws EE_Error
401
+	 */
402
+	public function state_abbrev()
403
+	{
404
+		return $this->state_obj() instanceof EE_State ? $this->state_obj()->abbrev() : '';
405
+	}
406
+
407
+
408
+	/**
409
+	 * Gets the state set to this attendee
410
+	 *
411
+	 * @return EE_State
412
+	 * @throws EE_Error
413
+	 */
414
+	public function state_obj()
415
+	{
416
+		return $this->get_first_related('State');
417
+	}
418
+
419
+
420
+	/**
421
+	 * Returns the state's name, otherwise 'Unknown'
422
+	 *
423
+	 * @return string
424
+	 * @throws EE_Error
425
+	 */
426
+	public function state_name()
427
+	{
428
+		if ($this->state_obj()) {
429
+			return $this->state_obj()->name();
430
+		} else {
431
+			return '';
432
+		}
433
+	}
434
+
435
+
436
+	/**
437
+	 * either displays the state abbreviation or the state name, as determined
438
+	 * by the "FHEE__EEI_Address__state__use_abbreviation" filter.
439
+	 * defaults to abbreviation
440
+	 *
441
+	 * @return string
442
+	 * @throws EE_Error
443
+	 */
444
+	public function state()
445
+	{
446
+		if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) {
447
+			return $this->state_abbrev();
448
+		}
449
+		return $this->state_name();
450
+	}
451
+
452
+
453
+	/**
454
+	 *    get Attendee Country ISO Code
455
+	 *
456
+	 * @return string
457
+	 * @throws EE_Error
458
+	 */
459
+	public function country_ID()
460
+	{
461
+		return $this->get('CNT_ISO');
462
+	}
463
+
464
+
465
+	/**
466
+	 * Gets country set for this attendee
467
+	 *
468
+	 * @return EE_Country
469
+	 * @throws EE_Error
470
+	 */
471
+	public function country_obj()
472
+	{
473
+		return $this->get_first_related('Country');
474
+	}
475
+
476
+
477
+	/**
478
+	 * Returns the country's name if known, otherwise 'Unknown'
479
+	 *
480
+	 * @return string
481
+	 * @throws EE_Error
482
+	 */
483
+	public function country_name()
484
+	{
485
+		if ($this->country_obj()) {
486
+			return $this->country_obj()->name();
487
+		}
488
+		return '';
489
+	}
490
+
491
+
492
+	/**
493
+	 * either displays the country ISO2 code or the country name, as determined
494
+	 * by the "FHEE__EEI_Address__country__use_abbreviation" filter.
495
+	 * defaults to abbreviation
496
+	 *
497
+	 * @return string
498
+	 * @throws EE_Error
499
+	 */
500
+	public function country()
501
+	{
502
+		if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) {
503
+			return $this->country_ID();
504
+		}
505
+		return $this->country_name();
506
+	}
507
+
508
+
509
+	/**
510
+	 *        get Attendee Zip/Postal Code
511
+	 *
512
+	 * @return string
513
+	 * @throws EE_Error
514
+	 */
515
+	public function zip()
516
+	{
517
+		return $this->get('ATT_zip');
518
+	}
519
+
520
+
521
+	/**
522
+	 *        get Attendee Email Address
523
+	 *
524
+	 * @return string
525
+	 * @throws EE_Error
526
+	 */
527
+	public function email()
528
+	{
529
+		return $this->get('ATT_email');
530
+	}
531
+
532
+
533
+	/**
534
+	 *        get Attendee Phone #
535
+	 *
536
+	 * @return string
537
+	 * @throws EE_Error
538
+	 */
539
+	public function phone()
540
+	{
541
+		return $this->get('ATT_phone');
542
+	}
543
+
544
+
545
+	/**
546
+	 *    get deleted
547
+	 *
548
+	 * @return        bool
549
+	 * @throws EE_Error
550
+	 */
551
+	public function deleted()
552
+	{
553
+		return $this->get('ATT_deleted');
554
+	}
555
+
556
+
557
+	/**
558
+	 * Gets registrations of this attendee
559
+	 *
560
+	 * @param array $query_params
561
+	 * @return EE_Registration[]
562
+	 * @throws EE_Error
563
+	 */
564
+	public function get_registrations($query_params = array())
565
+	{
566
+		return $this->get_many_related('Registration', $query_params);
567
+	}
568
+
569
+
570
+	/**
571
+	 * Gets the most recent registration of this attendee
572
+	 *
573
+	 * @return EE_Registration
574
+	 * @throws EE_Error
575
+	 */
576
+	public function get_most_recent_registration()
577
+	{
578
+		return $this->get_first_related(
579
+			'Registration',
580
+			array('order_by' => array('REG_date' => 'DESC'))
581
+		); // null, 'REG_date', 'DESC', '=', 'OBJECT_K');
582
+	}
583
+
584
+
585
+	/**
586
+	 * Gets the most recent registration for this attend at this event
587
+	 *
588
+	 * @param int $event_id
589
+	 * @return EE_Registration
590
+	 * @throws EE_Error
591
+	 */
592
+	public function get_most_recent_registration_for_event($event_id)
593
+	{
594
+		return $this->get_first_related(
595
+			'Registration',
596
+			array(array('EVT_ID' => $event_id), 'order_by' => array('REG_date' => 'DESC'))
597
+		);
598
+	}
599
+
600
+
601
+	/**
602
+	 * returns any events attached to this attendee ($_Event property);
603
+	 *
604
+	 * @return array
605
+	 * @throws EE_Error
606
+	 */
607
+	public function events()
608
+	{
609
+		return $this->get_many_related('Event');
610
+	}
611
+
612
+
613
+	/**
614
+	 * Gets the billing info array where keys match espresso_reg_page_billing_inputs(),
615
+	 * and keys are their cleaned values. @see EE_Attendee::save_and_clean_billing_info_for_payment_method() which was
616
+	 * used to save the billing info
617
+	 *
618
+	 * @param EE_Payment_Method $payment_method the _gateway_name property on the gateway class
619
+	 * @return EE_Form_Section_Proper|null
620
+	 * @throws EE_Error
621
+	 */
622
+	public function billing_info_for_payment_method($payment_method)
623
+	{
624
+		$pm_type = $payment_method->type_obj();
625
+		if (! $pm_type instanceof EE_PMT_Base) {
626
+			return null;
627
+		}
628
+		$billing_info = $this->get_post_meta($this->get_billing_info_postmeta_name($payment_method), true);
629
+		if (! $billing_info) {
630
+			return null;
631
+		}
632
+		$billing_form = $pm_type->billing_form();
633
+		// double-check the form isn't totally hidden, in which case pretend there is no form
634
+		$form_totally_hidden = true;
635
+		foreach ($billing_form->inputs_in_subsections() as $input) {
636
+			if (! $input->get_display_strategy() instanceof EE_Hidden_Display_Strategy) {
637
+				$form_totally_hidden = false;
638
+				break;
639
+			}
640
+		}
641
+		if ($form_totally_hidden) {
642
+			return null;
643
+		}
644
+		if ($billing_form instanceof EE_Form_Section_Proper) {
645
+			$billing_form->receive_form_submission(array($billing_form->name() => $billing_info), false);
646
+		}
647
+
648
+		return $billing_form;
649
+	}
650
+
651
+
652
+	/**
653
+	 * Gets the postmeta key that holds this attendee's billing info for the
654
+	 * specified payment method
655
+	 *
656
+	 * @param EE_Payment_Method $payment_method
657
+	 * @return string
658
+	 * @throws EE_Error
659
+	 */
660
+	public function get_billing_info_postmeta_name($payment_method)
661
+	{
662
+		if ($payment_method->type_obj() instanceof EE_PMT_Base) {
663
+			return 'billing_info_' . $payment_method->type_obj()->system_name();
664
+		}
665
+		return null;
666
+	}
667
+
668
+
669
+	/**
670
+	 * Saves the billing info to the attendee. @see EE_Attendee::billing_info_for_payment_method() which is used to
671
+	 * retrieve it
672
+	 *
673
+	 * @param EE_Billing_Attendee_Info_Form $billing_form
674
+	 * @param EE_Payment_Method             $payment_method
675
+	 * @return boolean
676
+	 * @throws EE_Error
677
+	 */
678
+	public function save_and_clean_billing_info_for_payment_method($billing_form, $payment_method)
679
+	{
680
+		if (! $billing_form instanceof EE_Billing_Attendee_Info_Form) {
681
+			EE_Error::add_error(__('Cannot save billing info because there is none.', 'event_espresso'));
682
+			return false;
683
+		}
684
+		$billing_form->clean_sensitive_data();
685
+		return update_post_meta(
686
+			$this->ID(),
687
+			$this->get_billing_info_postmeta_name($payment_method),
688
+			$billing_form->input_values(true)
689
+		);
690
+	}
691
+
692
+
693
+	/**
694
+	 * Return the link to the admin details for the object.
695
+	 *
696
+	 * @return string
697
+	 * @throws EE_Error
698
+	 * @throws InvalidArgumentException
699
+	 * @throws InvalidDataTypeException
700
+	 * @throws InvalidInterfaceException
701
+	 * @throws ReflectionException
702
+	 */
703
+	public function get_admin_details_link()
704
+	{
705
+		return $this->get_admin_edit_link();
706
+	}
707
+
708
+
709
+	/**
710
+	 * Returns the link to the editor for the object.  Sometimes this is the same as the details.
711
+	 *
712
+	 * @return string
713
+	 * @throws EE_Error
714
+	 * @throws InvalidArgumentException
715
+	 * @throws ReflectionException
716
+	 * @throws InvalidDataTypeException
717
+	 * @throws InvalidInterfaceException
718
+	 */
719
+	public function get_admin_edit_link()
720
+	{
721
+		EE_Registry::instance()->load_helper('URL');
722
+		return EEH_URL::add_query_args_and_nonce(
723
+			array(
724
+				'page'   => 'espresso_registrations',
725
+				'action' => 'edit_attendee',
726
+				'post'   => $this->ID(),
727
+			),
728
+			admin_url('admin.php')
729
+		);
730
+	}
731
+
732
+
733
+	/**
734
+	 * Returns the link to a settings page for the object.
735
+	 *
736
+	 * @return string
737
+	 * @throws EE_Error
738
+	 * @throws InvalidArgumentException
739
+	 * @throws InvalidDataTypeException
740
+	 * @throws InvalidInterfaceException
741
+	 * @throws ReflectionException
742
+	 */
743
+	public function get_admin_settings_link()
744
+	{
745
+		return $this->get_admin_edit_link();
746
+	}
747
+
748
+
749
+	/**
750
+	 * Returns the link to the "overview" for the object (typically the "list table" view).
751
+	 *
752
+	 * @return string
753
+	 * @throws EE_Error
754
+	 * @throws InvalidArgumentException
755
+	 * @throws ReflectionException
756
+	 * @throws InvalidDataTypeException
757
+	 * @throws InvalidInterfaceException
758
+	 */
759
+	public function get_admin_overview_link()
760
+	{
761
+		EE_Registry::instance()->load_helper('URL');
762
+		return EEH_URL::add_query_args_and_nonce(
763
+			array(
764
+				'page'   => 'espresso_registrations',
765
+				'action' => 'contact_list',
766
+			),
767
+			admin_url('admin.php')
768
+		);
769
+	}
770 770
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
      */
37 37
     protected function __construct($fieldValues = null, $bydb = false, $timezone = null, $date_formats = array())
38 38
     {
39
-        if (! isset($fieldValues['ATT_full_name'])) {
40
-            $fname = isset($fieldValues['ATT_fname']) ? $fieldValues['ATT_fname'] . ' ' : '';
39
+        if ( ! isset($fieldValues['ATT_full_name'])) {
40
+            $fname = isset($fieldValues['ATT_fname']) ? $fieldValues['ATT_fname'].' ' : '';
41 41
             $lname = isset($fieldValues['ATT_lname']) ? $fieldValues['ATT_lname'] : '';
42
-            $fieldValues['ATT_full_name'] = $fname . $lname;
42
+            $fieldValues['ATT_full_name'] = $fname.$lname;
43 43
         }
44
-        if (! isset($fieldValues['ATT_slug'])) {
44
+        if ( ! isset($fieldValues['ATT_slug'])) {
45 45
             // $fieldValues['ATT_slug'] = sanitize_key(wp_generate_password(20));
46 46
             $fieldValues['ATT_slug'] = sanitize_title($fieldValues['ATT_full_name']);
47 47
         }
48
-        if (! isset($fieldValues['ATT_short_bio']) && isset($fieldValues['ATT_bio'])) {
48
+        if ( ! isset($fieldValues['ATT_short_bio']) && isset($fieldValues['ATT_bio'])) {
49 49
             $fieldValues['ATT_short_bio'] = substr($fieldValues['ATT_bio'], 0, 50);
50 50
         }
51 51
         parent::__construct($fieldValues, $bydb, $timezone, $date_formats);
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
         $initial_address_fields = array('ATT_address', 'ATT_address2', 'ATT_city',);
326 326
         foreach ($initial_address_fields as $address_field_name) {
327 327
             $address_fields_value = $this->get($address_field_name);
328
-            if (! empty($address_fields_value)) {
328
+            if ( ! empty($address_fields_value)) {
329 329
                 $full_address_array[] = $address_fields_value;
330 330
             }
331 331
         }
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
         }
341 341
         // lastly get the xip
342 342
         $zip_value = $this->zip();
343
-        if (! empty($zip_value)) {
343
+        if ( ! empty($zip_value)) {
344 344
             $full_address_array[] = $zip_value;
345 345
         }
346 346
         return $full_address_array;
@@ -622,18 +622,18 @@  discard block
 block discarded – undo
622 622
     public function billing_info_for_payment_method($payment_method)
623 623
     {
624 624
         $pm_type = $payment_method->type_obj();
625
-        if (! $pm_type instanceof EE_PMT_Base) {
625
+        if ( ! $pm_type instanceof EE_PMT_Base) {
626 626
             return null;
627 627
         }
628 628
         $billing_info = $this->get_post_meta($this->get_billing_info_postmeta_name($payment_method), true);
629
-        if (! $billing_info) {
629
+        if ( ! $billing_info) {
630 630
             return null;
631 631
         }
632 632
         $billing_form = $pm_type->billing_form();
633 633
         // double-check the form isn't totally hidden, in which case pretend there is no form
634 634
         $form_totally_hidden = true;
635 635
         foreach ($billing_form->inputs_in_subsections() as $input) {
636
-            if (! $input->get_display_strategy() instanceof EE_Hidden_Display_Strategy) {
636
+            if ( ! $input->get_display_strategy() instanceof EE_Hidden_Display_Strategy) {
637 637
                 $form_totally_hidden = false;
638 638
                 break;
639 639
             }
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
     public function get_billing_info_postmeta_name($payment_method)
661 661
     {
662 662
         if ($payment_method->type_obj() instanceof EE_PMT_Base) {
663
-            return 'billing_info_' . $payment_method->type_obj()->system_name();
663
+            return 'billing_info_'.$payment_method->type_obj()->system_name();
664 664
         }
665 665
         return null;
666 666
     }
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
      */
678 678
     public function save_and_clean_billing_info_for_payment_method($billing_form, $payment_method)
679 679
     {
680
-        if (! $billing_form instanceof EE_Billing_Attendee_Info_Form) {
680
+        if ( ! $billing_form instanceof EE_Billing_Attendee_Info_Form) {
681 681
             EE_Error::add_error(__('Cannot save billing info because there is none.', 'event_espresso'));
682 682
             return false;
683 683
         }
Please login to merge, or discard this patch.
core/db_classes/EE_Datetime_Ticket.class.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -9,30 +9,30 @@
 block discarded – undo
9 9
 class EE_Datetime_Ticket extends EE_Base_Class
10 10
 {
11 11
 
12
-    /**
13
-     *
14
-     * @param array  $props_n_values          incoming values
15
-     * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
16
-     *                                        used.)
17
-     * @param array  $date_formats            incoming date_formats in an array where the first value is the
18
-     *                                        date_format and the second value is the time format
19
-     * @return EE_Attendee
20
-     */
21
-    public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array())
22
-    {
23
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
24
-        return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
25
-    }
12
+	/**
13
+	 *
14
+	 * @param array  $props_n_values          incoming values
15
+	 * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
16
+	 *                                        used.)
17
+	 * @param array  $date_formats            incoming date_formats in an array where the first value is the
18
+	 *                                        date_format and the second value is the time format
19
+	 * @return EE_Attendee
20
+	 */
21
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array())
22
+	{
23
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
24
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
25
+	}
26 26
 
27 27
 
28
-    /**
29
-     * @param array  $props_n_values  incoming values from the database
30
-     * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
31
-     *                                the website will be used.
32
-     * @return EE_Attendee
33
-     */
34
-    public static function new_instance_from_db($props_n_values = array(), $timezone = null)
35
-    {
36
-        return new self($props_n_values, true, $timezone);
37
-    }
28
+	/**
29
+	 * @param array  $props_n_values  incoming values from the database
30
+	 * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
31
+	 *                                the website will be used.
32
+	 * @return EE_Attendee
33
+	 */
34
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null)
35
+	{
36
+		return new self($props_n_values, true, $timezone);
37
+	}
38 38
 }
Please login to merge, or discard this patch.
core/db_classes/EE_Event_Message_Template.class.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -12,25 +12,25 @@
 block discarded – undo
12 12
 class EE_Event_Message_Template extends EE_Base_Class
13 13
 {
14 14
 
15
-    /**
16
-     * @param array $props_n_values
17
-     * @param null  $timezone
18
-     * @return EE_Event_Message_Template|mixed
19
-     */
20
-    public static function new_instance($props_n_values = array(), $timezone = null)
21
-    {
22
-        $has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone);
23
-        return $has_object ? $has_object : new self($props_n_values, false, $timezone);
24
-    }
15
+	/**
16
+	 * @param array $props_n_values
17
+	 * @param null  $timezone
18
+	 * @return EE_Event_Message_Template|mixed
19
+	 */
20
+	public static function new_instance($props_n_values = array(), $timezone = null)
21
+	{
22
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone);
23
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone);
24
+	}
25 25
 
26 26
 
27
-    /**
28
-     * @param array $props_n_values
29
-     * @param null  $timezone
30
-     * @return EE_Event_Message_Template
31
-     */
32
-    public static function new_instance_from_db($props_n_values = array(), $timezone = null)
33
-    {
34
-        return new self($props_n_values, true, $timezone);
35
-    }
27
+	/**
28
+	 * @param array $props_n_values
29
+	 * @param null  $timezone
30
+	 * @return EE_Event_Message_Template
31
+	 */
32
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null)
33
+	{
34
+		return new self($props_n_values, true, $timezone);
35
+	}
36 36
 }
Please login to merge, or discard this patch.