class Model_CMS extends Orm\Model { /** * Table name * * @var string */ protected static $_table_name = 'cms'; /** * Primary key * * @var array */ protected static $_primary_key = array('id'); /** * Properties * * @var array */ protected static $_properties = array( 'id' => array('data_type' => 'int'), 'parent_id' => array('data_type' => 'int'), 'tag' => array('data_type' => 'varchar'), 'title' => array('data_type' => 'varchar'), 'description' => array('data_type' => 'varchar'), 'content' => array('data_type' => 'text'), 'sort_order' => array('data_type' => 'int', 'default' => 999), 'created_at' => array('data_type' => 'time_unix'), 'updated_at' => array('data_type' => 'time_unix'), ); /** * Used observers * * @var array */ protected static $_observers = array( 'Orm\\Observer_Typing' => array( 'events' => array('before_save', 'after_save', 'after_load'), ), 'Orm\\Observer_CreatedAt' => array( 'events' => array('before_insert') ), 'Orm\\Observer_UpdatedAt' => array( 'events' => array('before_save') ), 'Orm\\Observer_Slug' => array( 'events' => array('before_insert'), 'source' => 'title', 'property' => 'tag', ), ); }
$menuitems = Model_CMS::find('all', array('order_by' => array('sort_order' => 'asc')));
It looks like you're new here. If you want to get involved, click one of these buttons!