Question : object of class symfony\component\form\formview could not be converted to string
Answered by : baggi
//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; } // ...
}
Source : https://stackoverflow.com/questions/55948523/symfony-4-object-of-class-could-not-be-converted-to-string | Last Update : Mon, 09 May 22