plugin/competency/Manager/ProgressManager.php
public function recomputeUserProgress($subject)
    {
        $this->clearCache();
        $percentage = null;

        if ($subject instanceof User) {
            $percentage = $this->computeUserProgress($subject);
        } elseif ($subject instanceof Group) {
            foreach ($subject->getUsers() as $user) {
                $this->computeUserProgress($user);
            }
        } else {
            throw new \InvalidArgumentException(
                'Subject must be an instance of User or Group'
            );
        }

        $this->om->flush();

        return $percentage;
    }
public function recomputeUserProgress($subject)
    {
        $this->clearCache();
        $percentage = null;

        if ($subject instanceof User) {
            $percentage = $this->computeUserProgress($subject);
        } elseif ($subject instanceof Group) {
            foreach ($subject->getUsers() as $user) {
                $this->computeUserProgress($user);
            }
        } else {
            throw new \InvalidArgumentException(
                'Subject must be an instance of User or Group'
            );
        }

        $this->om->flush();

        return $percentage;
    }
public function recomputeUserProgress ( $ subject ) { $ this -> clearCache ( ) ; $ percentage = null ; if ( $ subject instanceof User ) { $ percentage = $ this -> computeUserProgress ( $ subject ) ; } elseif ( $ subject instanceof Group ) { foreach ( $ subject -> getUsers ( ) as $ user ) { $ this -> computeUserProgress ( $ user ) ; } } else { throw new \ InvalidArgumentException ( 'Subject must be an instance of User or Group' ) ; } $ this -> om -> flush ( ) ; return $ percentage ; }
Recomputes the progression of a user or a group of users.
In case the subject is a user, returns the computed percentage,
otherwise returns null.

Note: this method recomputes only the percentage of reached objectives.

@param User|Group $subject

@return null|int
Recomputes the progression of a user or a group of users . In case the subject is a user returns the computed percentage otherwise returns null .