Search code examples
phpsymfonydoctrinesymfony-2.8persist

How to get Doctrine entity persistent collection data values with symfony


What is best way to convert Doctrine entity persistent collection to array with symfony 2 ? I want to get the values and later by using that array value, need to get the second entity values which dependent on first entity using form event listener.


Solution

  • If I understand your question correctly, this helps you:

    $arrayValues = $persistentCollection->getValues();