mirror of
https://github.com/Karaka-Management/Build.git
synced 2026-02-10 00:18: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');
|
$modules = \scandir(__DIR__ . '/../../Modules');
|
||||||
|
|
||||||
$allowed = [];
|
$allowed = ['Billing'];
|
||||||
|
|
||||||
function createFunction($module, $modelName)
|
function createFunction($module, $modelName)
|
||||||
{
|
{
|
||||||
|
|
@ -127,8 +127,8 @@ function updateFunction($module, $modelName, $helperName = '')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var {$helperName} \$old */
|
/** @var \Modules\\{$module}\Models\\{$modelName} \$old */
|
||||||
\$old = {$modelName}Mapper::get()->where('id', (int) \$request->getData('id'));
|
\$old = {$modelName}Mapper::get()->where('id', (int) \$request->getData('id'))->execute();
|
||||||
\$new = \$this->update{$modelName}FromRequest(\$request, clone \$old);
|
\$new = \$this->update{$modelName}FromRequest(\$request, clone \$old);
|
||||||
|
|
||||||
\$this->updateModel(\$request->header->account, \$old, \$new, {$modelName}Mapper::class, '{$snakeCase}', \$request->getOrigin());
|
\$this->updateModel(\$request->header->account, \$old, \$new, {$modelName}Mapper::class, '{$snakeCase}', \$request->getOrigin());
|
||||||
|
|
@ -270,6 +270,11 @@ foreach ($modules as $module) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get might be standalone
|
||||||
|
if (\strpos($match, 'Get') !== false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (\strpos($match, 'Create') !== false || \strpos($match, 'Add') !== false) {
|
if (\strpos($match, 'Create') !== false || \strpos($match, 'Add') !== false) {
|
||||||
$create[] = $match;
|
$create[] = $match;
|
||||||
} elseif (\strpos($match, 'Update') !== false || \strpos($match, 'Change') !== false || \strpos($match, 'Set') !== false) {
|
} elseif (\strpos($match, 'Update') !== false || \strpos($match, 'Change') !== false || \strpos($match, 'Set') !== false) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user