Code Duplication    Length = 7-9 lines in 3 locations

apps/user_ldap/lib/Mapping/AbstractMapping.php 3 locations

@@ 121-129 (lines=9) @@
118
	 * @param string $uuid
119
	 * @return bool
120
	 */
121
	public function setDNbyUUID($fdn, $uuid) {
122
		$query = $this->dbc->prepare('
123
			UPDATE `' . $this->getTableName() . '`
124
			SET `ldap_dn` = ?
125
			WHERE `directory_uuid` = ?
126
		');
127
128
		return $this->modify($query, array($fdn, $uuid));
129
	}
130
131
	/**
132
	 * Updates the UUID based on the given DN
@@ 140-148 (lines=9) @@
137
	 * @param $fdn
138
	 * @return bool
139
	 */
140
	public function setUUIDbyDN($uuid, $fdn) {
141
		$query = $this->dbc->prepare('
142
			UPDATE `' . $this->getTableName() . '`
143
			SET `directory_uuid` = ?
144
			WHERE `ldap_dn` = ?
145
		');
146
147
		return $this->modify($query, [$uuid, $fdn]);
148
	}
149
150
	/**
151
	 * Gets the name based on the provided LDAP DN.
@@ 262-268 (lines=7) @@
259
	 * @param string $name
260
	 * @return bool
261
	 */
262
	public function unmap($name) {
263
		$query = $this->dbc->prepare('
264
			DELETE FROM `'. $this->getTableName() .'`
265
			WHERE `owncloud_name` = ?');
266
267
		return $this->modify($query, array($name));
268
	}
269
270
	/**
271
	 * Truncate's the mapping table