Completed
Branch FET-8896-previous-event-status (7c2952)
by
unknown
510:14 queued 492:55
created

EE_Extra_Join   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A new_instance() 0 4 2
A new_instance_from_db() 0 3 1
1
<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
2
/**
3
 * Contains definition for EE_Extra_Join model object
4
 * @package 		Event Espresso
5
 * @subpackage 	models
6
 * @since 			$VID$
7
 */
8
9
/**
10
 * EE_Extra_Join
11
 * This is the model object for EEM_Event_Message_Template
12
 *
13
 * @package 		Event Espresso
14
 * @subpackage 	models
15
 * @author 			Darren Ethier
16
 * @since 			4.3.0
17
 */
18
class EE_Extra_Join extends EE_Base_Class {
19
20
	/**
21
	 * @param array $props_n_values
22
	 * @param null  $timezone
23
	 * @return EE_Extra_Join|mixed
24
	 */
25
	public static function new_instance( $props_n_values = array(), $timezone = NULL ) {
26
		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone );
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (_check_for_object() instead of new_instance()). Are you sure this is correct? If so, you might want to change this to $this->_check_for_object().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
27
		return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone );
28
	}
29
30
31
32
	/**
33
	 * @param array $props_n_values
34
	 * @param null  $timezone
35
	 * @return EE_Extra_Join
36
	 */
37
	public static function new_instance_from_db ( $props_n_values = array(), $timezone = NULL ) {
38
		return new self( $props_n_values, TRUE, $timezone );
39
	}
40
41
}
42
//end class EE_Extra_Join
43