Answer the question
In order to leave comments, you need to log in
Can't select related objects?
class Digest
{
...
/**
* @ORM\ManyToMany(targetEntity="Category")
* @ORM\JoinTable(
* name="digest_category",
* joinColumns={
* @JoinColumn(name="digest_id", referencedColumnName="id")},
* inverseJoinColumns={
* @JoinColumn(name="category_id", referencedColumnName="id")}
* )
*/
private $category;
...
}
$repository = new RepositoryDigest($this->em);
$data = $repository->getOne($id);
$category = $data->getCategory();
$name = $category->getName();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question