title: Symfony-3.2 "Cannot access private property..."
body: <p>I have a problem. I try to get values from DB and add their to array. Then I want to use this array for render in the template by means of Twig {{ content.language.text_logo }}. 
  How can I change properties of objects in array to "public"?</p>
  
  <p>This is my IndexController.php</p>
  
  <pre><code>&lt;?php
  namespace Seandle\HomeBundle\Controller;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\HttpFoundation\Response;
  
  class IndexController extends Controller {
    public function indexAction() {
      return $this-&gt;render('SeandleHomeBundle:Default:index.html.twig', array(
        'content' =&gt; $this-&gt;getLanguage(),
      ));
    }
  
    private function getLanguage() {
      $repository = $this-&gt;getDoctrine()-&gt;getRepository('SeandleHomeBundle:SeandleLanguage');
      $languages = $repository-&gt;findAll();
      $language = array();
      foreach ($languages as $language_key =&gt; $language_value) {
        $language['language'] = array(
          $language_value-&gt;languageLocation =&gt; array(
            $language_value-&gt;languageVariable =&gt; $language_value-&gt;languageContent
          )
        );
      }
      return $language;
    }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/U7nAk.png" rel="nofollow noreferrer">This is screenshot from browser</a></p>