Reputation: 907
Using PhalconPHP, is it possible to create a table in a database using an ORM model with metadata in comments? For example, using symphony one can achive what I want like this: http://symfony.com/doc/current/book/doctrine.html
Upvotes: 1
Views: 708
Reputation: 907
so the solution I've found is this
$connection->createTable("robots", null, array(
"columns" => array(
new Column("id", array(
"type" => Column::TYPE_INTEGER,
"size" => 10,
"notNull" => true,
"autoIncrement" => true,
)),
new Column("name", array(
"type" => Column::TYPE_VARCHAR,
"size" => 70,
"notNull" => true,
)),
new Column("year", array(
"type" => Column::TYPE_INTEGER,
"size" => 11,
"notNull" => true,
))
),
"indexes" => array(
new Index("PRIMARY", array("id"))
)
));
hope it will be help to someone :)
Upvotes: 3