add a ScopePickerType and a UserPickerType

Those type allow easily to

- pick a Scope/circle in form
- pick a user in form
This commit is contained in:
2017-04-25 17:29:25 +02:00
parent b038cdfdf5
commit 95145171da
10 changed files with 292 additions and 1 deletions

View File

@@ -19,4 +19,8 @@ Chill\MainBundle\Entity\GroupCenter:
permissionsGroup:
targetEntity: Chill\MainBundle\Entity\PermissionsGroup
cache:
usage: NONSTRICT_READ_WRITE
usage: NONSTRICT_READ_WRITE
manyToMany:
users:
targetEntity: Chill\MainBundle\Entity\User
mappedBy: groupCenters

View File

@@ -17,6 +17,11 @@ Chill\MainBundle\Entity\PermissionsGroup:
manyToMany:
roleScopes:
targetEntity: Chill\MainBundle\Entity\RoleScope
inversedBy: permissionsGroups
cache:
usage: NONSTRICT_READ_WRITE
oneToMany:
groupCenters:
targetEntity: Chill\MainBundle\Entity\GroupCenter
mappedBy: permissionsGroup

View File

@@ -21,4 +21,8 @@ Chill\MainBundle\Entity\RoleScope:
nullable: true
cache:
usage: NONSTRICT_READ_WRITE
manyToMany:
permissionsGroups:
targetEntity: Chill\MainBundle\Entity\PermissionsGroup
mappedBy: roleScopes

View File

@@ -30,6 +30,7 @@ Chill\MainBundle\Entity\User:
manyToMany:
groupCenters:
targetEntity: Chill\MainBundle\Entity\GroupCenter
inversedBy: users
cache:
usage: NONSTRICT_READ_WRITE

View File

@@ -89,5 +89,24 @@ services:
chill.main.form.date_type:
class: Chill\MainBundle\Form\Type\ChillDateType
tags:
- { name: form.type }
chill.main.form.pick_user_type:
class: Chill\MainBundle\Form\Type\UserPickerType
arguments:
- "@chill.main.security.authorization.helper"
- "@security.token_storage"
- "@chill.main.user_repository"
tags:
- { name: form.type }
chill.main.form.pick_scope_type:
class: Chill\MainBundle\Form\Type\ScopePickerType
arguments:
- "@chill.main.security.authorization.helper"
- "@security.token_storage"
- "@chill.main.scope_repository"
- "@chill.main.helper.translatable_string"
tags:
- { name: form.type }

View File

@@ -10,3 +10,9 @@ services:
factory: ["@doctrine.orm.entity_manager", getRepository]
arguments:
- "Chill\\MainBundle\\Entity\\User"
chill.main.scope_repository:
class: Doctrine\ORM\EntityRepository
factory: ["@doctrine.orm.entity_manager", getRepository]
arguments:
- "Chill\\MainBundle\\Entity\\Scope"