symfony - how to render checkbox form in syfony 2 -
i have question? there 2 entity manytomany relation join table in syfony 2. first 1 certificate, second 1 mayag , join table certificate_mayag. certificate has many mayag isavailable, startdate, enddate fields. mayag has many certificate want render relation checkbox form. form consists of certificate info , mayag list checkbox , startdate, enddate , isavailable fields. how solution , 1 best way develop?
<?php /** * created phpstorm. * user: mendbayar * date: 12/8/13 * time: 1:00 pm */ namespace mnd\srdbundle\entity; use doctrine\orm\mapping orm; /** * @orm\entity(repositoryclass="mnd\srdbundle\repository\certifyrepository") * @orm\table(name="certify") */ class certify { /** * @var integer * * @orm\column(name="id", type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ private $id; /** * @orm\column(type="string", unique=true, length=50) */ protected $certificate_number; /** * @orm\manytoone(targetentity="certificateowner", inversedby="certificates") * @orm\joincolumn(name="owner_id", referencedcolumnname="id") */ protected $owner; /** * @orm\manytoone(targetentity="document", inversedby="certificates") * @orm\joincolumn(name="document_id", referencedcolumnname="id") */ protected $document; /** * @orm\manytoone(targetentity="action", inversedby="certificates") * @orm\joincolumn(name="action_id", referencedcolumnname="id") */ protected $action; /** * @orm\onetomany(targetentity="extension", mappedby="certify") */ protected $extensions; /** * @orm\onetomany(targetentity="certifymayag", mappedby="certify") */ protected $mayags;
}
<?php /** * created phpstorm. * user: mendbayar * date: 12/22/13 * time: 1:41 pm */ namespace mnd\srdbundle\entity; use doctrine\orm\mapping orm; /** * @orm\entity(repositoryclass="mnd\srdbundle\repository\certifymayagrepository") * @orm\table(name="certify_mayag") */ class certifymayag { /** * @var integer * * @orm\column(name="id", type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ protected $id; /** * @orm\manytoone(targetentity="certify", inversedby="certifymayags") * @orm\joincolumn(name="certifyid", referencedcolumnname="id") */ protected $certify; /** * @orm\manytoone(targetentity="mayag", inversedby="mayagcertifies") * @orm\joincolumn(name="mayagid", referencedcolumnname="id") */ protected $mayag; /** * @orm\column(type="boolean") */ protected $isavailable; /** * @orm\column(type="datetime") */ protected $startdate; /** * @orm\column(type="datetime") */ protected $enddate;
}
<?php /** * created phpstorm. * user: mendbayar * date: 12/22/13 * time: 1:38 pm */ namespace mnd\srdbundle\entity; use doctrine\orm\mapping orm; /** * @orm\entity(repositoryclass="mnd\srdbundle\repository\mayagrepository") * @orm\table(name="mayag") */ class mayag { /** * @var integer * * @orm\column(name="id", type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ protected $id; /** * @orm\column(type="string") * */ protected $name; /** * @orm\onetomany(targetentity="certifymayag", mappedby="mayag") */ protected $certifies; /** * @orm\column(type="boolean", nullable=true) */ protected $isavailable; /** * @orm\column(type="datetime") */ protected $startdate; /** * @orm\column(type="datetime") */ protected $enddate; /** * @orm\column(type="text") * */ protected $description;
}
3 entities has automatic getter setter.
Comments
Post a Comment