mirror of
https://github.com/Karaka-Management/Build.git
synced 2026-01-11 11:48:40 +00:00
added api functions
This commit is contained in:
parent
cb2861eae8
commit
e1a508d64e
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user