diff --git a/Helper/findMissingApiFunctions.php b/Helper/findMissingApiFunctions.php index 700c696..fb6897f 100644 --- a/Helper/findMissingApiFunctions.php +++ b/Helper/findMissingApiFunctions.php @@ -16,7 +16,7 @@ declare(strict_types=1); $modules = \scandir(__DIR__ . '/../../Modules'); -$allowed = []; +$allowed = ['Billing']; function createFunction($module, $modelName) { @@ -127,8 +127,8 @@ function updateFunction($module, $modelName, $helperName = '') return; } - /** @var {$helperName} \$old */ - \$old = {$modelName}Mapper::get()->where('id', (int) \$request->getData('id')); + /** @var \Modules\\{$module}\Models\\{$modelName} \$old */ + \$old = {$modelName}Mapper::get()->where('id', (int) \$request->getData('id'))->execute(); \$new = \$this->update{$modelName}FromRequest(\$request, clone \$old); \$this->updateModel(\$request->header->account, \$old, \$new, {$modelName}Mapper::class, '{$snakeCase}', \$request->getOrigin()); @@ -270,6 +270,11 @@ foreach ($modules as $module) { continue; } + // Get might be standalone + if (\strpos($match, 'Get') !== false) { + continue; + } + if (\strpos($match, 'Create') !== false || \strpos($match, 'Add') !== false) { $create[] = $match; } elseif (\strpos($match, 'Update') !== false || \strpos($match, 'Change') !== false || \strpos($match, 'Set') !== false) {