<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="robots" content="index, follow, all" />
        <title>Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList | </title>
                    <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css">
                            </head>
        <body id="class">
            <div class="header">
        <ul>
            <li><a href="../../../../../classes.html">Classes</a></li>
                            <li><a href="../../../../../namespaces.html">Namespaces</a></li>
                        <li><a href="../../../../../interfaces.html">Interfaces</a></li>
            <li><a href="../../../../../traits.html">Traits</a></li>
            <li><a href="../../../../../doc-index.html">Index</a></li>
            
        </ul>

        <div id="title"></div>

            <div class="type">Class</div>
    <h1><a href="../ChoiceList.html">Symfony\Bridge\Doctrine\Form\ChoiceList</a>\EntityChoiceList</h1>
    </div>
        <div class="content">
                <p>    class
    <strong>EntityChoiceList</strong>        extends <a href="../../../../Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.html"><abbr title="Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList">ObjectChoiceList</abbr></a></p>

            <div class="description">
            <p>A choice list presenting a list of Doctrine entities as choices</p>
            <p>
</p>
        </div>
    
    
    
            <h2>Methods</h2>

            <table>
                    <tr>
                <td class="type">
                    
                </td>
                <td class="last">
                    <a href="EntityChoiceList.html#method___construct">__construct</a>(<abbr title="Doctrine\Common\Persistence\ObjectManager">ObjectManager</abbr> $manager, string $class, string $labelPath = null, <a href="EntityLoaderInterface.html"><abbr title="Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface">EntityLoaderInterface</abbr></a> $entityLoader = null, array|<a href="http://php.net/Traversable"><abbr title="Traversable">Traversable</abbr></a>|null $entities = null, array $preferredEntities = array(), string $groupPath = null, <a href="../../../../Component/PropertyAccess/PropertyAccessorInterface.html"><abbr title="Symfony\Component\PropertyAccess\PropertyAccessorInterface">PropertyAccessorInterface</abbr></a> $propertyAccessor = null)
                    <p>Creates a new entity choice list.</p>
                </td>
                <td></td>
            </tr>
                    <tr>
                <td class="type">
                    array
                </td>
                <td class="last">
                    <a href="EntityChoiceList.html#method_getChoices">getChoices</a>()
                    <p>Returns the list of entities</p>
                </td>
                <td></td>
            </tr>
                    <tr>
                <td class="type">
                    array
                </td>
                <td class="last">
                    <a href="EntityChoiceList.html#method_getValues">getValues</a>()
                    <p>Returns the values for the entities</p>
                </td>
                <td></td>
            </tr>
                    <tr>
                <td class="type">
                    array
                </td>
                <td class="last">
                    <a href="EntityChoiceList.html#method_getPreferredViews">getPreferredViews</a>()
                    <p>Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys.</p>
                </td>
                <td></td>
            </tr>
                    <tr>
                <td class="type">
                    array
                </td>
                <td class="last">
                    <a href="EntityChoiceList.html#method_getRemainingViews">getRemainingViews</a>()
                    <p>Returns the choice views of the choices that are not preferred as nested array with the choice groups as top-level keys.</p>
                </td>
                <td></td>
            </tr>
                    <tr>
                <td class="type">
                    array
                </td>
                <td class="last">
                    <a href="EntityChoiceList.html#method_getChoicesForValues">getChoicesForValues</a>(array $values)
                    <p>Returns the entities corresponding to the given values.</p>
                </td>
                <td></td>
            </tr>
                    <tr>
                <td class="type">
                    array
                </td>
                <td class="last">
                    <a href="EntityChoiceList.html#method_getValuesForChoices">getValuesForChoices</a>(array $entities)
                    <p>Returns the values corresponding to the given entities.</p>
                </td>
                <td></td>
            </tr>
                    <tr>
                <td class="type">
                    array
                </td>
                <td class="last">
                    <a href="EntityChoiceList.html#method_getIndicesForChoices">getIndicesForChoices</a>(array $entities)
                    <p>Returns the indices corresponding to the given entities.</p>
                </td>
                <td></td>
            </tr>
                    <tr>
                <td class="type">
                    array
                </td>
                <td class="last">
                    <a href="EntityChoiceList.html#method_getIndicesForValues">getIndicesForValues</a>(array $values)
                    <p>Returns the entities corresponding to the given values.</p>
                </td>
                <td></td>
            </tr>
            </table>


        <h2>Details</h2>

                        <h3 id="method___construct">
        <div class="location">at line 101</div>
        <code>            public            
    <strong>__construct</strong>(<abbr title="Doctrine\Common\Persistence\ObjectManager">ObjectManager</abbr> $manager, string $class, string $labelPath = null, <a href="EntityLoaderInterface.html"><abbr title="Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface">EntityLoaderInterface</abbr></a> $entityLoader = null, array|<a href="http://php.net/Traversable"><abbr title="Traversable">Traversable</abbr></a>|null $entities = null, array $preferredEntities = array(), string $groupPath = null, <a href="../../../../Component/PropertyAccess/PropertyAccessorInterface.html"><abbr title="Symfony\Component\PropertyAccess\PropertyAccessorInterface">PropertyAccessorInterface</abbr></a> $propertyAccessor = null)</code>
    </h3>
    <div class="details">
        <p>Creates a new entity choice list.</p>
        <p>
