sonata - Item "AdminBundle\Entity\Prize:000000046fa222" has been successfully created -
hi want sonata have item using 'name' label. not same.
i put in admin class
public function tostring($object) { if (!is_object($object)) { return ''; } if (method_exists($object, '__tostring') && null !== $object->__tostring()) { return (string) $object; } $cname = explode('\\', get_class($object)); return end($cname); }
but give same name. want have label 'name' of each entity
you need override __tostring()
magic method in entity class
public function __tostring(){ return $this->name; }
Comments
Post a Comment