Ability to assign documents to groups.
Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
parent
a8f1f85573
commit
0f112feabe
@ -210,7 +210,12 @@ class Document
|
||||
|
||||
/**
|
||||
* @var Doctrine\Common\Collections\ArrayCollection $groups
|
||||
* @ORM\ManyToMany(targetEntity="KekRozsak\FrontBundle\Entity\Group", mappedBy="documents")
|
||||
* @ORM\ManyToMany(targetEntity="KekRozsak\FrontBundle\Entity\Group", inversedBy="documents")
|
||||
* @ORM\JoinTable(name="group_document", joinColumns={
|
||||
* @ORM\JoinColumn(name="document_id", referencedColumnName="id"),
|
||||
* }, inverseJoinColumns={
|
||||
* @ORM\JoinColumn(name="group_id", referencedColumnName="id")
|
||||
* })
|
||||
*/
|
||||
protected $groups;
|
||||
|
||||
@ -234,7 +239,7 @@ class Document
|
||||
*/
|
||||
public function getGroups()
|
||||
{
|
||||
return $this->group;
|
||||
return $this->groups;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -354,12 +354,7 @@ class Group
|
||||
*
|
||||
* @var Doctrine\Common\Collections\ArrayCollection $documents
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity="Document", inversedBy="groups", fetch="LAZY")
|
||||
* @ORM\JoinTable(name="group_document", inverseJoinColumns={
|
||||
* @ORM\JoinColumn(name="document_id", referencedColumnName="id"),
|
||||
* }, joinColumns={
|
||||
* @ORM\JoinColumn(name="group_id", referencedColumnName="id")
|
||||
* })
|
||||
* @ORM\ManyToMany(targetEntity="Document", mappedBy="groups", fetch="LAZY")
|
||||
*/
|
||||
protected $documents;
|
||||
|
||||
|
@ -12,14 +12,19 @@ class DocumentType extends AbstractType
|
||||
$builder->add('title', null, array(
|
||||
'label' => 'A dokumentum címe',
|
||||
)
|
||||
);
|
||||
)
|
||||
|
||||
$builder->add('content', 'ckeditor', array(
|
||||
->add('groups', null, array(
|
||||
'label' => 'Csoportok',
|
||||
'property' => 'name',
|
||||
'required' => true,
|
||||
)
|
||||
)
|
||||
|
||||
->add('content', 'ckeditor', array(
|
||||
'label' => ' ',
|
||||
)
|
||||
);
|
||||
|
||||
// TODO: possibility to add to other groups!
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
Loading…
Reference in New Issue
Block a user