</p>
        <div class="tags">
                            <h4>Parameters</h4>

                    <table>
                    <tr>
                <td><abbr title="Doctrine\Common\Persistence\ObjectManager">ObjectManager</abbr></td>
                <td>$manager</td>
                <td>An EntityManager instance</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$class</td>
                <td>The class name</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$labelPath</td>
                <td>The property path used for the label</td>
            </tr>
                    <tr>
                <td><a href="EntityLoaderInterface.html"><abbr title="Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface">EntityLoaderInterface</abbr></a></td>
                <td>$entityLoader</td>
                <td>An optional query builder</td>
            </tr>
                    <tr>
                <td>array|<a href="http://php.net/Traversable"><abbr title="Traversable">Traversable</abbr></a>|null</td>
                <td>$entities</td>
                <td>An array of choices or null to lazy load</td>
            </tr>
                    <tr>
                <td>array</td>
                <td>$preferredEntities</td>
                <td>An array of preferred choices</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$groupPath</td>
                <td>A property path pointing to the property used to group the choices. Only allowed if the choices are given as flat array.</td>
            </tr>
                    <tr>
                <td><a href="../../../../Component/PropertyAccess/PropertyAccessorInterface.html"><abbr title="Symfony\Component\PropertyAccess\PropertyAccessorInterface">PropertyAccessorInterface</abbr></a></td>
                <td>$propertyAccessor</td>
                <td>The reflection graph for reading property paths.</td>
            </tr>
            </table>

            
            
            
                    </div>
    </div>

                <h3 id="method_getChoices">
        <div class="location">at line 137</div>
        <code>            public            array
    <strong>getChoices</strong>()</code>
    </h3>
    <div class="details">
        <p>Returns the list of entities</p>
        <p>
</p>
        <div class="tags">
            
                            <h4>Return Value</h4>

                    <table>
        <tr>
            <td>array</td>
            <td>The choices with their indices as keys</td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table>
                    <tr>
                <td>Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface</td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

                <h3 id="method_getValues">
        <div class="location">at line 153</div>
        <code>            public            array
    <strong>getValues</strong>()</code>
    </h3>
    <div class="details">
        <p>Returns the values for the entities</p>
        <p>
</p>
        <div class="tags">
            
                            <h4>Return Value</h4>

                    <table>
        <tr>
            <td>array</td>
            <td>The values with the corresponding choice indices as keys</td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table>
                    <tr>
                <td>Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface</td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

                <h3 id="method_getPreferredViews">
        <div class="location">at line 170</div>
        <code>            public            array
    <strong>getPreferredViews</strong>()</code>
    </h3>
    <div class="details">
        <p>Returns the choice views of the preferred choices as nested array with the choice groups as top-level keys.</p>
        <p>
