Code Duplication    Length = 3-3 lines in 5 locations

core/db_models/EEM_CPT_Base.model.php 5 locations

@@ 91-93 (lines=3) @@
88
		if ( ! isset( $this->_fields[$primary_table_name]['status'] )) {
89
			$this->_fields[$primary_table_name]['status'] = new EE_WP_Post_Status_Field('post_status', __("Event Status", "event_espresso"), false, 'draft');
90
		}
91
		if( ! isset( $this->_fields[$primary_table_name]['to_ping'])){
92
			$this->_fields[$primary_table_name]['to_ping'] = new EE_DB_Only_Text_Field('to_ping', __( 'To Ping', 'event_espresso' ), FALSE, '');
93
		}
94
		if( ! isset( $this->_fields[$primary_table_name]['pinged'])){
95
			$this->_fields[$primary_table_name]['pinged'] = new EE_DB_Only_Text_Field('pinged', __( 'Pinged', 'event_espresso' ), FALSE, '');
96
		}
@@ 94-96 (lines=3) @@
91
		if( ! isset( $this->_fields[$primary_table_name]['to_ping'])){
92
			$this->_fields[$primary_table_name]['to_ping'] = new EE_DB_Only_Text_Field('to_ping', __( 'To Ping', 'event_espresso' ), FALSE, '');
93
		}
94
		if( ! isset( $this->_fields[$primary_table_name]['pinged'])){
95
			$this->_fields[$primary_table_name]['pinged'] = new EE_DB_Only_Text_Field('pinged', __( 'Pinged', 'event_espresso' ), FALSE, '');
96
		}
97
98
		if( ! isset( $this->_fields[$primary_table_name]['comment_status'])){
99
			$this->_fields[$primary_table_name]['comment_status'] = new EE_Plain_Text_Field('comment_status', __('Comment Status', 'event_espresso' ), FALSE, 'open');
@@ 98-100 (lines=3) @@
95
			$this->_fields[$primary_table_name]['pinged'] = new EE_DB_Only_Text_Field('pinged', __( 'Pinged', 'event_espresso' ), FALSE, '');
96
		}
97
98
		if( ! isset( $this->_fields[$primary_table_name]['comment_status'])){
99
			$this->_fields[$primary_table_name]['comment_status'] = new EE_Plain_Text_Field('comment_status', __('Comment Status', 'event_espresso' ), FALSE, 'open');
100
		}
101
102
		if( ! isset( $this->_fields[$primary_table_name]['ping_status'])){
103
			$this->_fields[$primary_table_name]['ping_status'] = new EE_Plain_Text_Field('ping_status', __('Ping Status', 'event_espresso'), FALSE, 'open');
@@ 102-104 (lines=3) @@
99
			$this->_fields[$primary_table_name]['comment_status'] = new EE_Plain_Text_Field('comment_status', __('Comment Status', 'event_espresso' ), FALSE, 'open');
100
		}
101
102
		if( ! isset( $this->_fields[$primary_table_name]['ping_status'])){
103
			$this->_fields[$primary_table_name]['ping_status'] = new EE_Plain_Text_Field('ping_status', __('Ping Status', 'event_espresso'), FALSE, 'open');
104
		}
105
106
		if( ! isset( $this->_fields[$primary_table_name]['post_content_filtered'])){
107
			$this->_fields[$primary_table_name]['post_content_filtered'] = new EE_DB_Only_Text_Field('post_content_filtered', __( 'Post Content Filtered', 'event_espresso' ), FALSE, '');
@@ 106-108 (lines=3) @@
103
			$this->_fields[$primary_table_name]['ping_status'] = new EE_Plain_Text_Field('ping_status', __('Ping Status', 'event_espresso'), FALSE, 'open');
104
		}
105
106
		if( ! isset( $this->_fields[$primary_table_name]['post_content_filtered'])){
107
			$this->_fields[$primary_table_name]['post_content_filtered'] = new EE_DB_Only_Text_Field('post_content_filtered', __( 'Post Content Filtered', 'event_espresso' ), FALSE, '');
108
		}
109
		if( ! isset( $this->_model_relations[ 'Post_Meta' ] ) ) {
110
			//don't block deletes though because we want to maintain the current behaviour
111
			$this->_model_relations[ 'Post_Meta' ] = new EE_Has_Many_Relation( false );