209 похожих чатов

Привет всем, мне надо вывести ошибку если у записи а

связанные записи.Например при удалении категории если у категории есть сабкатегории то вынести ошибку.Написать это сам вручную или есть способ решить в моделе?

7 ответов

14 просмотров

Я проверяю на наличие подкатегорий вначале. Если есть, выкидываю ошибку - удалить невозможно, у категории с id = 4 есть подкатегории. Кто-то тут советовал вместо этого парсить ошибку SQL (constraint бла-бла). Но я пока не понял как это нормально сделать

Dawut- Автор вопроса
Dawut- Автор вопроса
Dawut- Автор вопроса
Alexander Morozov
Я проверяю на наличие подкатегорий вначале. Если е...

Импортировал модуль с сервисом и юзаю оттуда методи

Dawut
Импортировал модуль с сервисом и юзаю оттуда ме...

Я сделал отдельный ValidationModule для этого. Его и юзаю везде

Dawut- Автор вопроса
Alexander Morozov
Я сделал отдельный ValidationModule для этого. Его...

Типо там ищещь через Id и кидаешь ошибку ?

Dawut- Автор вопроса
Alexander Morozov
Я сделал отдельный ValidationModule для этого. Его...

Ты работал с загрузка файлов на локал?

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

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

can anyone here tell me the exact liqudation % when i supplied 100 usdt and borrowed bnb with borrow limit used 66.21 % ? usually bnb borrow limit is 80% and i guess 85 ...
jacky chan
9
Lol is just wrote a long text about tokenomics etc and it was directly deleted, no curses or similar so i write it again in shorter. Hey Ben 600m eco system tokens, around 30...
. Duss
3
Is Kadena onto something special? No one really knows. Good luck!
Bright Uncle Stephen EqualBet
40
I'm new at Monero and I'd like to ask you all - why are you in Monero? I know about privacy but what do you expect to happen in the next years, decades that Monero will make i...
Konrad
19
I am YouTuber....I promoted more than 150+ different crypto project on my YouTube channel....for marketing proposal whose admin is here?
YouTube Review Video Service DM Me 9
9
At which price point will BCH, an ASIC mined coin, be succeptible to reorg attacks because of low hashrate? $10? $1? $0.1? $0.01?
Kishniev
18
But 0.6 XMR are newly created or they just come from transaction fees?
Vincenzo Tamborino F
17
Every one that has a concern about the project or the team, is only having a “concern” because of the price. If you had a long term vision, you wouldn’t be concerned.. who els...
Zain
7
2 years ago I bought akt on Bittrex, at that time it gave a withdrawal option to the polygon network. I have read in this chat and they say that akt is not in polygon but if ...
TW
13
I arrived here after a Chico Crypto show highlighted the project & the Team - the fact that the Team had a long history of successfully working with household names gave me e...
Banter is Bullish
5
Карта сайта