Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [SF][SF2][Symfony2]AppBundle\Entity\Orders object not found.
Crash89
post
Post #1





Grupa: Zarejestrowani
Postów: 191
Pomógł: 7
Dołączył: 3.04.2013

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


Tworząc nową akcję spotkałem się z takim problemem:
AppBundle\Entity\Orders object not found.
404 Not Found - NotFoundHttpException
C:\Users\rosmith\shrub_search\vendor\sensio\framework-extra-bundle\Request\ParamConverter\DoctrineParamConverter.php line 66


Tak jakby nie widział tego entity, adres jest wpisany poprawnie.
Używam Symfony 3.1

Poniżej jest kod gdzie tworzę instancję tej klasy.
  1. /**
  2.   * @Route("/order-without-pay", name="order_without_pay")
  3.   * @Method("GET")
  4.   */
  5. public function orderWithoutPayAction() {
  6. $em = $this->getDoctrine()->getManager();
  7. $cart = new Cart($em);
  8.  
  9. $ordersModel = new OrdersModel($em);
  10. $ordersModel->add($cart);
  11. }
  12.  
  13. //klasa ordersModel
  14. public function add($cart) {
  15. $orders = new Orders();
  16. var_dump($cart);
  17. die();
  18. }


Problem występuję przy wczytywaniu klasy Orders w przestrzeni nazw.
Wszystkie inne entity działają, w przestrzeni nazw ścieżka jest wpisana poprawnie.

Proszę o pomoc.

Ten post edytował Crash89 17.03.2018, 17:14:30
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




pokaz poczatek plik Orders.php
Go to the top of the page
+Quote Post
Crash89
post
Post #3





Grupa: Zarejestrowani
Postów: 191
Pomógł: 7
Dołączył: 3.04.2013

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


Cytat(nospor @ 16.03.2018, 17:55:13 ) *
pokaz poczatek plik Orders.php



  1. namespace AppBundle\Entity;
  2.  
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use AppBundle\Entity\Payments;
  6. use AppBundle\Entity\OrdersProducts;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9.  
  10. /**
  11.  * Orders
  12.  *
  13.  * @ORM\Table(name="orders")
  14.  * @ORM\Entity(repositoryClass="AppBundle\Repository\OrdersRepository")
  15.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
  16.  */
  17. class Orders


Tutaj jest wszystko co się dzieje przed definicją klasy

Ten post edytował Crash89 16.03.2018, 18:06:35
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 8.10.2025 - 20:44