public function credit($points, UserContext $context)
    {
        // credit points
        $this->userTable->creditPoints($context->getUserId(), $points);

        // dispatch credited event
        $this->eventDispatcher->dispatch(PlanEvents::CREDIT, new CreditedEvent($points, $context));
    }
public function credit($points, UserContext $context)
    {
        // credit points
        $this->userTable->creditPoints($context->getUserId(), $points);

        // dispatch credited event
        $this->eventDispatcher->dispatch(PlanEvents::CREDIT, new CreditedEvent($points, $context));
    }
public function credit ( $ points , UserContext $ context ) { // credit points $ this -> userTable -> creditPoints ( $ context -> getUserId ( ) , $ points ) ; // dispatch credited event $ this -> eventDispatcher -> dispatch ( PlanEvents :: CREDIT , new CreditedEvent ( $ points , $ context ) ) ; }
Method which is called in case the user has bought new points. It adds
the points to the user account

@param integer $points
@param \Fusio\Impl\Authorization\UserContext $context
Method which is called in case the user has bought new points . It adds the points to the user account