Code Duplication    Length = 9-10 lines in 4 locations

module/Applications/src/Applications/Entity/Application.php 1 location

@@ 280-288 (lines=9) @@
277
     * @return Application
278
     * @see \Applications\Entity\ApplicationInterface::setUser()
279
     */
280
    public function setUser(UserInterface $user)
281
    {
282
        if ($this->user) {
283
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
284
        }
285
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
286
        $this->user = $user;
287
        return $this;
288
    }
289
    
290
    /**
291
     * {@inheritDoc}

module/Core/src/Core/Entity/FileEntity.php 1 location

@@ 82-91 (lines=10) @@
79
        return 'Entity/File';
80
    }
81
    
82
    public function setUser(UserInterface $user)
83
    {
84
        if ($this->user) {
85
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
86
        }
87
        $this->user = $user;
88
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
89
        
90
        return $this;
91
    }
92
93
    /**
94
     * @return User

module/Organizations/src/Organizations/Entity/Organization.php 1 location

@@ 476-484 (lines=9) @@
473
        $perms->build();
474
    }
475
476
    public function setUser(UserInterface $user)
477
    {
478
        if ($this->user) {
479
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
480
        }
481
        $this->user = $user;
482
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
483
        return $this;
484
    }
485
486
    public function getUser()
487
    {

module/Jobs/src/Jobs/Entity/Job.php 1 location

@@ 457-465 (lines=9) @@
454
     * (non-PHPdoc)
455
     * @see \Jobs\Entity\JobInterface::setUser()
456
     */
457
    public function setUser(UserInterface $user)
458
    {
459
        if ($this->user) {
460
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
461
        }
462
        $this->user = $user;
463
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
464
        return $this;
465
    }
466
    /**
467
     * (non-PHPdoc)
468
     * @see \Jobs\Entity\JobInterface::getUser()