관련 항목이있는 엔티티 (질문)를 만드는 경로를 제공하는 확장이 있습니다 (각 항목에는 0, 1 또는 여러 가지 관련 질문이 있음).Doctrine/Bolt와의 ContentType 관계 처리 EM
볼트의 save/doctrine의 persist 메소드를 실제로 관계를 유지하는 것처럼 보이지 않습니다. 나는 해봤 다음
$question = $repo->create([
'question' => $request->get('question', 'What is love?'),
'status' => 'draft',
'entries' => [$entry]
]);
$question->relation->add($entry)
$question->setRelation(new Collection\Relations([$entry], $em))
(편집) 나는 또한 아래의 응답 당
$entry = $em->find('entries', $request->get('entry', 1));
$related = $em->createCollection('Bolt\Storage\Entity\Relations');
$related->add(new Relations([
'from_contenttype' => $question->getContenttype(),
'from_id' => $question->getId(),
'to_contenttype' => $entry->getContenttype(),
'to_id' => $entry->getId()
]));
$question->setRelation($relation);
을 시도했습니다,하지만 여전히하지 않습니다 작업.
아무 것도 작동하지 않습니다. Question (Content) 엔티티는 올바르게 저장하지만 관계는 올바르게 저장하지 않습니다. ... 당장은 정말 확실하지
아니 주사위 - 내 게시물을 참조하십시오. –