-3

誰でもこの問題を解決するのを手伝ってもらえますか? 理由はわかりませんが、次の例外が発生します。

Catchable Fatal Error: クラス AppBundle\Entity\Job のオブジェクトを文字列に変換できませんでした

私のエンティティ カテゴリ:

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Category
 *
 * @ORM\Table(name="category")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\CategoryRepository")
 */
class Category
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="label", type="string", length=255)
     */
    private $label;


    /**
    * @var string
     *@ORM\ManyToMany(targetEntity="Job", mappedBy="categories", cascade={"persist", "merge"})
    */
    private $jobs ; 


    /**
     * Constructor
     */
    public function __construct()
    {
        $this->jobs = new \Doctrine\Common\Collections\ArrayCollection();
    }



    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set label
     *
     * @param string $label
     *
     * @return Category
     */
    public function setLabel($label)
    {
        $this->label = $label;

        return $this;
    }

    /**
     * Get label
     *
     * @return string
     */
    public function getLabel()
    {
        return $this->label;
    }
    /**
     * Add job
     *
     * @param \AppBundle\Entity\Job $job
     *
     * @return Category
     */
    public function addJob(\AppBundle\Entity\Job $job)
    {
        $this->jobs[] = $job;

        return $this;
    }

    /**
     * Remove job
     *
     * @param \AppBundle\Entity\Job $job
     */
    public function removeJob(\AppBundle\Entity\Job $job)
    {
        $this->jobs->removeElement($job);
    }

    /**
     * Get jobs
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getJobs()
    {
        return $this->jobs;
    }

}

いくつかのフィールドをカスタマイズするエンティティ構成 (easyadmin):

easy_admin:

    design:

    entities:
        Category:
            class: AppBundle\Entity\Category

スクリーンショットはバグを説明していますか、それとも正確には何を意味していますか?

ここに画像の説明を入力

4

1 に答える 1