I am following the [symfony documentation for associations](http://symfony.com/doc/current/doctrine/associations.html) and I created Product and Category entities.

In my Product entity I have:

```
/**
 * @ORM\ManyToOne(targetEntity="Category", inversedBy="products")
 * @ORM\JoinColumn(name="category_id", referencedColumnName="id")
 */
private $category;

```

In my Category entity I have:

```
/**
 * @ORM\OneToMany(targetEntity="Product", mappedBy="category")
 */
private $products;

```

Here is how the generated tables look like:

```
mysql> show create table product \G
*************************** 1. row ***************************
       Table: product
Create Table: CREATE TABLE `product` (
  `id` bigint(20) unsigned NOT NULL,
  `category_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `details` text COLLATE utf8_unicode_ci COMMENT '(DC2Type:json_array)',
  PRIMARY KEY (`id`),
  KEY `IDX_D34A04AD12469DE2` (`category_id`),
  CONSTRAINT `FK_D34A04AD12469DE2` FOREIGN KEY (`category_id`) REFERENCES `category` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
1 row in set (0.00 sec)

mysql> show create table category \G
*************************** 1. row ***************************
       Table: category
Create Table: CREATE TABLE `category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
1 row in set (0.00 sec)

mysql>

```

I also installed the EasyAdmin bundle. Now, I go to EasyAdmin and open 'Category' table and insert a row. Then I go to 'Product' table and when I click on 'Add Product' button, I get the error:

```
Catchable Fatal Error: Object of class AppBundle\Entity\Category could not be converted to string

```

It is possible to fix the problem by adding a magic method \_\_toString which returns $this->name into Category entity.

Question:

1- Am I doing something wrong? Why do I need to add \_\_toString method to Category entity?

2- If this is normal, why this is not mentioned in the symfony manual?