Completed
Push — master ( c7decf...185c12 )
by Jamie
11s
created

FrmEmailHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_user_id_field_for_form() 0 9 1
A remove_mandrill_br() 0 3 1
1
<?php
2
3
/**
4
 * @since 2.03.04
5
 */
6
class FrmEmailHelper {
7
8
	/**
9
	 * Get the userID field from a form
10
	 * This will not get repeating or embedded userID fields
11
	 *
12
	 * @since 2.03.04
13
	 *
14
	 * @param int $form_id
15
	 * @return int
16
	 */
17
	public static function get_user_id_field_for_form( $form_id ) {
18
		$where = array(
19
			'type' => 'user_id',
20
			'form_id' => $form_id,
21
		);
22
		$user_id_field = FrmDb::get_var( 'frm_fields', $where, 'id' );
23
24
		return (int) $user_id_field;
25
	}
26
27
	/**
28
	 * This function should only be fired when Mandrill is sending an HTML email
29
	 * This will make sure Mandrill doesn't mess with our HTML emails
30
	 *
31
	 * @since 2.03.04
32
	 *
33
	 * @return bool
34
	 */
35
	public static function remove_mandrill_br() {
36
		return false;
37
	}
38
}