How can I use createQueryBuilder with ArrayCollection
thank you.
class Email {
/**
* @var string
*
* @ORM\Column(name="email", type="string", length=100, nullable=true)
*/
private $email;
/*********************************/
class User
{
/**
* @var Email
* @ORM\OneToMany(targetEntity="Email", mappedBy="user",
cascade={"remove"}, orphanRemoval=true))
*/
private $emails;
public function __construct(..
$this->emails = new ArrayCollection();
/*********************************/
class UserRepository extends EntityRepository {
....
function(){...
$query = $this->getEntityManager()->createQueryBuilder()
->select('u', 'e')
->from('User\Entity\User', 'u')
->join('u.emails', 'e')
->where('u.parent = :parent')
->where('e.email = :email')
->setParameter('parent', $parent)
->setParameter('email', $email);
/*********************************/
Doctrine\ORM\Query\QueryException::invalidParameterNumber()
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.