Commit af8ca167 authored by zYne's avatar zYne

--no commit message

--no commit message
parent 81c22784
...@@ -5,13 +5,13 @@ Doctrine always adds a primary key column named 'id' to tables that doesn't have ...@@ -5,13 +5,13 @@ Doctrine always adds a primary key column named 'id' to tables that doesn't have
Lets say we want to create a database table called 'user' with columns id(primary key), name, username, password and created. Provided that you have already installed Doctrine these few lines of code are all you need: Lets say we want to create a database table called 'user' with columns id(primary key), name, username, password and created. Provided that you have already installed Doctrine these few lines of code are all you need:
User.php : User.php :
<code> <code type="php">
class User extends Doctrine_Record class User extends Doctrine_Record
{ {
public function setTableDefinition() public function setTableDefinition()
{ {
// set 'user' table columns, note that // set 'user' table columns, note that
// id column is always auto-created // id column is auto-created as no primary key is specified
$this->hasColumn('name', 'string',30); $this->hasColumn('name', 'string',30);
$this->hasColumn('username', 'string',20); $this->hasColumn('username', 'string',20);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment