SonataAdmin ID in breadcrumbs won't go away

Masinde Muliro

I know this question has been asked severally SonataAdmin: replace ID in breadcrumbs and toString method for SonataAdminBundle Listing in Symfony2 but none of the solutions offered worked for me.

Here's what i tried having in my entity

public function __toString()
{
    return $this->getFoo() ? : '-';
}

public function __toString()
{
    return ($this->getFoo()) ? : '';
}

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

public function __toString()
{
    $this->getFoo() ? : 'n/a';
}

I still get IDs in both editing and create views. Anything else I might have forgotten? Using symfony 2.4 and latest version of Sonata Admin Bundle

Geert Wille

Change your entity class to this:

<?php

namespace ACME\MyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Pipeline
 */
class Pipeline
{
    .... code goes here ....
    ....
    public function __toString()
    {
        return (string) $this->getTitle() ? $this->getTitle() : 'New';
    }
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SonataAdmin: replace ID in breadcrumbs

From Dev

Indent in form field won't go away

From Dev

Dreamweaver Coding Hint won't go away

From Dev

Undeclared Identifier Won't Go Away

From Dev

Attribute error in python won't go away

From Dev

HTML table border won't go away

From Dev

Keyboard layout on Ubuntu won't go away!

From Dev

Extra x-ticks won't go away with pandas plot

From Dev

MS Access - SQL Server Login Prompt won't go away

From Dev

First column of vim highlighted yellow and won't go away

From Dev

Stubborn "Read-only" notification in Excel won't go away

From Dev

Windows 7 - "New Program" highlight won't go away

From Dev

How do I uninstall a Chocolatey package that won't go away?

From Dev

nameserver 127.0.1.1 in resolv.conf won't go away!

From Dev

Firebase USer Registration - Screens won't go away

From Dev

Deleted file won't go away with Maven, Eclipse, Git

From Dev

Status bar won't go away on scaled up version of iOS 7 app

From Dev

Bootstrap .nav-tabs border-bottom won't go away

From Dev

OSX wants to make changes. Type an administrator's name and password... Won't go away

From Dev

Status bar won't go away on scaled up version of iOS 7 app

From Dev

Firewall pop-up notifications won't go away (Windows 10)

From Dev

Unwanted "Expand" link won't go away. Can't trace source. display:none; not working. (Wordpress)

From Dev

Go example won't run

From Dev

Capybara won't go to page

From Dev

Xpath won't fiind id

From Dev

HTML/CSS - Mysterious Top Padding that doesn't go away

From Dev

Hibernate deletes a record, but the record doesn't go away?

From Dev

Splash Screen doesn't go away after 5 Seconds

From Dev

Why don't deleted files and folders go away when deleted?

Related Related

  1. 1

    SonataAdmin: replace ID in breadcrumbs

  2. 2

    Indent in form field won't go away

  3. 3

    Dreamweaver Coding Hint won't go away

  4. 4

    Undeclared Identifier Won't Go Away

  5. 5

    Attribute error in python won't go away

  6. 6

    HTML table border won't go away

  7. 7

    Keyboard layout on Ubuntu won't go away!

  8. 8

    Extra x-ticks won't go away with pandas plot

  9. 9

    MS Access - SQL Server Login Prompt won't go away

  10. 10

    First column of vim highlighted yellow and won't go away

  11. 11

    Stubborn "Read-only" notification in Excel won't go away

  12. 12

    Windows 7 - "New Program" highlight won't go away

  13. 13

    How do I uninstall a Chocolatey package that won't go away?

  14. 14

    nameserver 127.0.1.1 in resolv.conf won't go away!

  15. 15

    Firebase USer Registration - Screens won't go away

  16. 16

    Deleted file won't go away with Maven, Eclipse, Git

  17. 17

    Status bar won't go away on scaled up version of iOS 7 app

  18. 18

    Bootstrap .nav-tabs border-bottom won't go away

  19. 19

    OSX wants to make changes. Type an administrator's name and password... Won't go away

  20. 20

    Status bar won't go away on scaled up version of iOS 7 app

  21. 21

    Firewall pop-up notifications won't go away (Windows 10)

  22. 22

    Unwanted "Expand" link won't go away. Can't trace source. display:none; not working. (Wordpress)

  23. 23

    Go example won't run

  24. 24

    Capybara won't go to page

  25. 25

    Xpath won't fiind id

  26. 26

    HTML/CSS - Mysterious Top Padding that doesn't go away

  27. 27

    Hibernate deletes a record, but the record doesn't go away?

  28. 28

    Splash Screen doesn't go away after 5 Seconds

  29. 29

    Why don't deleted files and folders go away when deleted?

HotTag

Archive