Code Duplication    Length = 20-20 lines in 2 locations

programs/utilit/agent_right.class.php 1 location

@@ 107-126 (lines=20) @@
104
	 * 
105
	 * @return array
106
	 */
107
	public function getRow()
108
	{
109
		if (null === $this->row)
110
		{
111
			global $babDB;
112
			
113
			if (isset($this->id))
114
			{
115
				$res = $babDB->db_query('SELECT * FROM absences_users_rights WHERE id='.$babDB->quote($this->id));
116
				$this->setRow($babDB->db_fetch_assoc($res));
117
				
118
			} else if (isset($this->agent) && isset($this->right))
119
			{
120
				$res = $babDB->db_query('SELECT * FROM absences_users_rights WHERE id_user='.$babDB->quote($this->agent->getIdUser()).' AND id_right='.$babDB->quote($this->right->id));
121
				$this->setRow($babDB->db_fetch_assoc($res));
122
			}
123
		}
124
		
125
		return $this->row;
126
	}
127
	
128
	/**
129
	 * 

programs/utilit/collection_right.class.php 1 location

@@ 64-83 (lines=20) @@
61
	 *
62
	 * @return array
63
	 */
64
	public function getRow()
65
	{
66
		if (null === $this->row)
67
		{
68
			global $babDB;
69
	
70
			if (isset($this->id))
71
			{
72
				$res = $babDB->db_query('SELECT * FROM absences_coll_rights WHERE id='.$babDB->quote($this->id));
73
				$this->setRow($babDB->db_fetch_assoc($res));
74
	
75
			} else if (isset($this->collection) && isset($this->right))
76
			{
77
				$res = $babDB->db_query('SELECT * FROM absences_coll_rights WHERE id_coll='.$babDB->quote($this->collection->id).' AND id_right='.$babDB->quote($this->right->id));
78
				$this->setRow($babDB->db_fetch_assoc($res));
79
			}
80
		}
81
	
82
		return $this->row;
83
	}
84
	
85
	/**
86
	 *