/** * Set the position to the last item when creating * * @param Jam_Model $model */ public function model_before_create(Jam_Model $model) { if (!$model->changed($this->_field)) { $model->{$this->_field} = $model->get_position(); } }