Skip to content

Instantly share code, notes, and snippets.

@blar
Created February 12, 2011 18:38
Show Gist options
  • Save blar/823969 to your computer and use it in GitHub Desktop.
Save blar/823969 to your computer and use it in GitHub Desktop.
<?php
public function test() {
$user = $this->entityManager->getRepository('Blar\\Model\\User')->findOneById(1);
var_dump($user->getName());
$article = $this->entityManager->getRepository('Blar\\Model\\News\\Article')->findOneBy(array(
'user' => $user
));
var_dump($article->getName());
}
?>
string(4) "Blar"
Catchable fatal error: Object of class Blar\Model\User could not be converted to string in /Users/Blar/Sites/blar/vendor/DBAL2/lib/Doctrine/DBAL/Connection.php on line 1027
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment