Guest User

Untitled

a guest
Jan 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. <?php
  2.  
  3. // I want to get a Accion Entity by querying
  4.  
  5. $action = $entityManager->getRepository('Accion')->findOneBy(array('metodo' => 'default','idModule' => 'home'));
  6. ?>
  7. // And get this error message
  8. Fatal error:
  9. Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'Class Accion is not a valid entity or mapped super class.'
  10.  
  11.  
  12. // DEFINITIONS file accion.class.php //
  13.  
  14. <?php
  15. /*
  16. * Accion
  17. *
  18. * @Table(name="app_acciones")
  19. * @Entity
  20. * */
  21. class Accion extends DAO\AppAcciones
  22. {
  23. /**
  24. * @var Rol
  25. *
  26. * @ManyToMany(targetEntity="Rol", mappedBy="idaccion")
  27. */
  28. private $idrol;
  29.  
  30. /**
  31. * @var Module
  32. *
  33. * @ManyToOne(targetEntity="Module")
  34. * @JoinColumns({
  35. * @JoinColumn(name="idModule", referencedColumnName="idModule")
  36. * })
  37. */
  38. private $idmodule;
  39.  
  40.  
  41. }
  42. ?>
  43. // and AppAcciones.php
  44. <?php
  45.  
  46. namespace DAO;
  47.  
  48. /**
  49. * AppAcciones
  50. *
  51. * @MappedSuperclass
  52. */
  53. class AppAcciones
  54. {
  55. /**
  56. * @var integer $idaccion
  57. *
  58. * @Column(name="idAccion", type="integer", nullable=false)
  59. * @Id
  60. * @GeneratedValue(strategy="IDENTITY")
  61. */
  62. private $idaccion;
  63.  
  64. /**
  65. * @var string $metodo
  66. *
  67. * @Column(name="metodo", type="string", length=45, nullable=false)
  68. */
  69. private $metodo;
  70.  
  71. /**
  72. * @var boolean $activo
  73. *
  74. * @Column(name="activo", type="boolean", nullable=false)
  75. */
  76. private $activo;
  77.  
  78. /**
  79. * @var string $nombre
  80. *
  81. * @Column(name="nombre", type="string", length=45, nullable=false)
  82. */
  83. private $nombre;
  84.  
  85. /**
  86. * @var string $descripcion
  87. *
  88. * @Column(name="descripcion", type="string", length=200, nullable=false)
  89. */
  90. private $descripcion;
  91.  
  92. public function __construct()
  93. {
  94. $this->idrol = new \Doctrine\Common\Collections\ArrayCollection();
  95. }
  96.  
  97. }
  98. ?>
Add Comment
Please, Sign In to add comment