symfony - Status with three choices -
i want make choice dropdown form 3 choices: -favored -intended -verified could'nt use boolean this.
i have no idea how set annotations status field in entity. help?
/** * @var boolean * * @orm\column(name="status", type="boolean") */ private $status;
i don't know if have understood question in fact boolean field type symfony2/doctrine2 tinyint(1) in sql database. can put integer values -128 127.
generally entities use "rule" :
<?php class myentity { const status_favored = 1; const status_intented = 2; const status_verified = 3; /** * @var integer * * @orm\column(name="status", type="boolean") */ private $status; public function __construct() { $this->status = self::status_favored; } /** * ur form example */ public static function getstatusforchoiceformfield() { return array( self::status_favored => 'favored', self::status_intented => 'intented', self::status_verified => 'verified' ); } } ?>
see u !
Comments
Post a Comment