Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 1.13 KB

sortable.rst

File metadata and controls

60 lines (38 loc) · 1.13 KB

Sortable

Configuration

Methods

Example

<?php
class Model_Page extends \Nos\Orm\Model
{
    protected static $_behaviours = array(
        'Nos\Orm_Behaviour_Sortable' => array(
            'events' => array('after_sort', 'before_insert'),
            'sort_property' => 'page_sort',
        ),
    );
}

$page_1 = Model_Page::find(1);
$page_2 = Model_Page::find(2);

$page_2->move_after($page_1);