Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP+Symfony] błąd przy instalacji SOFUserBundle
dopelganger
post
Post #1





Grupa: Zarejestrowani
Postów: 236
Pomógł: 0
Dołączył: 27.10.2012

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


cześć
mam problem z instalacją SOFa, wywala byka:

  1. ClassNotFoundException: Attempted to load class "User" from namespace "FOS\UserBundle\Entity" in /home/example.com/src/Admin/AdminBundle/Entity/User.php line 13. Do you need to "use" it from another namespace? Perhaps you need to add a use statement for one of the following: Symfony\Bridge\Doctrine\Tests\Fixtures\User, Symfony\Component\Security\Core\User\User.


żródło /Entity/User.php:

  1. <?php
  2.  
  3. namespace Admin\AdminBundle\Entity;
  4.  
  5. use FOS\UserBundle\Entity\User as BaseUser;
  6. use Doctrine\ORM\Mapping as ORM;
  7.  
  8. /**
  9.  * @ORM\Entity
  10.  * @ORM\Table(name="users_FOS")
  11.  */
  12. class User extends BaseUser
  13. {
  14. /**
  15.   * @ORM\Id
  16.   * @ORM\Column(type="integer")
  17.   * @ORM\GeneratedValue(strategy="AUTO")
  18.   */
  19. protected $id;
  20.  
  21. public function __construct()
  22. {
  23. parent::__construct();
  24. // your own logic
  25. }
  26. }
  27.  
  28.  

Go to the top of the page
+Quote Post
pyro
post
Post #2





Grupa: Zarejestrowani
Postów: 2 148
Pomógł: 230
Dołączył: 26.03.2008

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


Cytat(dopelganger)
Attempted to load class "User" from namespace "FOS\UserBundle\Entity"


=/=

Cytat(dopelganger)
namespace Admin\AdminBundle\Entity;


--------------------
ET LINGUA EIUS LOQUETUR IUDICIUM
Go to the top of the page
+Quote Post
seeba
post
Post #3





Grupa: Zarejestrowani
Postów: 11
Pomógł: 1
Dołączył: 28.01.2010

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


Masz FOS UserBunde w katalogu vendor?
Go to the top of the page
+Quote Post
Forti
post
Post #4





Grupa: Zarejestrowani
Postów: 655
Pomógł: 73
Dołączył: 2.05.2014

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


zmień:

Kod
FOS\UserBundle\Entity\User


na

Kod
FOS\UserBundle\Model\User



Nie wiem dlaczego, może taka praktyka... ale fos trzyma encje w folderze Model a nie Entity.

Ten post edytował Forti 11.02.2015, 13:45:46


--------------------
Overwatch24 - najbardziej zaawansowany Polski portal Overwatch od fanów dla fanów.

Fachowo.co

Behance.net/fachowo
Go to the top of the page
+Quote Post
ohm
post
Post #5





Grupa: Zarejestrowani
Postów: 623
Pomógł: 144
Dołączył: 22.12.2010

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


Cytat(Forti @ 11.02.2015, 13:35:28 ) *
Nie wiem dlaczego, może taka praktyka... ale fos trzyma encje w folderze Model a nie Entity.

Często klasy które mają być dziedziczone trafiają do Model (jako model dla encji wink.gif )
Go to the top of the page
+Quote Post

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: 20.08.2025 - 04:44