Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [inny][SF2] Relacja N:M CRUD - problem
basso
post
Post #1





Grupa: Zarejestrowani
Postów: 155
Pomógł: 1
Dołączył: 12.12.2010

Ostrzeżenie: (0%)
-----


Witam,
Wygenerowałem dzisiaj sobie CRUD z relacją N:M.
Hmm wszystko spoko wygnerowało, działa listowanie i to wszystko.
Jak daje nowy to mam wieczny problem:
W przypadku Tworzenia Usera
  1. [2/2] StringCastException: A "__toString()" method was not found on the objects of type "Multimedia\AccountBundle\Entity\Group" passed to the choice field. To read a custom getter instead, set the option "property" to the desired property path. -+


W przypadku tworzenia grupy
  1. A "__toString()" method was not found on the objects of type "Multimedia\AccountBundle\Entity\User" passed to the choice field. To read a custom getter instead, set the option "property" to the desired property path.


Z tutoriala, z książki i z filmów youtube robię => non stop to samo sad.gif. Ręce opadają.


Relacje w Encjach zapisuje jako:
Tabela Users
class User implements UserInterface, \Serializable
{
  1. /**
  2.   * @ORM\ManyToMany(targetEntity="Group", inversedBy="users")
  3.   *
  4.   */
  5. private $groups;
  6.  
  7. itd.



Tabela group:
  1. /**
  2.  * @ORM\Table(name="groups")
  3.  * @ORM\Entity()
  4.  */
  5. class Group implements RoleInterface
  6. {
  7.  
  8. /**
  9.   * @ORM\ManyToMany(targetEntity="User", mappedBy="groups" )
  10.   */
  11. private $users;
  12.  
  13. itd.



Pomocy.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 01:14