Symfony 4.2 Form ChoiceType Expanded Multiple can not populate check boxes from database and save changes












0















Introduction



For my personal project i am using




  • Symfony v4.2.1

  • PHP v7.2.12

  • Windows 10


I have tree structure that represents directories and files. I have to restrict access to items in folder file tree. For that purpose there is an entity that has id, access levels (look at the 1st code block for an example) and references to user and file tree.



In order to manage this i am using AccessSetupType (see 2nd code block that represents my form).



Problem explanation



At the moment form is displayed. Select option elements are shown and corresponding option values from 0 to 4 are set up.



After post i seem to get only changed fields (correct count, but always with value false) not all the check boxes with their respective values!



Questions




  1. How to pass choices (as in 1st example) to the form and automatically fill in check boxes with data from database?


  2. How to pass all elements not only checked to controller when submitting form?



Code




1st code block ($access_info)




$access_info = [
"can_see" => true
"can_download" => false
"can_upload" => false
"can_delete" => true
"is_owner" => false
]



2nd code block (AccessSetupType)







namespace AppFormType;

use SymfonyComponentFormAbstractType;
use SymfonyComponentFormExtensionCoreTypeChoiceType;
use SymfonyComponentFormExtensionCoreTypeSubmitType;
use SymfonyComponentFormFormBuilderInterface;
use SymfonyComponentOptionsResolverOptionsResolver;

class AccessSetupType extends AbstractType
{
private $access_choices;

public function buildForm(FormBuilderInterface $builder, array $options)
{
$this->access_choices = $options['access_choices'];

$builder
->add('accessSetup', ChoiceType::class,
[
'label' => 'Access level:',
'choices' => $this->access_choices,
'mapped' => false,
'expanded' => true,
'multiple' => true,
'label_attr' => ['class' => 'checkbox-custom'],
'translation_domain' => 'form_access',
'empty_data' => false
]
)
;
}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'access_choices' => null,
'data_class' => null,
'csrf_protection' => true,
'csrf_field_name' => '_token',
]
);
}
}



3rd code block (relevant part of controller)







$file_tree_node_id = 17;
$user_id = 5;

$access_choices = $repo_file_tree_access->getFileTreeAccessByNodeAndUser($node_id, $user_id);

$form = $this->createForm(AccessSetupType::class, null, array(
'action' => $this->generateUrl('admin_access_setup_with_node_id', ['node_id' => $node_id]),
'method' => 'POST',
'node_id' => $node_id,
'access_choices' => $access_choices,
));

$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid())
{
$data = $form['accessSetup']->getData();
dump($data);

if ($form->get('saveAccess')->isClicked())
{
// save clicked
dump('save clicked');

$file_tree_access = new FileTreeAccess();
$file_tree_access->setCanSee($data[0]);
$file_tree_access->setCanDownload($data[1]);
$file_tree_access->setCanUpload($data[2]);
$file_tree_access->setCanDelete($data[3]);
$file_tree_access->setIsOwner($data[4]);
$file_tree_access->setUser($repo_user->findOneBy(['id' => $user_id]));
$file_tree_access->setFileTree($repo_file_tree->getOneFileTreeNode($file_tree_node_id));

if (($file_tree_access !== null) && ($file_tree_access !== ))
{
//$em->persist($file_tree_access);
//$em->flush();
}
}
else if ($form->get('return')->isClicked())
{
// return clicked
dump('return clicked');
}
}



4th code block (FileTreeAccess instance example)




array:8 [
"id" => 4
"can_see" => true
"can_download" => false
"can_upload" => false
"can_delete" => false
"is_owner" => false
"file_tree_id" => 16
"user_id" => 5
]


Rendered Form



This is how form is rendered after i clicked on options.



It does not display selected choices form database.



enter image description here



Conclusion



What am i doing wrong? What am i missing?



Thank you for ideas!



Update 1



I am already passing FileTreeAccess record (see 4th code block) to the form.



If i pass to the form constructor second argument new FileTreeAccess()



I have following error:




  • Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.


Update 2




I think the problem source might be - that in order to manage access to FileTree i need to pass to the form only 5 of 8 entity properties (those that represent permissions). How to do that? Maybe i need the DataTransformer for that purpose?











