From: avl Date: Wed, 25 Mar 2009 10:12:44 +0000 (+0200) Subject: reorder customizable X-Git-Tag: 0.6~154 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=a182908c05a5e8b2a3cdcf04f85e54dbcd082a32;p=ipf-legacy-orm.git reorder customizable --- diff --git a/ipf/orm/record.php b/ipf/orm/record.php index 9eeb8f1..42a86fb 100644 --- a/ipf/orm/record.php +++ b/ipf/orm/record.php @@ -1295,4 +1295,15 @@ abstract class IPF_ORM_Record extends IPF_ORM_Record_Abstract implements Countab return $this->_custom[$name]; return null; } + + public function _reorder($ids, $ord_field){ + $ord = 1; + foreach($ids as $id){ + $item = $this->getTable()->find($id); + $item[$ord_field] = $ord; + $item->save(); + $ord++; + } + } + } \ No newline at end of file