类实体
**
* classes
*
* @ORM\Table(name="classes")
* @ORM\Entity
* @Annotation\Name("classes")
* @Annotation\Hydrator("Zend\Stdlib\Hydrator\ClassMethods")
*/
class Classes {
/**
* @var integer
*
* @ORM\Column(name="class_id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
* @Annotation\Exclude()
*/
protected $classId;
/**
* @var string
*
* @ORM\Column(name="class_name", type="string", length=100, nullable=false)
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Validator({"name":"StringLength", "options":{"min":1, "max":30}})
* @Annotation\Validator({"name":"Regex", "options":{"pattern":"/^[a-zA-Z][a-zA-Z0-9_-]{0,24}$/"}})
* @Annotation\Attributes({"type":"text"})
* @Annotation\Options({"label":"class name:"})
*/
private $className;
}
实体地图技术类
/** @ORM\Entity */
class Maptechclass {
/**
* @var integer
*
* @ORM\Column(name="map_tech_class_id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
* @Annotation\Exclude()
*/
protected $mapTechClassID;
/**
* @var integer
*
* @ORM\Column(name="map_sch_id", type="integer", nullable=true)
*/
protected $mapSchID;
/**
* @var integer
*
* @ORM\Column(name="map_tech_id", type="integer", nullable=true)
*/
protected $mapTechID;
/**
* @ORM\OneToMany(targetEntity="SchoolAdmin\Entity\Classes")
* @ORM\JoinColumn(name="map_class_id", referencedColumnName="classId")
* */
protected $mapClassID;
}
以下错误将显示,如何修复它。字段“mapClassID”上的 OneToMany 映射需要“mappedBy”属性。