Created
November 23, 2010 01:19
-
-
Save lox/711072 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use \Pheasant; | |
use \Pheasant\Types; | |
class Post extends Pheasant\DomainObject | |
{ | |
public function properties() | |
{ | |
return array( | |
'postid' => new Types\Sequence(), | |
'title' => new Types\String(255, 'required'), | |
'authorid' => new Types\Integer(11), | |
); | |
} | |
} | |
// configure pheasant | |
Pheasant::initialize('mysql://localhost:/mydatabase'); | |
// create some objects | |
$post = new Post(array('title'=>'My Post')); | |
$post->save(); | |
echo $post->title; // returns 'My Post' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment