@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | * ------------------------------------------------------------------------ |
23 | 23 | */ |
24 | 24 | |
25 | -require_once ( EE_CLASSES . 'EE_Ticket_Price.class.php' ); |
|
26 | -require_once ( EE_MODELS . 'EEM_Base.model.php' ); |
|
25 | +require_once (EE_CLASSES.'EE_Ticket_Price.class.php'); |
|
26 | +require_once (EE_MODELS.'EEM_Base.model.php'); |
|
27 | 27 | |
28 | 28 | class EEM_Ticket_Price extends EEM_Base { |
29 | 29 | |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | * @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved). Note this just sends the timezone info to the date time model field objects. Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option) |
38 | 38 | * @return void |
39 | 39 | */ |
40 | - protected function __construct( $timezone ) { |
|
41 | - $this->singular_item = __('Ticket Price','event_espresso'); |
|
42 | - $this->plural_item = __('Ticket Prices','event_espresso'); |
|
40 | + protected function __construct($timezone) { |
|
41 | + $this->singular_item = __('Ticket Price', 'event_espresso'); |
|
42 | + $this->plural_item = __('Ticket Prices', 'event_espresso'); |
|
43 | 43 | |
44 | 44 | $this->_tables = array( |
45 | - 'Ticket_Price'=>new EE_Primary_Table('esp_ticket_price','TKP_ID') |
|
45 | + 'Ticket_Price'=>new EE_Primary_Table('esp_ticket_price', 'TKP_ID') |
|
46 | 46 | ); |
47 | 47 | $this->_fields = array( |
48 | 48 | 'Ticket_Price'=> array( |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | 'Price'=>new EE_Belongs_To_Relation() |
57 | 57 | ); |
58 | 58 | $this->_model_chain_to_wp_user = 'Ticket'; |
59 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Default_Public('Ticket.TKT_is_default', 'Ticket.Datetime.Event' ); |
|
59 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Default_Public('Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
60 | 60 | //account for default tickets in the caps |
61 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
62 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
63 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
61 | + $this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
62 | + $this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
63 | + $this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
64 | 64 | //follow the caps of the ticket |
65 | 65 | $this->_caps_slug = 'tickets'; |
66 | - parent::__construct( $timezone ); |
|
66 | + parent::__construct($timezone); |
|
67 | 67 | |
68 | 68 | } |
69 | 69 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | * |
22 | 22 | * ------------------------------------------------------------------------ |
23 | 23 | */ |
24 | -require_once ( EE_MODELS . 'EEM_Base.model.php' ); |
|
25 | -require_once ( EE_CLASSES . 'EE_Ticket_Template.class.php' ); |
|
24 | +require_once (EE_MODELS.'EEM_Base.model.php'); |
|
25 | +require_once (EE_CLASSES.'EE_Ticket_Template.class.php'); |
|
26 | 26 | |
27 | 27 | class EEM_Ticket_Template extends EEM_Base { |
28 | 28 | |
@@ -38,29 +38,29 @@ discard block |
||
38 | 38 | * @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved). Note this just sends the timezone info to the date time model field objects. Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option) |
39 | 39 | * @return void |
40 | 40 | */ |
41 | - protected function __construct( $timezone ) { |
|
42 | - $this->singular_item = __('Ticket Template','event_espresso'); |
|
43 | - $this->plural_item = __('Ticket Templates','event_espresso'); |
|
41 | + protected function __construct($timezone) { |
|
42 | + $this->singular_item = __('Ticket Template', 'event_espresso'); |
|
43 | + $this->plural_item = __('Ticket Templates', 'event_espresso'); |
|
44 | 44 | |
45 | 45 | $this->_tables = array( |
46 | 46 | 'Ticket_Template'=> new EE_Primary_Table('esp_ticket_template', 'TTM_ID') |
47 | 47 | ); |
48 | 48 | $this->_fields = array( |
49 | 49 | 'Ticket_Template'=>array( |
50 | - 'TTM_ID'=>new EE_Primary_Key_Int_Field('TTM_ID', __('Ticket Template ID','event_espresso')), |
|
51 | - 'TTM_name'=>new EE_Plain_Text_Field('TTM_name', __('The name of the ticket template','event_espresso'), false, '' ), |
|
52 | - 'TTM_description'=>new EE_Plain_Text_Field('TTM_description', __('The description for the ticket template','event_espresso'), true, '' ), |
|
53 | - 'TTM_file'=>new EE_Plain_Text_Field('TTM_file', __('The file name for the actual template file saved on disk','event_espresso'), true, '' ), |
|
50 | + 'TTM_ID'=>new EE_Primary_Key_Int_Field('TTM_ID', __('Ticket Template ID', 'event_espresso')), |
|
51 | + 'TTM_name'=>new EE_Plain_Text_Field('TTM_name', __('The name of the ticket template', 'event_espresso'), false, ''), |
|
52 | + 'TTM_description'=>new EE_Plain_Text_Field('TTM_description', __('The description for the ticket template', 'event_espresso'), true, ''), |
|
53 | + 'TTM_file'=>new EE_Plain_Text_Field('TTM_file', __('The file name for the actual template file saved on disk', 'event_espresso'), true, ''), |
|
54 | 54 | )); |
55 | 55 | $this->_model_relations = array( |
56 | 56 | 'Ticket'=>new EE_Has_Many_Relation() |
57 | 57 | ); |
58 | 58 | $this->_model_chain_to_wp_user = 'Ticket'; |
59 | - $this->_cap_restriction_generators[ EEM_Base::caps_read ] = new EE_Restriction_Generator_Default_Public('Ticket.TKT_is_default', 'Ticket.Datetime.Event' ); |
|
59 | + $this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Default_Public('Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
60 | 60 | //account for default tickets in the caps |
61 | - $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
62 | - $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
63 | - $this->_cap_restriction_generators[ EEM_Base::caps_delete ] = new EE_Restriction_Generator_Default_Protected( 'Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
64 | - parent::__construct( $timezone ); |
|
61 | + $this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
62 | + $this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
63 | + $this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Default_Protected('Ticket.TKT_is_default', 'Ticket.Datetime.Event'); |
|
64 | + parent::__construct($timezone); |
|
65 | 65 | } |
66 | 66 | } //end EEM_Ticket_Template class |
67 | 67 | \ No newline at end of file |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -22,24 +22,24 @@ discard block |
||
22 | 22 | * @param null $timezone |
23 | 23 | * @throws \EE_Error |
24 | 24 | */ |
25 | - protected function __construct( $timezone = NULL ){ |
|
26 | - $this->singular_item = __('WP_User','event_espresso'); |
|
27 | - $this->plural_item = __('WP_Users','event_espresso'); |
|
25 | + protected function __construct($timezone = NULL) { |
|
26 | + $this->singular_item = __('WP_User', 'event_espresso'); |
|
27 | + $this->plural_item = __('WP_Users', 'event_espresso'); |
|
28 | 28 | global $wpdb; |
29 | 29 | $this->_tables = array( |
30 | - 'WP_User'=> new EE_Primary_Table( $wpdb->users, 'ID', true) |
|
30 | + 'WP_User'=> new EE_Primary_Table($wpdb->users, 'ID', true) |
|
31 | 31 | ); |
32 | 32 | $this->_fields = array( |
33 | 33 | 'WP_User'=>array( |
34 | - 'ID'=> new EE_Primary_Key_Int_Field('ID', __('WP_User ID','event_espresso')), |
|
35 | - 'user_login'=>new EE_Plain_Text_Field('user_login', __('User Login','event_espresso'), false, '' ), |
|
36 | - 'user_pass'=>new EE_Plain_Text_Field('user_pass', __('User Password','event_espresso'), false, '' ), |
|
37 | - 'user_nicename'=>new EE_Plain_Text_Field('user_nicename', __(' User Nice Name','event_espresso'), false, ''), |
|
38 | - 'user_email' => new EE_Email_Field('user_email', __( 'User Email', 'event_espresso' ), false), |
|
39 | - 'user_registered' => new EE_Datetime_Field( 'user_registered', __( 'Date User Registered', 'event_espresso' ), false, current_time('timestamp'), $timezone ), |
|
40 | - 'user_activation_key' => new EE_Plain_Text_Field( 'user_activation_key', __( 'User Activation Key', 'event_espresso' ), false, '' ), |
|
41 | - 'user_status' => new EE_Integer_Field( 'user_status', __( 'User Status', 'event_espresso' ), false, 0 ), |
|
42 | - 'display_name' => new EE_Plain_Text_Field( 'display_name', __( 'Display Name', 'event_espresso' ), false, '' ) |
|
34 | + 'ID'=> new EE_Primary_Key_Int_Field('ID', __('WP_User ID', 'event_espresso')), |
|
35 | + 'user_login'=>new EE_Plain_Text_Field('user_login', __('User Login', 'event_espresso'), false, ''), |
|
36 | + 'user_pass'=>new EE_Plain_Text_Field('user_pass', __('User Password', 'event_espresso'), false, ''), |
|
37 | + 'user_nicename'=>new EE_Plain_Text_Field('user_nicename', __(' User Nice Name', 'event_espresso'), false, ''), |
|
38 | + 'user_email' => new EE_Email_Field('user_email', __('User Email', 'event_espresso'), false), |
|
39 | + 'user_registered' => new EE_Datetime_Field('user_registered', __('Date User Registered', 'event_espresso'), false, current_time('timestamp'), $timezone), |
|
40 | + 'user_activation_key' => new EE_Plain_Text_Field('user_activation_key', __('User Activation Key', 'event_espresso'), false, ''), |
|
41 | + 'user_status' => new EE_Integer_Field('user_status', __('User Status', 'event_espresso'), false, 0), |
|
42 | + 'display_name' => new EE_Plain_Text_Field('display_name', __('Display Name', 'event_espresso'), false, '') |
|
43 | 43 | )); |
44 | 44 | $this->_model_relations = array( |
45 | 45 | 'Attendee' => new EE_Has_Many_Relation(), |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | ); |
56 | 56 | $this->_wp_core_model = true; |
57 | 57 | $this->_caps_slug = 'users'; |
58 | - $this->_cap_contexts_to_cap_action_map[ EEM_Base::caps_read ] = 'list'; |
|
59 | - $this->_cap_contexts_to_cap_action_map[ EEM_Base::caps_read_admin ] = 'list'; |
|
60 | - foreach( $this->_cap_contexts_to_cap_action_map as $context => $action ) { |
|
61 | - $this->_cap_restriction_generators[ $context ] = new EE_Restriction_Generator_WP_User(); |
|
58 | + $this->_cap_contexts_to_cap_action_map[EEM_Base::caps_read] = 'list'; |
|
59 | + $this->_cap_contexts_to_cap_action_map[EEM_Base::caps_read_admin] = 'list'; |
|
60 | + foreach ($this->_cap_contexts_to_cap_action_map as $context => $action) { |
|
61 | + $this->_cap_restriction_generators[$context] = new EE_Restriction_Generator_WP_User(); |
|
62 | 62 | } |
63 | 63 | //@todo: account for create_users controls whether they can create users at all |
64 | 64 | |
65 | - parent::__construct( $timezone ); |
|
65 | + parent::__construct($timezone); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * WP User Model. Not intended to replace WP_User, but this just allows |
4 | 6 | * for EE model queries to more easily integrate with the WP User table |
@@ -2,8 +2,8 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Text_Fields is a base class for any fields which are have text value. (Exception: foreign and private key fields. Wish PHP had multiple-inheritance for this...) |
4 | 4 | */ |
5 | -class EE_All_Caps_Text_Field extends EE_Text_Field_Base{ |
|
6 | - function get_wpdb_data_type(){ |
|
5 | +class EE_All_Caps_Text_Field extends EE_Text_Field_Base { |
|
6 | + function get_wpdb_data_type() { |
|
7 | 7 | return '%s'; |
8 | 8 | } |
9 | 9 | |
@@ -13,6 +13,6 @@ discard block |
||
13 | 13 | * @return string |
14 | 14 | */ |
15 | 15 | function prepare_for_set($value_inputted_for_field_on_model_object) { |
16 | - return strtoupper( sanitize_key($value_inputted_for_field_on_model_object)); |
|
16 | + return strtoupper(sanitize_key($value_inputted_for_field_on_model_object)); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once( EE_MODELS . 'fields/EE_DB_Only_Field_Base.php'); |
|
2 | +require_once(EE_MODELS.'fields/EE_DB_Only_Field_Base.php'); |
|
3 | 3 | /** |
4 | 4 | * Used by EE_Belongs_To_Any_Relations and EE_Has_Many_Any_Relations to identify the model the foreign key points to. |
5 | 5 | * Note: the array of model names on this field should match the array of model names on the |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | * 'obj_id'=>new EE_Foreign_Key_Int_Field('obj_id_column',__('Related Object ID'),false,0,array('Registration','Transaction')), |
9 | 9 | * 'obj_type'=>new EE_Any_Foreign_Model_Name_Field('obj_type_column',__('Related Object type'),false,null,array('Registration','Transaction'))); |
10 | 10 | */ |
11 | -class EE_Any_Foreign_Model_Name_Field extends EE_Field_With_Model_Name{ |
|
12 | - function get_wpdb_data_type(){ |
|
11 | +class EE_Any_Foreign_Model_Name_Field extends EE_Field_With_Model_Name { |
|
12 | + function get_wpdb_data_type() { |
|
13 | 13 | return '%s'; |
14 | 14 | } |
15 | 15 | } |
16 | 16 | \ No newline at end of file |
@@ -4,7 +4,7 @@ |
||
4 | 4 | function prepare_for_set($value_inputted_for_field_on_model_object) { |
5 | 5 | if ($value_inputted_for_field_on_model_object){ |
6 | 6 | return true; |
7 | - }else{ |
|
7 | + } else{ |
|
8 | 8 | return false; |
9 | 9 | } |
10 | 10 | } |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once( EE_MODELS . 'fields/EE_Integer_Field.php'); |
|
3 | -class EE_Boolean_Field extends EE_Integer_Field{ |
|
2 | +require_once(EE_MODELS.'fields/EE_Integer_Field.php'); |
|
3 | +class EE_Boolean_Field extends EE_Integer_Field { |
|
4 | 4 | function prepare_for_set($value_inputted_for_field_on_model_object) { |
5 | - if ($value_inputted_for_field_on_model_object){ |
|
5 | + if ($value_inputted_for_field_on_model_object) { |
|
6 | 6 | return true; |
7 | - }else{ |
|
7 | + } else { |
|
8 | 8 | return false; |
9 | 9 | } |
10 | 10 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * @return boolean |
15 | 15 | */ |
16 | 16 | function prepare_for_set_from_db($value_inputted_for_field_on_model_object) { |
17 | - return intval( $value_inputted_for_field_on_model_object ) ? true : false; |
|
17 | + return intval($value_inputted_for_field_on_model_object) ? true : false; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | * @param boolean $value_on_field_to_be_outputted |
23 | 23 | * @return string Yes or No |
24 | 24 | */ |
25 | - function prepare_for_pretty_echoing( $value_on_field_to_be_outputted ) { |
|
25 | + function prepare_for_pretty_echoing($value_on_field_to_be_outputted) { |
|
26 | 26 | return apply_filters( |
27 | 27 | 'FHEE__EE_Boolean_Field__prepare_for_pretty_echoing__return', |
28 | - $value_on_field_to_be_outputted ? __( 'Yes', 'event_espresso' ) : __( 'No', 'event_espresso' ), |
|
28 | + $value_on_field_to_be_outputted ? __('Yes', 'event_espresso') : __('No', 'event_espresso'), |
|
29 | 29 | $value_on_field_to_be_outputted |
30 | 30 | ); |
31 | 31 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * special default values for them, or some other column-specific functionality. So we can add them as fields, |
8 | 8 | * but db-only ones |
9 | 9 | */ |
10 | -abstract class EE_DB_Only_Field_Base extends EE_Model_Field_Base{ |
|
10 | +abstract class EE_DB_Only_Field_Base extends EE_Model_Field_Base { |
|
11 | 11 | /** |
12 | 12 | * All these children classes are for the db-only (meaning, we should select them |
13 | 13 | * on get_all queries, update, delete, and will still want to set their default value |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | -require_once( EE_MODELS . 'fields/EE_DB_Only_Field_Base.php'); |
|
3 | -class EE_DB_Only_Float_Field extends EE_DB_Only_Field_Base{ |
|
4 | - function get_wpdb_data_type(){ |
|
2 | +require_once(EE_MODELS.'fields/EE_DB_Only_Field_Base.php'); |
|
3 | +class EE_DB_Only_Float_Field extends EE_DB_Only_Field_Base { |
|
4 | + function get_wpdb_data_type() { |
|
5 | 5 | return '%f'; |
6 | 6 | } |
7 | 7 | } |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once( EE_MODELS . 'fields/EE_DB_Only_Field_Base.php'); |
|
4 | -class EE_DB_Only_Int_Field extends EE_DB_Only_Field_Base{ |
|
5 | - function get_wpdb_data_type(){ |
|
3 | +require_once(EE_MODELS.'fields/EE_DB_Only_Field_Base.php'); |
|
4 | +class EE_DB_Only_Int_Field extends EE_DB_Only_Field_Base { |
|
5 | + function get_wpdb_data_type() { |
|
6 | 6 | return '%d'; |
7 | 7 | } |
8 | 8 | } |
9 | 9 | \ No newline at end of file |