private function checkThatHostnameIsValidOnUpdate($id, $hostname) { if (!$hostname) { return true; } if ($this->dao->getNumberOfMirrorByHostnameExcludingGivenId($hostname, $id) > 0) { throw new Git_Mirror_HostnameAlreadyUsedException(); } if ($this->doesHostnameIsForbidden($hostname)) { throw new Git_Mirror_HostnameIsReservedException(); } return true; }