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

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