Похожие чаты

Hello, devs. I have such piece of code class NewsTableGateway {

private $db;
private $table;

public function __construct(Database $db)
{
$this->db = $db->getInstance();
$this->table = getenv('NEWS_DB_TABLE');
}
<PDO-based methods>
}
in three classes with slightly different names of table and class, so: is it correct to put it into abstract class? Or I misunderstand it's purpose?

1 ответов

10 просмотров

You can put define the abstract class and methods and then extend this class from your abstract, abstract class and method cannot be instantiated and shouldn't not contain implementation, only guidelines and signatures

Похожие вопросы

Обсуждают сегодня

А как старый хаскел с новым стыковать ? потому как тут работает https://play.haskell.org/saved/C3xpMzcd, а вот тут https://stepik.org/lesson/7602/step/9?unit=1473 нет ошибка C...
Fedor
131
Делаю велосипед логгер. К сообщению хочу прикрутить некоторую информацию, типа, кем отправлено, какой уровень, и всякое такое. И тут подумалось мне, почему бы не хранить весь...
Serjone
24
Вопрос я правильно понимаю что в коде newtype ArrowMap k v = ArrowMap { getArrowMap :: k -> Maybe v } getArrowMap есть функция типа k -> Maybe v, если да, то не понимаю задач...
Fedor
64
Всем привет! Использую gitlab-ci. Настроил gitlab-agent для деплоя в куб. При деплое проекта в логах такая ошибка: Executing deploy plan failed to watch "ns:my-project/Ingress...
Konstantin Moiseev
4
For the people that think monero should be used solely as a currency and not as a security/asset, can y’all explain? In my opinion, Monero can be great at both
glen 🔟
12
Since this HBAR page is so sensitive to words and criticism, I'll have to put this more delicately. What's up with this? DBS, a Hedera GC member holding $647 million in ETH?...
Summit Seeker R
11
Как Вы считаете нормально ли в двадцатых годах 21 века в ВУЗах Российской Федерации обучать студентов работе с TASM? Не слишком ли это "архаично"? (Если оффтоп или флейм для э...
Spiker01
52
I am honored to report that all the deliverables for the BCHFAQ Flipstarter Phase 1 have been completed. I appreciate the opportunity I've had to put all this together using t...
fixthetracking
15
What do you think they are trying to do ?
Ronan Gill
15
VIP-317 XVS bridge between Arbitrum one and BNB Chain, Ethereum and opBNB Summary Following the community proposal [VRC] Deploy Venus Protocol on Arbitrum, and the associate...
Venus Announcements
1
Карта сайта