fix formatting and docblock

This commit is contained in:
Dennis Eichhorn 2019-07-08 19:15:25 +02:00
parent 08bf6984cd
commit 5b56b7367d
2 changed files with 15 additions and 8 deletions

View File

@ -115,8 +115,15 @@ trait PermissionHandlingTrait
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function hasPermission(int $permission, int $unit = null, string $app = null, string $module = null, int $type = null, int $element = null, int $component = null) : bool public function hasPermission(
{ int $permission,
int $unit = null,
string $app = null,
string $module = null,
int $type = null,
int $element = null,
int $component = null
) : bool {
$app = $app !== null ? \strtolower($app) : $app; $app = $app !== null ? \strtolower($app) : $app;
foreach ($this->permissions as $p) { foreach ($this->permissions as $p) {

View File

@ -239,21 +239,21 @@ abstract class ModuleAbstract
/** /**
* Create a model * Create a model
* *
* @param RequestAbstract $request Request * @param int $account Account id
* @param mixed $obj Response object * @param mixed $obj Response object
* @param string $mapper Object mapper * @param string $mapper Object mapper
* @param string $trigger Trigger for the event manager * @param string $trigger Trigger for the event manager
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
*/ */
protected function createModel(RequestAbstract $request, $obj, string $mapper, string $trigger) : void protected function createModel(int $account, $obj, string $mapper, string $trigger) : void
{ {
$this->app->eventManager->trigger('PRE:Module:' . static::MODULE_NAME . '-' . $trigger . '-create', '', $obj); $this->app->eventManager->trigger('PRE:Module:' . static::MODULE_NAME . '-' . $trigger . '-create', '', $obj);
$mapper::create($obj); $mapper::create($obj);
$this->app->eventManager->trigger('POST:Module:' . static::MODULE_NAME . '-' . $trigger . '-create', '', [ $this->app->eventManager->trigger('POST:Module:' . static::MODULE_NAME . '-' . $trigger . '-create', '', [
$request->getHEader()->getAccount(), $account,
null, $obj, null, $obj,
0, 0, 0, 0,
static::MODULE_NAME, static::MODULE_NAME,