Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
uc_order_product_save() is a two-line function that is only called from two places, it can just be inlined and removed.
Comments
Comment #2
TR CreditAttribution: TR commentedThere are a number of other procedural functions in uc_order.module that would also be good to remove and replace with methods on the Order entity or OrderProduct entity. With of course the corresponding method defined on the entity interface.
For example,
uc_order_comment_save() => Order::addComment()
uc_order_comments_load() => Order::getComments()
uc_order_product_save() => OrderProduct::save()
uc_order_product_revive() => I don't even know what this is for ... I suspect we don't need it if we carry around entities rather than arrays/stdClasses pretending to be products.
uc_order_product_is_shippable() => OrderProduct::isShippable()
uc_order_state_options_list() => Order::getStates()
uc_order_state_default() => Order::getDefaultStatus()
uc_order_actions() => Order::getActions()
Comment #3
longwaveI think uc_order_actions() should be converted to EntityListBuilderInterface::getOperations(), then we can get rid of the custom Views field as well.