Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // I want to get a Accion Entity by querying
- $action = $entityManager->getRepository('Accion')->findOneBy(array('metodo' => 'default','idModule' => 'home'));
- ?>
- // And get this error message
- Fatal error:
- Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'Class Accion is not a valid entity or mapped super class.'
- // DEFINITIONS file accion.class.php //
- <?php
- /*
- * Accion
- *
- * @Table(name="app_acciones")
- * @Entity
- * */
- class Accion extends DAO\AppAcciones
- {
- /**
- * @var Rol
- *
- * @ManyToMany(targetEntity="Rol", mappedBy="idaccion")
- */
- private $idrol;
- /**
- * @var Module
- *
- * @ManyToOne(targetEntity="Module")
- * @JoinColumns({
- * @JoinColumn(name="idModule", referencedColumnName="idModule")
- * })
- */
- private $idmodule;
- }
- ?>
- // and AppAcciones.php
- <?php
- namespace DAO;
- /**
- * AppAcciones
- *
- * @MappedSuperclass
- */
- class AppAcciones
- {
- /**
- * @var integer $idaccion
- *
- * @Column(name="idAccion", type="integer", nullable=false)
- * @Id
- * @GeneratedValue(strategy="IDENTITY")
- */
- private $idaccion;
- /**
- * @var string $metodo
- *
- * @Column(name="metodo", type="string", length=45, nullable=false)
- */
- private $metodo;
- /**
- * @var boolean $activo
- *
- * @Column(name="activo", type="boolean", nullable=false)
- */
- private $activo;
- /**
- * @var string $nombre
- *
- * @Column(name="nombre", type="string", length=45, nullable=false)
- */
- private $nombre;
- /**
- * @var string $descripcion
- *
- * @Column(name="descripcion", type="string", length=200, nullable=false)
- */
- private $descripcion;
- public function __construct()
- {
- $this->idrol = new \Doctrine\Common\Collections\ArrayCollection();
- }
- }
- ?>
Add Comment
Please, Sign In to add comment