I have two entities
-
Client
Info
with a one-to-one-unidirectional relationship, as a Client
can have none or one Info
.
I am trying to check if Client
already has Info
with this:
$em = $this->getDoctrine()->getManager();
$check = $em->getRepository("MyBundle:Info")>findBy(array(
'client_id' => $id,
));
Note that $id
would be the client id I am already passing as a parameter and have access to. The question is what sort of data would $check
would be so I can be able to verify it as shown below:
if ($check ??..) {
//..do this
} else {
//.. do that
}