= declare { param foo => !is global, is immutable, valid_values are qw( more values ); column bar => field1 is 'value', field2 is 'some_other_value', sub_params are param( is happy ), param ( is sad ); }; print $objects{foo}; # a MyApp::Param object print $objects{bar}; # a MyApp::Column object # Assuming that MyApp::Column::new simply blesses into a hash... print $objects{bar}{sub_params}[0]; # a MyApp::Param object print $objects{bar}{sub_params}[1]; # a MyApp::Param object 2006 12年4月22⽇日星期⽇日
user => references TestApp::Model::User by 'id', is mandatory; column type => ...; column value => validator is sub { ... }, default is sub { } ; }; 12年4月22⽇日星期⽇日
include is slow. • json_encode / json_decode are slower than require. • method is slower than properties. • magic method is slower than normal method. • array is always faster than object. 12年4月22⽇日星期⽇日
find a record with primary key: $record = Author::load( 1 ); // To update a record (static): $ret = Author::update( array( 'name' => 'Author' ))->where() ->equal('id',3) ->execute(); 12年4月22⽇日星期⽇日
Array to store routes • through PHP extension, can dispatch 1607% faster than pure php version • Annotation reader support • RESTful plugin 12年4月22⽇日星期⽇日
public function create($resource) { } public function load($resource,$id) { } public function update($resource,$id) { } public function delete($resource,$id) { } public function find($resource) { } } 12年4月22⽇日星期⽇日