Skip to content

Instantly share code, notes, and snippets.

@lox
Created November 23, 2010 01:19
Show Gist options
  • Save lox/711072 to your computer and use it in GitHub Desktop.
Save lox/711072 to your computer and use it in GitHub Desktop.
<?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