function deleteUserById($userId) { $bind = ['partnerId' => Config::getInstance()->partnerId, 'userId' => $userId]; $user = $this->db->select('users', 'partnerId = :partnerId AND userId = :userId', $bind); if (count($user) == 1) { $user = $user[0]; $userId = $user['userId']; switch ($user['role']) { case Defines::ROLE_DOCTOR: $this->db->delete('doctors', 'doctorId = :userId', ['userId' => $userId]); break; case Defines::ROLE_CLIENT: $this->db->delete('clients', 'clientId = :userId', ['userId' => $userId]); break; } return $this->db->delete('users', 'userId = :userId', ['userId' => $userId]); } return false; }
public function deleteOrder($orderId) { return $this->db->delete('orders', 'partnerId = :partnerId AND orderId = :orderId', ['partnerId ' => Config::getInstance()->partnerId, 'orderId' => $orderId]); }
public function deleteDayWorkingTimes($doctorId, \DateTime $date) { $bind = ['partnerId' => Config::getInstance()->partnerId, 'doctorId' => $doctorId, 'date' => $date->format('Y-m-d')]; $where = 'partnerId = :partnerId AND doctorId = :doctorId AND date = :date'; return $this->db->delete('workingTimes', $where, $bind); }