Hi: I'm using entity Field Type in Form. But, its say error:
Warning: spl_object_hash() expects parameter 1 to be object, integer given in C:\xampp\htdocs\SymfonyBeta4\vendor\doctrine\lib\Doctrine\ORM \UnitOfWork.php line 1170 LOG: at ErrorHandler ->handle ('2', 'spl_object_hash() expects parameter 1 to be object, integer given', 'C:\xampp\htdocs\SymfonyBeta4\vendor \doctrine\lib\Doctrine\ORM\UnitOfWork.php', '1170', array('entity' => '1')) in at line at spl_object_hash ('1') in C:\xampp\htdocs\SymfonyBeta4\vendor\doctrine\lib\Doctrine\ORM \UnitOfWork.php at line 1170 at UnitOfWork ->isInIdentityMap ('1') in C:\xampp\htdocs\SymfonyBeta4\vendor\symfony\src\Symfony\Bridge \Doctrine\Form\ChoiceList\EntityChoiceList.php at line 292 at EntityChoiceList ->getIdentifierValues ('1') in C:\xampp\htdocs\SymfonyBeta4\vendor\symfony\src\Symfony\Bridge \Doctrine\Form\ChoiceList\EntityChoiceList.php at line 182 at EntityChoiceList ->loadEntities (array('troTipo' => '1', 'troDescripcion' => 'Administrador'), '0') in C:\xampp\htdocs\SymfonyBeta4\vendor\symfony\src\Symfony\Bridge \Doctrine\Form\ChoiceList\EntityChoiceList.php at line 163 at EntityChoiceList ->loadEntities (array(array('troTipo' => '1', 'troDescripcion' => 'Administrador'), array('troTipo' => '2', 'troDescripcion' => 'Profesor'))) in C:\xampp\htdocs\SymfonyBeta4\vendor\symfony\src\Symfony\Bridge \Doctrine\Form\ChoiceList\EntityChoiceList.php at line 141 at EntityChoiceList ->load () in C:\xampp\htdocs\SymfonyBeta4\vendor\symfony\src\Symfony\Component \Form\Extension\Core\ChoiceList\ArrayChoiceList.php at line 46 at ArrayChoiceList ->getChoices () in C:\xampp\htdocs\SymfonyBeta4\vendor\symfony\src\Symfony\Component \Form\Extension\Core\Type\ChoiceType.php at line 93 FORM: $builder->add('rolUsuario','hidden',array('label' => 'Usuario')); $builder->add('rolTPerfil','entity', array('class' => 'Ed \PortalBundle\Entity\Rol', 'query_builder' => function(EntityRepository $er) { return $er->getRolesUsuario(1);}, 'label' => 'RUT', 'property'=>'troDescripcion')); Repository: public function getRolesUsuario($idUsuario) { $qb= $this->getEntityManager()->createQueryBuilder() ->from('EdPortalBundle:Rol', 'r') ->select("tr.troTipo,tr.troDescripcion") ->join("r.rolTPerfil", 'tr') ->where("r.rolUsuario=:idUsuario") ->orderBy("tr.troDescripcion","ASC") ->setParameter('idUsuario', $idUsuario); return $qb; } ORM: Ed\PortalBundle\Entity\Rol: type: entity table: rol repositoryClass: Ed\PortalBundle\Repository\RolRepository fields: rolId: id: true type: integer unsigned: false nullable: false column: rol_id generator: strategy: SEQUENCE rolFechaExpiracion: type: date nullable: false column: rol_fecha_expiracion oneToOne: rolUsuario: targetEntity: Usuario cascade: { } mappedBy: null inversedBy: null joinColumns: rol_id_usuario: referencedColumnName: usua_id orphanRemoval: false rolTPerfil: targetEntity: TRol cascade: { } mappedBy: null inversedBy: null joinColumns: rol_t_perfil: referencedColumnName: tro_tipo orphanRemoval: false lifecycleCallbacks: { } Ed\PortalBundle\Entity\TRol: type: entity table: t_rol fields: troTipo: id: true type: integer unsigned: false nullable: false column: tro_tipo generator: strategy: SEQUENCE troDescripcion: type: string length: 50 fixed: false nullable: false column: tro_descripcion lifecycleCallbacks: { } -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en