share|improve this question





























    0















    Introduction



    For my personal project i am using




    • Symfony v4.2.1

    • PHP v7.2.12

    • Windows 10


    I have tree structure that represents directories and files. I have to restrict access to items in folder file tree. For that purpose there is an entity that has id, access levels (look at the 1st code block for an example) and references to user and file tree.



    In order to manage this i am using AccessSetupType (see 2nd code block that represents my form).



    Problem explanation



    At the moment form is displayed. Select option elements are shown and corresponding option values from 0 to 4 are set up.



    After post i seem to get only changed fields (correct count, but always with value false) not all the check boxes with their respective values!



    Questions




    1. How to pass choices (as in 1st example) to the form and automatically fill in check boxes with data from database?


    2. How to pass all elements not only checked to controller when submitting form?



    Code




    1st code block ($access_info)




    $access_info = [
    "can_see" => true
    "can_download" => false
    "can_upload" => false
    "can_delete" => true
    "is_owner" => false
    ]



    2nd code block (AccessSetupType)







    namespace AppFormType;

    use SymfonyComponentFormAbstractType;
    use SymfonyComponentFormExtensionCoreTypeChoiceType;
    use SymfonyComponentFormExtensionCoreTypeSubmitType;
    use SymfonyComponentFormFormBuilderInterface;
    use SymfonyComponentOptionsResolverOptionsResolver;

    class AccessSetupType extends AbstractType
    {
    private $access_choices;

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
    $this->access_choices = $options['access_choices'];

    $builder
    ->add('accessSetup', ChoiceType::class,
    [
    'label' => 'Access level:',
    'choices' => $this->access_choices,
    'mapped' => false,
    'expanded' => true,
    'multiple' => true,
    'label_attr' => ['class' => 'checkbox-custom'],
    'translation_domain' => 'form_access',
    'empty_data' => false
    ]
    )
    ;
    }

    public function configureOptions(OptionsResolver $resolver)
    {
    $resolver->setDefaults(
    [
    'access_choices' => null,
    'data_class' => null,
    'csrf_protection' => true,
    'csrf_field_name' => '_token',
    ]
    );
    }
    }



    3rd code block (relevant part of controller)







    $file_tree_node_id = 17;
    $user_id = 5;

    $access_choices = $repo_file_tree_access->getFileTreeAccessByNodeAndUser($node_id, $user_id);

    $form = $this->createForm(AccessSetupType::class, null, array(
    'action' => $this->generateUrl('admin_access_setup_with_node_id', ['node_id' => $node_id]),
    'method' => 'POST',
    'node_id' => $node_id,
    'access_choices' => $access_choices,
    ));

    $form->handleRequest($request);

    if ($form->isSubmitted() && $form->isValid())
    {
    $data = $form['accessSetup']->getData();
    dump($data);

    if ($form->get('saveAccess')->isClicked())
    {
    // save clicked
    dump('save clicked');

    $file_tree_access = new FileTreeAccess();
    $file_tree_access->setCanSee($data[0]);
    $file_tree_access->setCanDownload($data[1]);
    $file_tree_access->setCanUpload($data[2]);
    $file_tree_access->setCanDelete($data[3]);
    $file_tree_access->setIsOwner($data[4]);
    $file_tree_access->setUser($repo_user->findOneBy(['id' => $user_id]));
    $file_tree_access->setFileTree($repo_file_tree->getOneFileTreeNode($file_tree_node_id));

    if (($file_tree_access !== null) && ($file_tree_access !== ))
    {
    //$em->persist($file_tree_access);
    //$em->flush();
    }
    }
    else if ($form->get('return')->isClicked())
    {
    // return clicked
    dump('return clicked');
    }
    }



    4th code block (FileTreeAccess instance example)




    array:8 [
    "id" => 4
    "can_see" => true
    "can_download" => false
    "can_upload" => false
    "can_delete" => false
    "is_owner" => false
    "file_tree_id" => 16
    "user_id" => 5
    ]


    Rendered Form



    This is how form is rendered after i clicked on options.



    It does not display selected choices form database.



    enter image description here



    Conclusion



    What am i doing wrong? What am i missing?



    Thank you for ideas!



    Update 1



    I am already passing FileTreeAccess record (see 4th code block) to the form.



    If i pass to the form constructor second argument new FileTreeAccess()



    I have following error:




    • Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.


    Update 2




    I think the problem source might be - that in order to manage access to FileTree i need to pass to the form only 5 of 8 entity properties (those that represent permissions). How to do that? Maybe i need the DataTransformer for that purpose?











    share|improve this question



























      0












      0








      0








      Introduction



      For my personal project i am using




      • Symfony v4.2.1

      • PHP v7.2.12

      • Windows 10


      I have tree structure that represents directories and files. I have to restrict access to items in folder file tree. For that purpose there is an entity that has id, access levels (look at the 1st code block for an example) and references to user and file tree.



      In order to manage this i am using AccessSetupType (see 2nd code block that represents my form).



      Problem explanation



      At the moment form is displayed. Select option elements are shown and corresponding option values from 0 to 4 are set up.



      After post i seem to get only changed fields (correct count, but always with value false) not all the check boxes with their respective values!



      Questions




      1. How to pass choices (as in 1st example) to the form and automatically fill in check boxes with data from database?


      2. How to pass all elements not only checked to controller when submitting form?



      Code




      1st code block ($access_info)




      $access_info = [
      "can_see" => true
      "can_download" => false
      "can_upload" => false
      "can_delete" => true
      "is_owner" => false
      ]



      2nd code block (AccessSetupType)







      namespace AppFormType;

      use SymfonyComponentFormAbstractType;
      use SymfonyComponentFormExtensionCoreTypeChoiceType;
      use SymfonyComponentFormExtensionCoreTypeSubmitType;
      use SymfonyComponentFormFormBuilderInterface;
      use SymfonyComponentOptionsResolverOptionsResolver;

      class AccessSetupType extends AbstractType
      {
      private $access_choices;

      public function buildForm(FormBuilderInterface $builder, array $options)
      {
      $this->access_choices = $options['access_choices'];

      $builder
      ->add('accessSetup', ChoiceType::class,
      [
      'label' => 'Access level:',
      'choices' => $this->access_choices,
      'mapped' => false,
      'expanded' => true,
      'multiple' => true,
      'label_attr' => ['class' => 'checkbox-custom'],
      'translation_domain' => 'form_access',
      'empty_data' => false
      ]
      )
      ;
      }

      public function configureOptions(OptionsResolver $resolver)
      {
      $resolver->setDefaults(
      [
      'access_choices' => null,
      'data_class' => null,
      'csrf_protection' => true,
      'csrf_field_name' => '_token',
      ]
      );
      }
      }



      3rd code block (relevant part of controller)







      $file_tree_node_id = 17;
      $user_id = 5;

      $access_choices = $repo_file_tree_access->getFileTreeAccessByNodeAndUser($node_id, $user_id);

      $form = $this->createForm(AccessSetupType::class, null, array(
      'action' => $this->generateUrl('admin_access_setup_with_node_id', ['node_id' => $node_id]),
      'method' => 'POST',
      'node_id' => $node_id,
      'access_choices' => $access_choices,
      ));

      $form->handleRequest($request);

      if ($form->isSubmitted() && $form->isValid())
      {
      $data = $form['accessSetup']->getData();
      dump($data);

      if ($form->get('saveAccess')->isClicked())
      {
      // save clicked
      dump('save clicked');

      $file_tree_access = new FileTreeAccess();
      $file_tree_access->setCanSee($data[0]);
      $file_tree_access->setCanDownload($data[1]);
      $file_tree_access->setCanUpload($data[2]);
      $file_tree_access->setCanDelete($data[3]);
      $file_tree_access->setIsOwner($data[4]);
      $file_tree_access->setUser($repo_user->findOneBy(['id' => $user_id]));
      $file_tree_access->setFileTree($repo_file_tree->getOneFileTreeNode($file_tree_node_id));

      if (($file_tree_access !== null) && ($file_tree_access !== ))
      {
      //$em->persist($file_tree_access);
      //$em->flush();
      }
      }
      else if ($form->get('return')->isClicked())
      {
      // return clicked
      dump('return clicked');
      }
      }



      4th code block (FileTreeAccess instance example)




      array:8 [
      "id" => 4
      "can_see" => true
      "can_download" => false
      "can_upload" => false
      "can_delete" => false
      "is_owner" => false
      "file_tree_id" => 16
      "user_id" => 5
      ]


      Rendered Form



      This is how form is rendered after i clicked on options.



      It does not display selected choices form database.



      enter image description here



      Conclusion



      What am i doing wrong? What am i missing?



      Thank you for ideas!



      Update 1



      I am already passing FileTreeAccess record (see 4th code block) to the form.



      If i pass to the form constructor second argument new FileTreeAccess()



      I have following error:




      • Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.


      Update 2




      I think the problem source might be - that in order to manage access to FileTree i need to pass to the form only 5 of 8 entity properties (those that represent permissions). How to do that? Maybe i need the DataTransformer for that purpose?











      share|improve this question
















      Introduction



      For my personal project i am using




      • Symfony v4.2.1

      • PHP v7.2.12

      • Windows 10


      I have tree structure that represents directories and files. I have to restrict access to items in folder file tree. For that purpose there is an entity that has id, access levels (look at the 1st code block for an example) and references to user and file tree.



      In order to manage this i am using AccessSetupType (see 2nd code block that represents my form).



      Problem explanation



      At the moment form is displayed. Select option elements are shown and corresponding option values from 0 to 4 are set up.



      After post i seem to get only changed fields (correct count, but always with value false) not all the check boxes with their respective values!



      Questions




      1. How to pass choices (as in 1st example) to the form and automatically fill in check boxes with data from database?


      2. How to pass all elements not only checked to controller when submitting form?



      Code




      1st code block ($access_info)




      $access_info = [
      "can_see" => true
      "can_download" => false
      "can_upload" => false
      "can_delete" => true
      "is_owner" => false
      ]



      2nd code block (AccessSetupType)







      namespace AppFormType;

      use SymfonyComponentFormAbstractType;
      use SymfonyComponentFormExtensionCoreTypeChoiceType;
      use SymfonyComponentFormExtensionCoreTypeSubmitType;
      use SymfonyComponentFormFormBuilderInterface;
      use SymfonyComponentOptionsResolverOptionsResolver;

      class AccessSetupType extends AbstractType
      {
      private $access_choices;

      public function buildForm(FormBuilderInterface $builder, array $options)
      {
      $this->access_choices = $options['access_choices'];

      $builder
      ->add('accessSetup', ChoiceType::class,
      [
      'label' => 'Access level:',
      'choices' => $this->access_choices,
      'mapped' => false,
      'expanded' => true,
      'multiple' => true,
      'label_attr' => ['class' => 'checkbox-custom'],
      'translation_domain' => 'form_access',
      'empty_data' => false
      ]
      )
      ;
      }

      public function configureOptions(OptionsResolver $resolver)
      {
      $resolver->setDefaults(
      [
      'access_choices' => null,
      'data_class' => null,
      'csrf_protection' => true,
      'csrf_field_name' => '_token',
      ]
      );
      }
      }



      3rd code block (relevant part of controller)







      $file_tree_node_id = 17;
      $user_id = 5;

      $access_choices = $repo_file_tree_access->getFileTreeAccessByNodeAndUser($node_id, $user_id);

      $form = $this->createForm(AccessSetupType::class, null, array(
      'action' => $this->generateUrl('admin_access_setup_with_node_id', ['node_id' => $node_id]),
      'method' => 'POST',
      'node_id' => $node_id,
      'access_choices' => $access_choices,
      ));

      $form->handleRequest($request);

      if ($form->isSubmitted() && $form->isValid())
      {
      $data = $form['accessSetup']->getData();
      dump($data);

      if ($form->get('saveAccess')->isClicked())
      {
      // save clicked
      dump('save clicked');

      $file_tree_access = new FileTreeAccess();
      $file_tree_access->setCanSee($data[0]);
      $file_tree_access->setCanDownload($data[1]);
      $file_tree_access->setCanUpload($data[2]);
      $file_tree_access->setCanDelete($data[3]);
      $file_tree_access->setIsOwner($data[4]);
      $file_tree_access->setUser($repo_user->findOneBy(['id' => $user_id]));
      $file_tree_access->setFileTree($repo_file_tree->getOneFileTreeNode($file_tree_node_id));

      if (($file_tree_access !== null) && ($file_tree_access !== ))
      {
      //$em->persist($file_tree_access);
      //$em->flush();
      }
      }
      else if ($form->get('return')->isClicked())
      {
      // return clicked
      dump('return clicked');
      }
      }



      4th code block (FileTreeAccess instance example)




      array:8 [
      "id" => 4
      "can_see" => true
      "can_download" => false
      "can_upload" => false
      "can_delete" => false
      "is_owner" => false
      "file_tree_id" => 16
      "user_id" => 5
      ]


      Rendered Form



      This is how form is rendered after i clicked on options.



      It does not display selected choices form database.



      enter image description here



      Conclusion



      What am i doing wrong? What am i missing?



      Thank you for ideas!



      Update 1



      I am already passing FileTreeAccess record (see 4th code block) to the form.



      If i pass to the form constructor second argument new FileTreeAccess()



      I have following error:




      • Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.


      Update 2




      I think the problem source might be - that in order to manage access to FileTree i need to pass to the form only 5 of 8 entity properties (those that represent permissions). How to do that? Maybe i need the DataTransformer for that purpose?








      php forms symfony select symfony4






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 3 at 16:56







      Rikijs

















      asked Jan 2 at 21:30









      RikijsRikijs

      2221225




      2221225
























          1 Answer
          1






          active

          oldest

          votes


















          0














          In order to have your options pre-filled, you have to tie your form to an object. Then when you submit the form, you won't need to set everything, it is done automatically.



          $file_tree_access = new FileTreeAccess();

          // load data from database here then set them in your object before passing it to the form

          $form = $this->createForm(AccessSetupType::class, $file_tree_access, array(
          'action' => $this->generateUrl('admin_access_setup_with_node_id', ['node_id' => $node_id]),
          'method' => 'POST',
          'node_id' => $node_id,
          'access_choices' => $access_choices,
          ));

          $form->handleRequest($request);





          share|improve this answer
























          • Hello, @hoover_D! I tried your proposition, but in this case i get an error. Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.

            – Rikijs
            Jan 3 at 16:57












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54013415%2fsymfony-4-2-form-choicetype-expanded-multiple-can-not-populate-check-boxes-from%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          In order to have your options pre-filled, you have to tie your form to an object. Then when you submit the form, you won't need to set everything, it is done automatically.



          $file_tree_access = new FileTreeAccess();

          // load data from database here then set them in your object before passing it to the form

          $form = $this->createForm(AccessSetupType::class, $file_tree_access, array(
          'action' => $this->generateUrl('admin_access_setup_with_node_id', ['node_id' => $node_id]),
          'method' => 'POST',
          'node_id' => $node_id,
          'access_choices' => $access_choices,
          ));

          $form->handleRequest($request);





          share|improve this answer
























          • Hello, @hoover_D! I tried your proposition, but in this case i get an error. Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.

            – Rikijs
            Jan 3 at 16:57
















          0














          In order to have your options pre-filled, you have to tie your form to an object. Then when you submit the form, you won't need to set everything, it is done automatically.



          $file_tree_access = new FileTreeAccess();

          // load data from database here then set them in your object before passing it to the form

          $form = $this->createForm(AccessSetupType::class, $file_tree_access, array(
          'action' => $this->generateUrl('admin_access_setup_with_node_id', ['node_id' => $node_id]),
          'method' => 'POST',
          'node_id' => $node_id,
          'access_choices' => $access_choices,
          ));

          $form->handleRequest($request);





          share|improve this answer
























          • Hello, @hoover_D! I tried your proposition, but in this case i get an error. Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.

            – Rikijs
            Jan 3 at 16:57














          0












          0








          0







          In order to have your options pre-filled, you have to tie your form to an object. Then when you submit the form, you won't need to set everything, it is done automatically.



          $file_tree_access = new FileTreeAccess();

          // load data from database here then set them in your object before passing it to the form

          $form = $this->createForm(AccessSetupType::class, $file_tree_access, array(
          'action' => $this->generateUrl('admin_access_setup_with_node_id', ['node_id' => $node_id]),
          'method' => 'POST',
          'node_id' => $node_id,
          'access_choices' => $access_choices,
          ));

          $form->handleRequest($request);





          share|improve this answer













          In order to have your options pre-filled, you have to tie your form to an object. Then when you submit the form, you won't need to set everything, it is done automatically.



          $file_tree_access = new FileTreeAccess();

          // load data from database here then set them in your object before passing it to the form

          $form = $this->createForm(AccessSetupType::class, $file_tree_access, array(
          'action' => $this->generateUrl('admin_access_setup_with_node_id', ['node_id' => $node_id]),
          'method' => 'POST',
          'node_id' => $node_id,
          'access_choices' => $access_choices,
          ));

          $form->handleRequest($request);






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 3 at 9:19









          hoover_Dhoover_D

          36717




          36717













          • Hello, @hoover_D! I tried your proposition, but in this case i get an error. Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.

            – Rikijs
            Jan 3 at 16:57



















          • Hello, @hoover_D! I tried your proposition, but in this case i get an error. Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.

            – Rikijs
            Jan 3 at 16:57

















          Hello, @hoover_D! I tried your proposition, but in this case i get an error. Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.

          – Rikijs
          Jan 3 at 16:57





          Hello, @hoover_D! I tried your proposition, but in this case i get an error. Cannot read index "accessSetup" from object of type "AppEntityFileTreeAccess" because it doesn't implement ArrayAccess.

          – Rikijs
          Jan 3 at 16:57




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54013415%2fsymfony-4-2-form-choicetype-expanded-multiple-can-not-populate-check-boxes-from%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          Npm cannot find a required file even through it is in the searched directory

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith