get('order'); if (is_null($order)) { $order = $this->max('order'); if (!$order) { $order = 0; } $order++; $entity->set('order', $order); } } }