duncanmcclean / simple-commerce

A simple, yet powerful e-commerce addon for Statamic.
https://statamic.com/addons/duncanmcclean/simple-commerce
Other
145 stars 38 forks source link

Simplify Runway calls #810

Closed duncanmcclean closed 1 year ago

duncanmcclean commented 1 year ago

This pull request introduces a Runway class inside Simple Commerce to simplify calls to the customer/order resources.

For example, previously to get the Order resource we had to do:

$orderModelClass = SimpleCommerce::orderDriver()['model'];
$runwayResource = \DoubleThreeDigital\Runway\Runway::findResourceByModel(new $orderModelClass);

But now it's just:

$runwayResource = Runway::orderModel();

This isn't much of a end-user improvement but should help simplify some of the code in SC.

github-actions[bot] commented 1 year ago

Released as part of v5.0.0.