From d64606c8616df486b11669c42ebd98e76ca970d2 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Thu, 12 Jul 2018 12:06:55 +0200 Subject: [PATCH] beautify code --- src/core/article.cpp | 8 +++++--- src/core/article.h | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/article.cpp b/src/core/article.cpp index 3270da7..b56c413 100644 --- a/src/core/article.cpp +++ b/src/core/article.cpp @@ -10,8 +10,10 @@ void Article::setPrice(int price) { price_ = price; } void Article::setDescription(const std::string& description) { description_ = description; } -std::string Article::getDescription() { return description_; } - void Article::setSale(std::shared_ptr salePtr) { salePtr_ = salePtr; } -bool Article::isSold() { return salePtr_ ? true : false; } \ No newline at end of file +bool Article::isSold() { return salePtr_ ? true : false; } + +std::string Article::getDescription() { return description_; } + +Seller* Article::getSeller() { return sellerPtr_.get(); } \ No newline at end of file diff --git a/src/core/article.h b/src/core/article.h index 1d0487b..4042924 100644 --- a/src/core/article.h +++ b/src/core/article.h @@ -18,11 +18,13 @@ class Article : public Entity void setArticleNo(int articleNo); void setPrice(int price); void setDescription(const std::string& description); - std::string getDescription(); bool isSold(); void setSale(std::shared_ptr salePtr); void setSeller(std::shared_ptr sellerPtr); + std::string getDescription(); + Seller* getSeller(); + private: std::shared_ptr sellerPtr_{}; std::shared_ptr salePtr_{};