![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 236 Pomógł: 0 Dołączył: 27.10.2012 Ostrzeżenie: (0%) ![]() ![]() |
Witam
mam problem z zapisaniem wartości wybranej z listy wyboru <select></select> - parentId. Pojawia się komunikat: [2/2] DBALException: An exception occurred while executing 'INSERT INTO menu (sort, parentId, enabled, label, link) VALUES (?, ?, ?, ?, ?)' with params [6, {}, 0, "fhgfgffh", "fghfghfhfh"]: Catchable Fatal Error: Object of class BackendBundle\Entity\Menu could not be converted to string Czepia się o parentId :/ Prosze o pomoc. w Entity: Menu.php mam:
MenuType.php: (Lista select pobierana jest z bazy)
MenuController:
Ten post edytował dopelganger 21.04.2016, 11:25:55 |
|
|
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 1 270 Pomógł: 184 Dołączył: 7.10.2012 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
A dlaczego kolumne masz typu Integer a próbujesz dodać obiekty {} ?
|
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 236 Pomógł: 0 Dołączył: 27.10.2012 Ostrzeżenie: (0%) ![]() ![]() |
A dlaczego kolumne masz typu Integer a próbujesz dodać obiekty {} ? Jak dodam __toString to nie wywala tego błędu ale nie zapisuje wartości do tabeli - jest NULL. object(Symfony\Component\HttpFoundation\ParameterBag)#8 (1) { ["parameters":protected]=> array(1) { ["backendbundle_menu"]=> array(6) { ["submit"]=> string(0) "" ["_token"]=> string(43) "NRolS8JFgx-kmp9J3ek8O-rf4i4MLtUlZUUtJyxnrFs" ["label"]=> string(17) "test" ["parentId"]=> string(1) "1" ["link"]=> string(11) "test" ["sort"]=> string(2) "2" } } } wartość parentId jest (jak widać), ale nie zapisuje jej wartości do tabeli :/ przykladowo dam tak: i zapisze , więc jak pobrać tego POSTA :/ ????????????????????????? Ten zapis również daje NULL:
Ten post edytował dopelganger 21.04.2016, 14:47:38 |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 14.07.2025 - 15:50 |