Code Duplication    Length = 4-15 lines in 3 locations

core/db_classes/EE_Base_Class.class.php 1 location

@@ 986-1000 (lines=15) @@
983
	public function get_DateTime_object( $field_name ) {
984
		$field_settings = $this->get_model()->field_settings_for( $field_name );
985
986
		if ( ! $field_settings instanceof EE_Datetime_Field ) {
987
			EE_Error::add_error(
988
				sprintf(
989
					__(
990
						'The field %s is not an EE_Datetime_Field field.  There is no DateTime object stored on this field type.',
991
						'event_espresso'
992
					),
993
					$field_name
994
				),
995
				__FILE__,
996
				__FUNCTION__,
997
				__LINE__
998
			);
999
			return false;
1000
		}
1001
1002
		return $this->_fields[$field_name];
1003
	}

core/admin/EE_Admin_Page.core.php 1 location

@@ 3333-3336 (lines=4) @@
3330
		if ( $config_saved && $net_saved ) {
3331
			EE_Error::add_success( sprintf( __('"%s" have been successfully updated.', 'event_espresso'), $tab ));
3332
			return TRUE;
3333
		} else {
3334
			EE_Error::add_error( sprintf( __('The "%s" were not updated.', 'event_espresso'), $tab ), $file, $func, $line  );
3335
			return FALSE;
3336
		}
3337
	}
3338
3339

core/libraries/messages/EE_Messages_Processor.lib.php 1 location

@@ 502-505 (lines=4) @@
499
500
		foreach( $regIDs as $regID ) {
501
			$reg = EEM_Registration::instance()->get_one_by_ID( $regID );
502
			if ( ! $reg instanceof EE_Registration ) {
503
				EE_Error::add_error( sprintf( __('Unable to retrieve a registration object for the given reg id (%s)', 'event_espresso'), $regID ) );
504
				return false;
505
			}
506
			$regs_to_send[$reg->transaction_ID()][$reg->status_ID()][] = $reg;
507
		}
508