Code Duplication    Length = 19-20 lines in 2 locations

includes/API/Actions/CountAction.php 1 location

@@ 61-80 (lines=20) @@
58
		return $apiDocument;
59
	}
60
61
	private function getAccountsCreated()
62
	{
63
		$query = <<<QUERY
64
        SELECT COUNT(*) AS count
65
        FROM log
66
            LEFT JOIN emailtemplate ON concat('Closed ', emailtemplate.id) = log.action
67
            INNER JOIN user ON log.user = user.id
68
        WHERE
69
            (oncreated = '1' OR log.action = 'Closed custom-y')
70
            AND log.objecttype = 'Request'
71
            AND user.username = :username;
72
QUERY;
73
74
		$statement = $this->database->prepare($query);
75
		$statement->execute(array(":username" => $this->user->getUsername()));
76
		$result = $statement->fetchColumn();
77
		$statement->closeCursor();
78
79
		return $result;
80
	}
81
82
	private function getToday()
83
	{

includes/DataObjects/User.php 1 location

@@ 875-893 (lines=19) @@
872
		return md5($this->username . $this->email . $this->welcome_template . $this->id . $this->password);
873
	}
874
875
	public function getApprovalDate()
876
	{
877
		$query = $this->dbObject->prepare(<<<SQL
878
			SELECT timestamp 
879
			FROM log 
880
			WHERE objectid = :userid
881
				AND objecttype = 'User'
882
				AND action = 'Approved' 
883
			ORDER BY id DESC 
884
			LIMIT 1;
885
SQL
886
		);
887
		$query->execute(array(":userid" => $this->id));
888
        
889
		$data = DateTime::createFromFormat("Y-m-d H:i:s", $query->fetchColumn());
890
		$query->closeCursor();
891
        
892
		return $data;
893
	}
894
	
895
	public function getObjectDescription()
896
	{