/** * @param UserInterface $user * @param MessageInterface $message * @return bool */ public function sendNotification(UserInterface $user, MessageInterface $message) { $this->telegramCli->msg($user->getPhoneNumber()->getValue(), $message->getText()); return true; }
/** * @param UserInterface $user * @return bool */ public function update(UserInterface $user) { $tableName = self::TABLE; $sql = <<<SQL UPDATE `{$tableName}` SET `phone_number` = ':phone_number', `email` : ':email', `preferred_notify_way` = ':preferred_notify_way' WHERE `id` = ':id' SQL; $statement = $this->pdo->prepare($sql); $statement->bindValue(array(':id', ':phone_number', ':email', ':preferred_notify_way'), array($user->getId()->getValue(), $user->getPhoneNumber()->getValue(), $user->getEmail()->getValue(), $user->getPreferredNotifyWay()->getValue())); $statement->execute(); }