I see that Jelly borrows heavily from the sprig Model declaration syntax. I use a modified version of Sprig that uses Field factories and I think it would be a great inclusion for Jelly here as well.
Reasons:
Cleaner looking code, may be a personal preference
Displays nicer in most IDEs as the parameter values are usually a different color and pop out more so its easier to see what the field types are
Most classes in Kohana 3 are factories or singletons, why break from convention in models?
I see that Jelly borrows heavily from the sprig Model declaration syntax. I use a modified version of Sprig that uses Field factories and I think it would be a great inclusion for Jelly here as well.
Reasons:
Example: class Model_Post extends Jelly_Model { public static function initialize(Jelly_Meta $meta) { $meta->table('posts') ->fields(array( 'id' => Jelly::Field('Primary'), 'name' => Jelly::Field('String'), 'body' => Jelly::Field('Text'), 'status' => Jelly::Field('Enum', array( 'choices' => array('draft', 'review', 'published'))), 'author' => Jelly::Field('BelongsTo'), 'tags' => Jelly::Field('ManyToMany'), )); } }