Completed
Branch FET-10304-welcome-to-vue (2869cd)
by
unknown
12:52
created
core/db_models/fields/EE_Primary_Key_Int_Field.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-require_once(EE_MODELS . 'fields/EE_Primary_Key_Field_Base.php');
2
+require_once(EE_MODELS.'fields/EE_Primary_Key_Field_Base.php');
3 3
 
4 4
 class EE_Primary_Key_Int_Field extends EE_Primary_Key_Field_Base
5 5
 {
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
8 8
         return '%s';
9 9
     }
10 10
 
11
+    /**
12
+     * @param string $table_column
13
+     */
11 14
     public function __construct($table_column, $nicename)
12 15
     {
13 16
         parent::__construct($table_column, $nicename, null);
Please login to merge, or discard this patch.
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -3,38 +3,38 @@
 block discarded – undo
3 3
 
4 4
 class EE_Primary_Key_Int_Field extends EE_Primary_Key_Field_Base
5 5
 {
6
-    function get_wpdb_data_type()
7
-    {
8
-        return '%d';
9
-    }
6
+	function get_wpdb_data_type()
7
+	{
8
+		return '%d';
9
+	}
10 10
 
11
-    public function __construct($table_column, $nicename)
12
-    {
13
-        parent::__construct($table_column, $nicename, 0);
14
-    }
11
+	public function __construct($table_column, $nicename)
12
+	{
13
+		parent::__construct($table_column, $nicename, 0);
14
+	}
15 15
 
16
-    function prepare_for_set($value_inputted_for_field_on_model_object)
17
-    {
18
-        if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) {
19
-            $value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID();
20
-        }
21
-        return absint($value_inputted_for_field_on_model_object);
22
-    }
16
+	function prepare_for_set($value_inputted_for_field_on_model_object)
17
+	{
18
+		if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) {
19
+			$value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID();
20
+		}
21
+		return absint($value_inputted_for_field_on_model_object);
22
+	}
23 23
 
24
-    function prepare_for_set_from_db($value_found_in_db_for_model_object)
25
-    {
26
-        return intval($value_found_in_db_for_model_object);
27
-    }
24
+	function prepare_for_set_from_db($value_found_in_db_for_model_object)
25
+	{
26
+		return intval($value_found_in_db_for_model_object);
27
+	}
28 28
 
29
-    function is_auto_increment()
30
-    {
31
-        return true;
32
-    }
29
+	function is_auto_increment()
30
+	{
31
+		return true;
32
+	}
33 33
 
34
-    public function get_schema()
35
-    {
36
-        $schema = parent::get_schema();
37
-        $schema['type'] = 'integer';
38
-        return $schema;
39
-    }
34
+	public function get_schema()
35
+	{
36
+		$schema = parent::get_schema();
37
+		$schema['type'] = 'integer';
38
+		return $schema;
39
+	}
40 40
 }
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_models/fields/EE_Foreign_Key_String_Field.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -3,22 +3,22 @@
 block discarded – undo
3 3
 
4 4
 class EE_Foreign_Key_String_Field extends EE_Foreign_Key_Field_Base
5 5
 {
6
-    function get_wpdb_data_type()
7
-    {
8
-        return '%s';
9
-    }
6
+	function get_wpdb_data_type()
7
+	{
8
+		return '%s';
9
+	}
10 10
 
11
-    /**
12
-     * removes all tags when setting
13
-     *
14
-     * @param string $value_inputted_for_field_on_model_object
15
-     * @return string
16
-     */
17
-    function prepare_for_set($value_inputted_for_field_on_model_object)
18
-    {
19
-        if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) {
20
-            $value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID();
21
-        }
22
-        return strtoupper(wp_strip_all_tags($value_inputted_for_field_on_model_object));
23
-    }
11
+	/**
12
+	 * removes all tags when setting
13
+	 *
14
+	 * @param string $value_inputted_for_field_on_model_object
15
+	 * @return string
16
+	 */
17
+	function prepare_for_set($value_inputted_for_field_on_model_object)
18
+	{
19
+		if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) {
20
+			$value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID();
21
+		}
22
+		return strtoupper(wp_strip_all_tags($value_inputted_for_field_on_model_object));
23
+	}
24 24
 }