</p>
        <div class="tags">
            
                            <h4>Return Value</h4>

                    <table>
        <tr>
            <td>array</td>
            <td>A nested array containing the views with the corresponding choice indices as keys on the lowest levels and the choice group names in the keys of the higher levels</td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table>
                    <tr>
                <td>Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface</td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

                <h3 id="method_getRemainingViews">
        <div class="location">at line 187</div>
        <code>            public            array
    <strong>getRemainingViews</strong>()</code>
    </h3>
    <div class="details">
        <p>Returns the choice views of the choices that are not preferred as nested array with the choice groups as top-level keys.</p>
        <p>
</p>
        <div class="tags">
            
                            <h4>Return Value</h4>

                    <table>
        <tr>
            <td>array</td>
            <td>A nested array containing the views with the corresponding choice indices as keys on the lowest levels and the choice group names in the keys of the higher levels</td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table>
                    <tr>
                <td>Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface</td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

                <h3 id="method_getChoicesForValues">
        <div class="location">at line 205</div>
        <code>            public            array
    <strong>getChoicesForValues</strong>(array $values)</code>
    </h3>
    <div class="details">
        <p>Returns the entities corresponding to the given values.</p>
        <p>
</p>
        <div class="tags">
                            <h4>Parameters</h4>

                    <table>
                    <tr>
                <td>array</td>
                <td>$values</td>
                <td>An array of choice values. Not existing values in this array are ignored</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table>
        <tr>
            <td>array</td>
            <td>An array of choices with ascending, 0-based numeric keys</td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table>
                    <tr>
                <td>Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface</td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

                <h3 id="method_getValuesForChoices">
        <div class="location">at line 258</div>
        <code>            public            array
    <strong>getValuesForChoices</strong>(array $entities)</code>
    </h3>
    <div class="details">
        <p>Returns the values corresponding to the given entities.</p>
        <p>
</p>
        <div class="tags">
                            <h4>Parameters</h4>

                    <table>
                    <tr>
                <td>array</td>
                <td>$entities</td>
                <td>
</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table>
        <tr>
            <td>array</td>
            <td>An array of choice values with ascending, 0-based numeric keys</td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table>
                    <tr>
                <td>Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface</td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

                <h3 id="method_getIndicesForChoices">
        <div class="location">at line 300</div>
        <code>            public            array
    <strong>getIndicesForChoices</strong>(array $entities)</code>
    </h3>
    <div class="details">
        <p>Returns the indices corresponding to the given entities.</p>
        <p>
</p>
        <div class="tags">
                            <h4>Parameters</h4>

                    <table>
                    <tr>
                <td>array</td>
                <td>$entities</td>
                <td>
</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table>
        <tr>
            <td>array</td>
            <td>An array of indices with ascending, 0-based numeric keys</td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table>
                    <tr>
                <td>Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface</td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

                <h3 id="method_getIndicesForValues">
        <div class="location">at line 342</div>
        <code>            public            array
    <strong>getIndicesForValues</strong>(array $values)</code>
    </h3>
    <div class="details">
        <p>Returns the entities corresponding to the given values.</p>
        <p>
</p>
        <div class="tags">
                            <h4>Parameters</h4>

                    <table>
                    <tr>
                <td>array</td>
                <td>$values</td>
                <td>An array of choice values. Not existing values in this array are ignored</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table>
        <tr>
            <td>array</td>
            <td>An array of indices with ascending, 0-based numeric keys</td>
        </tr>
    </table>

            
            
                            <h4>See also</h4>

                    <table>
                    <tr>
                <td>Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface</td>
                <td></td>
            </tr>
            </table>

                    </div>
    </div>

    
            </div>
                <div id="footer">
        Generated by <a href="http://sami.sensiolabs.org/" target="_top">Sami, the API Documentation Generator</a>.
    </div>

    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-89393-6']);
        _gaq.push(['_setDomainName', '.symfony.com']);
        _gaq.push(['_trackPageview']);

        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>
    </body>
</html>
