mirror of
https://github.com/Karaka-Management/oms-Profile.git
synced 2026-02-09 04:18:41 +00:00
fix #151
This commit is contained in:
parent
b90f14c690
commit
91e3f6939e
|
|
@ -49,9 +49,7 @@ final class ApiController extends Controller
|
|||
$created = [];
|
||||
|
||||
foreach ($profiles as $profile) {
|
||||
$this->app->eventManager->trigger('PRE:Module:Admin-profile-create', '', $profile);
|
||||
ProfileMapper::create($profile);
|
||||
$this->app->eventManager->trigger('POST:Module:Admin-profile-create', '', $profile);
|
||||
$this->apiProfileCreateDbEntry($profile);
|
||||
|
||||
$created[] = $profile->jsonSerialize();
|
||||
}
|
||||
|
|
@ -64,6 +62,24 @@ final class ApiController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Profile $profile Profile to create in the database
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function apiProfileCreateDbEntry(Profile $profile) : void
|
||||
{
|
||||
$this->app->eventManager->trigger('PRE:Module:Admin-profile-create', '', $profile);
|
||||
ProfileMapper::create($profile);
|
||||
$this->app->eventManager->trigger('POST:Module:Admin-profile-create', '', [
|
||||
$profile->getAccount()->getId(),
|
||||
null,
|
||||
$profile,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to create profile from request.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ use phpOMS\Stdlib\Base\Location;
|
|||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Profile
|
||||
class Profile implements \JsonSerializable
|
||||
{
|
||||
/**
|
||||
* Id.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user