I have table with Doctrine:
Name:
columns:
name_id: { type: integer(11), primary: true, autoincrement: true }
name_name: { type: string(65)}
parent_name_id: { type: integer(11) }
If i edit Name i would like in input parent_name_id list select with name_id, added previous.
I would like use:
NameTable.class.php:
static public $name = array(
'full-time' => 'Full time', // foreach ???
'part-time' => 'Part time', // ????
'freelance' => 'Freelance' // ????
);
public function getName()
{
return self::$name;
}
and
$this->widgetSchema['parent_name_id'] = new sfWidgetFormChoice(array(
'choices' => Doctrine::getTable('Name')->getName(),
'expanded' => true,
));
but how can i generated this in model?
Than you make:
$ php symfony doctrine:build –all –and-load –no-confirmation
and in /lib/model/doctrine/base in BaseName.class.php you can see all generated method, for example
You can use sfWidgetFormDoctrineChoice
For example: