Answers for "object of class symfony\component\form\formview could not be converted to string"

PHP
1

object of class symfony\component\form\formview could not be converted to string

//You need to implement the __toString() method in the Entreprise entity

namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass="App\Repository\EntrepriseRepository")
 */
class Entreprise
{
    //...

    public function __toString()
    {
        return $this->entreprise_nom;
    }

    // ...
}
Posted by: Guest on May-02-2022

Code answers related to "object of class symfony\component\form\formview could not be converted to string"

Browse Popular Code Answers by Language