Commit a7392fc4 authored by mabolek's avatar mabolek Committed by Thomas Löffler
Browse files

[WIP] Functions for calculating karma

parent 15aadc05
......@@ -2,6 +2,8 @@
namespace T3o\Karma\Domain\Repository;
use T3o\Karma\Service\KarmaService;
/***************************************************************
* Copyright notice
*
......@@ -27,4 +29,40 @@ namespace T3o\Karma\Domain\Repository;
class CampaignRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
/**
* @var KarmaService
*/
public $karmaService;
public function injectKarmaService(KarmaService $karmaService)
{
$this->karmaService = $karmaService;
}
/**
* Calculates the immutable karma total for a user
*
* @param \TYPO3\CMS\Extbase\Domain\Model\FrontendUser $frontendUser
* @return int
*/
public function calculateImmutableKarmaTotalForUser(\TYPO3\CMS\Extbase\Domain\Model\FrontendUser $frontendUser)
{
$frontendUser = $this->karmaService->ensureCorrectFrontendUserSubclass($frontendUser);
//@TODO: Implement calculation
return 7;
}
/**
* Calculates the mutable karma total for a user
*
* @param \TYPO3\CMS\Extbase\Domain\Model\FrontendUser $frontendUser
*/
public function calculateMutableKarmaTotalForUser(\TYPO3\CMS\Extbase\Domain\Model\FrontendUser $frontendUser)
{
$frontendUser = $this->karmaService->ensureCorrectFrontendUserSubclass($frontendUser);
//@TODO: Implement calculation
return 8;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment