/** * Test the move method. * * @return void * * @since 12.3 */ public function testMove() { $this->object->load(array('id1' => 25, 'id2' => 50)); $this->object->move(1); $object2 = new TableDbTestComposite(TestCaseDatabase::$driver); $object2->load(array('id1' => 25, 'id2' => 51)); $this->assertEquals(1, $object2->ordering); $object2->load(array('id1' => 25, 'id2' => 50)); $this->assertEquals(2, $object2->ordering); }
public function move($dir, $where = null) { parent::move($dir); if (method_exists($this, 'reorder')) { $this->reorder(); } else { $this->updateOrder(); } }
function move($dirn, $where = '') { // Make sure we have correct ordering first $this->reorder($where); $sql = ' parent_id = ' . (int) $this->parent_id; $where = $where ? $where . ' AND ' . $sql : $sql; return parent::move($dirn, $where); }