25 25
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-require_once(EE_MODELS . 'fields/EE_Foreign_Key_Field_Base.php');
2
+require_once(EE_MODELS.'fields/EE_Foreign_Key_Field_Base.php');
3 3
 
4 4
 class EE_Foreign_Key_Int_Field extends EE_Foreign_Key_Field_Base
5 5
 {
Please login to merge, or discard this patch.
core/db_models/fields/EE_Trashed_Flag_Field.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,6 +3,6 @@
 block discarded – undo
3 3
 
4 4
 class EE_Trashed_Flag_Field extends EE_Boolean_Field
5 5
 {
6
-    //note: some client code simply checks if a field IS an EE_Trashed_Flag_Field
7
-    //...otherwise, these fields are mostly the same as boolean fields
6
+	//note: some client code simply checks if a field IS an EE_Trashed_Flag_Field
7
+	//...otherwise, these fields are mostly the same as boolean fields
8 8
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-require_once(EE_MODELS . 'fields/EE_Boolean_Field.php');
2
+require_once(EE_MODELS.'fields/EE_Boolean_Field.php');
3 3
 
4 4
 class EE_Trashed_Flag_Field extends EE_Boolean_Field
5 5
 {
Please login to merge, or discard this patch.
core/db_models/fields/EE_All_Caps_Text_Field.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,19 +6,19 @@
 block discarded – undo
6 6
  */
7 7
 class EE_All_Caps_Text_Field extends EE_Text_Field_Base
8 8
 {
9
-    function get_wpdb_data_type()
10
-    {
11
-        return '%s';
12
-    }
9
+	function get_wpdb_data_type()
10
+	{
11
+		return '%s';
12
+	}
13 13
 
14
-    /**
15
-     * makes it all upper case, and key-like
16
-     *
17
-     * @param string $value_inputted_for_field_on_model_object
18
-     * @return string
19
-     */
20
-    function prepare_for_set($value_inputted_for_field_on_model_object)
21
-    {
22
-        return strtoupper(sanitize_key($value_inputted_for_field_on_model_object));
23
-    }
14
+	/**
15
+	 * makes it all upper case, and key-like
16
+	 *
17
+	 * @param string $value_inputted_for_field_on_model_object
18
+	 * @return string
19
+	 */
20
+	function prepare_for_set($value_inputted_for_field_on_model_object)
21
+	{
22
+		return strtoupper(sanitize_key($value_inputted_for_field_on_model_object));
23
+	}
24 24
 }
25 25
\ No newline at end of file
Please login to merge, or discard this patch.
core/db_models/fields/EE_WP_User_Field.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if (! defined('EVENT_ESPRESSO_VERSION')) {
2
-    exit('No direct script access allowed');
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 
5 5
 /**
@@ -24,34 +24,34 @@  discard block
 block discarded – undo
24 24
  */
25 25
 class EE_WP_User_Field extends EE_Foreign_Key_Int_Field
26 26
 {
27
-    /**
28
-     * No need to provide a default or the model pointed to- the default is
29
-     * always get_current_user_id() and the model pointed to is always WP_User
30
-     *
31
-     * @param string  $table_column name fo column for field
32
-     * @param string  $nicename     should eb internationalized with __('blah','event_espresso')
33
-     * @param boolean $nullable
34
-     */
35
-    function __construct($table_column, $nicename, $nullable)
36
-    {
37
-        parent::__construct($table_column, $nicename, $nullable, null, 'WP_User');
38
-    }
27
+	/**
28
+	 * No need to provide a default or the model pointed to- the default is
29
+	 * always get_current_user_id() and the model pointed to is always WP_User
30
+	 *
31
+	 * @param string  $table_column name fo column for field
32
+	 * @param string  $nicename     should eb internationalized with __('blah','event_espresso')
33
+	 * @param boolean $nullable
34
+	 */
35
+	function __construct($table_column, $nicename, $nullable)
36
+	{
37
+		parent::__construct($table_column, $nicename, $nullable, null, 'WP_User');
38
+	}
39 39
 
40
-    /**
41
-     * Gets the default which is always the current user. This can't be set when initially
42
-     * constructing the model field because that's done before $current_user is set
43
-     *
44
-     * @return mixed
45
-     */
46
-    function get_default_value()
47
-    {
48
-        if (did_action('init')) {
49
-            return get_current_user_id();
50
-        } else {
51
-            EE_Error::doing_it_wrong('EE_WP_User_Field::get_default_value',
52
-                __('You cant get a default value for a wp_User_Field because the "init" action is called, because current_user global hasnt yet been setup. Consider doing your business logic on the "init" hook or later.',
53
-                    'event_espresso'), '4.6.20');
54
-            return 1;
55
-        }
56
-    }
40
+	/**
41
+	 * Gets the default which is always the current user. This can't be set when initially
42
+	 * constructing the model field because that's done before $current_user is set
43
+	 *
44
+	 * @return mixed
45
+	 */
46
+	function get_default_value()
47
+	{
48
+		if (did_action('init')) {
49
+			return get_current_user_id();
50
+		} else {
51
+			EE_Error::doing_it_wrong('EE_WP_User_Field::get_default_value',
52
+				__('You cant get a default value for a wp_User_Field because the "init" action is called, because current_user global hasnt yet been setup. Consider doing your business logic on the "init" hook or later.',
53
+					'event_espresso'), '4.6.20');
54
+			return 1;
55
+		}
56
+	}
57 57
 }
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php if (! defined('EVENT_ESPRESSO_VERSION')) {
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2 2
     exit('No direct script access allowed');
3 3
 }
4 4
 
Please login to merge, or discard this patch.
core/db_models/fields/EE_Maybe_Serialized_Simple_HTML_Field.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if (! defined('EVENT_ESPRESSO_VERSION')) {
2
-    exit('No direct script access allowed');
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 
5 5
 /**
@@ -14,56 +14,56 @@  discard block
 block discarded – undo
14 14
  */
15 15
 class EE_Maybe_Serialized_Simple_HTML_Field extends EE_Maybe_Serialized_Text_Field
16 16
 {
17
-    /**
18
-     * removes all non-basic tags when setting
19
-     *
20
-     * @param string $value_inputted_for_field_on_model_object
21
-     * @return string
22
-     */
23
-    function prepare_for_set($value_inputted_for_field_on_model_object)
24
-    {
25
-        return parent::prepare_for_set($this->_remove_tags($value_inputted_for_field_on_model_object));
26
-    }
17
+	/**
18
+	 * removes all non-basic tags when setting
19
+	 *
20
+	 * @param string $value_inputted_for_field_on_model_object
21
+	 * @return string
22
+	 */
23
+	function prepare_for_set($value_inputted_for_field_on_model_object)
24
+	{
25
+		return parent::prepare_for_set($this->_remove_tags($value_inputted_for_field_on_model_object));
26
+	}
27 27
 
28
-    /**
29
-     * Remove any non-"simple" html tags. @see EE_Simple_HTML_Field
30
-     *
31
-     * @param array|string $value
32
-     * @return array|string
33
-     */
34
-    protected function _remove_tags($value)
35
-    {
36
-        if (is_array($value)) {
37
-            foreach ($value as $key => $v) {
38
-                $value[$key] = $this->_remove_tags($v);
39
-            }
40
-        } elseif (is_string($value)) {
41
-            $value = wp_kses("$value", $this->_get_allowed_tags());
42
-        }
43
-        return $value;
44
-    }
28
+	/**
29
+	 * Remove any non-"simple" html tags. @see EE_Simple_HTML_Field
30
+	 *
31
+	 * @param array|string $value
32
+	 * @return array|string
33
+	 */
34
+	protected function _remove_tags($value)
35
+	{
36
+		if (is_array($value)) {
37
+			foreach ($value as $key => $v) {
38
+				$value[$key] = $this->_remove_tags($v);
39
+			}
40
+		} elseif (is_string($value)) {
41
+			$value = wp_kses("$value", $this->_get_allowed_tags());
42
+		}
43
+		return $value;
44
+	}
45 45
 
46
-    /**
47
-     * In case unsafe data somehow got inserted into the database, we want to remove tags again
48
-     *
49
-     * @param array|string $value_found_in_db_for_model_object
50
-     * @return array|string
51
-     */
52
-    function prepare_for_set_from_db($value_found_in_db_for_model_object)
53
-    {
54
-        return $this->_remove_tags(parent::prepare_for_set_from_db($value_found_in_db_for_model_object));
55
-    }
46
+	/**
47
+	 * In case unsafe data somehow got inserted into the database, we want to remove tags again
48
+	 *
49
+	 * @param array|string $value_found_in_db_for_model_object
50
+	 * @return array|string
51
+	 */
52
+	function prepare_for_set_from_db($value_found_in_db_for_model_object)
53
+	{
54
+		return $this->_remove_tags(parent::prepare_for_set_from_db($value_found_in_db_for_model_object));
55
+	}
56 56
 
57 57
 
58
-    /**
59
-     * Determines what tags to allow in this model field
60
-     *
61
-     * @global array $allowedtags
62
-     * @return array
63
-     */
64
-    function _get_allowed_tags()
65
-    {
66
-        return apply_filters('FHEE__EE_Maybe_Serialized_Simple_HTML_Field___get_allowed_tags',
67
-            EEH_HTML::get_simple_tags(), $this);
68
-    }
58
+	/**
59
+	 * Determines what tags to allow in this model field
60
+	 *
61
+	 * @global array $allowedtags
62
+	 * @return array
63
+	 */
64
+	function _get_allowed_tags()
65
+	{
66
+		return apply_filters('FHEE__EE_Maybe_Serialized_Simple_HTML_Field___get_allowed_tags',
67
+			EEH_HTML::get_simple_tags(), $this);
68
+	}
69 69
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php if (! defined('EVENT_ESPRESSO_VERSION')) {
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2 2
     exit('No direct script access allowed');
3 3
 }
4 4
 
Please login to merge, or discard this patch.
core/db_models/fields/EE_Simple_HTML_Field.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,16 +8,16 @@
 block discarded – undo
8 8
  */
9 9
 class EE_Simple_HTML_Field extends EE_Text_Field_Base
10 10
 {
11
-    /**
12
-     * removes all tags when setting
13
-     *
14
-     * @param string $value_inputted_for_field_on_model_object
15
-     * @return string
16
-     */
17
-    function prepare_for_set($value_inputted_for_field_on_model_object)
18
-    {
19
-        $value_with_select_tags = wp_kses("$value_inputted_for_field_on_model_object", EEH_HTML::get_simple_tags());
20
-        return parent::prepare_for_set($value_with_select_tags);
21
-    }
11
+	/**
12
+	 * removes all tags when setting
13
+	 *
14
+	 * @param string $value_inputted_for_field_on_model_object
15
+	 * @return string
16
+	 */
17
+	function prepare_for_set($value_inputted_for_field_on_model_object)
18
+	{
19
+		$value_with_select_tags = wp_kses("$value_inputted_for_field_on_model_object", EEH_HTML::get_simple_tags());
20
+		return parent::prepare_for_set($value_with_select_tags);
21
+	}
22 22
 
23 23
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-require_once(EE_MODELS . 'fields/EE_Text_Field_Base.php');
2
+require_once(EE_MODELS.'fields/EE_Text_Field_Base.php');
3 3
 
4 4
 class EE_Plain_Text_Field extends EE_Text_Field_Base
5 5
 {
Please login to merge, or discard this patch.
core/db_models/fields/EE_Slug_Field.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -3,15 +3,15 @@
 block discarded – undo
3 3
 
4 4
 class EE_Slug_Field extends EE_Text_Field_Base
5 5
 {
6
-    /**
7
-     * ensures string is usable in URLs
8
-     *
9
-     * @param string $value_inputted_for_field_on_model_object
10
-     * @return string
11
-     */
12
-    function prepare_for_set($value_inputted_for_field_on_model_object)
13
-    {
14
-        //reminder: function prepares for use in URLs, not making human-readable.
15
-        return sanitize_title($value_inputted_for_field_on_model_object);
16
-    }
6
+	/**
7
+	 * ensures string is usable in URLs
8
+	 *
9
+	 * @param string $value_inputted_for_field_on_model_object
10
+	 * @return string
11
+	 */
12
+	function prepare_for_set($value_inputted_for_field_on_model_object)
13
+	{
14
+		//reminder: function prepares for use in URLs, not making human-readable.
15
+		return sanitize_title($value_inputted_for_field_on_model_object);
16
+	}
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-require_once(EE_MODELS . 'fields/EE_Text_Field_Base.php');
2
+require_once(EE_MODELS.'fields/EE_Text_Field_Base.php');
3 3
 
4 4
 class EE_Plain_Text_Field extends EE_Text_Field_Base
5 5
 {
Please login to merge, or discard this patch.
core/db_models/fields/EE_Post_Content_Field.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      */
15 15
     function prepare_for_set($value)
16 16
     {
17
-        if (! current_user_can('unfiltered_html')) {
17
+        if ( ! current_user_can('unfiltered_html')) {
18 18
             $value = wp_kses("$value", wp_kses_allowed_html('post'));
19 19
         }
20 20
         return parent::prepare_for_set($value);
Please login to merge, or discard this patch.
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -6,46 +6,46 @@
 block discarded – undo
6 6
  */
7 7
 class EE_Post_Content_Field extends EE_Text_Field_Base
8 8
 {
9
-    /**
10
-     * removes all tags which a WP Post wouldn't allow in its content normally
11
-     *
12
-     * @param string $value
13
-     * @return string
14
-     */
15
-    function prepare_for_set($value)
16
-    {
17
-        if (! current_user_can('unfiltered_html')) {
18
-            $value = wp_kses("$value", wp_kses_allowed_html('post'));
19
-        }
20
-        return parent::prepare_for_set($value);
21
-    }
9
+	/**
10
+	 * removes all tags which a WP Post wouldn't allow in its content normally
11
+	 *
12
+	 * @param string $value
13
+	 * @return string
14
+	 */
15
+	function prepare_for_set($value)
16
+	{
17
+		if (! current_user_can('unfiltered_html')) {
18
+			$value = wp_kses("$value", wp_kses_allowed_html('post'));
19
+		}
20
+		return parent::prepare_for_set($value);
21
+	}
22 22
 
23
-    function prepare_for_set_from_db($value_found_in_db_for_model_object)
24
-    {
25
-        return $value_found_in_db_for_model_object;
26
-    }
23
+	function prepare_for_set_from_db($value_found_in_db_for_model_object)
24
+	{
25
+		return $value_found_in_db_for_model_object;
26
+	}
27 27
 
28 28
 
29
-    public function get_schema()
30
-    {
31
-        $schema = parent::get_schema();
32
-        $schema['type'] = 'object';
33
-        $schema['properties'] = array(
34
-            'raw' => array(
35
-                'description' =>  sprintf(
36
-                    __('%s - the content as it exists in the database.', 'event_espresso'),
37
-                    $this->get_nicename()
38
-                ),
39
-                'type' => 'string'
40
-            ),
41
-            'rendered' => array(
42
-                'description' =>  sprintf(
43
-                    __('%s - the content rendered for display.', 'event_espresso'),
44
-                    $this->get_nicename()
45
-                ),
46
-                'type' => 'string'
47
-            )
48
-        );
49
-        return $schema;
50
-    }
29
+	public function get_schema()
30
+	{
31
+		$schema = parent::get_schema();
32
+		$schema['type'] = 'object';
33
+		$schema['properties'] = array(
34
+			'raw' => array(
35
+				'description' =>  sprintf(
36
+					__('%s - the content as it exists in the database.', 'event_espresso'),
37
+					$this->get_nicename()
38
+				),
39
+				'type' => 'string'
40
+			),
41
+			'rendered' => array(
42
+				'description' =>  sprintf(
43
+					__('%s - the content rendered for display.', 'event_espresso'),
44
+					$this->get_nicename()
45
+				),
46
+				'type' => 'string'
47
+			)
48
+		);
49
+		return $schema;
50
+	}
51 51
 }
52 52
\ No newline at end of file
Please login to merge, or discard this patch.