93
src/Model/ActivityStatistic.php
Normal file
93
src/Model/ActivityStatistic.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
/**
|
||||
* Activity statistics
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class ActivityStatistic
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $count = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $recordAmount = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $recordDuration = 0;
|
||||
|
||||
/**
|
||||
* Returns the total amount of included timesheet records.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRecordAmount()
|
||||
{
|
||||
return $this->recordAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $recordAmount
|
||||
* @return ActivityStatistic
|
||||
*/
|
||||
public function setRecordAmount($recordAmount)
|
||||
{
|
||||
$this->recordAmount = (int) $recordAmount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total duration of all included timesheet records.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRecordDuration()
|
||||
{
|
||||
return $this->recordDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $recordDuration
|
||||
* @return ActivityStatistic
|
||||
*/
|
||||
public function setRecordDuration($recordDuration)
|
||||
{
|
||||
$this->recordDuration = (int) $recordDuration;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of activities that are included in the statistic result.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $count
|
||||
* @return ActivityStatistic
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = (int) $count;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
137
src/Model/CustomerStatistic.php
Normal file
137
src/Model/CustomerStatistic.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
/**
|
||||
* Customer statistics
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class CustomerStatistic
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $count = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $recordAmount = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $recordDuration = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $activityAmount = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $projectAmount = 0;
|
||||
|
||||
/**
|
||||
* Returns the total amount of included timesheet records.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRecordAmount()
|
||||
{
|
||||
return $this->recordAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $recordAmount
|
||||
* @return $this
|
||||
*/
|
||||
public function setRecordAmount($recordAmount)
|
||||
{
|
||||
$this->recordAmount = (int) $recordAmount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total duration of all included timesheet records.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRecordDuration()
|
||||
{
|
||||
return $this->recordDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $recordDuration
|
||||
* @return $this
|
||||
*/
|
||||
public function setRecordDuration($recordDuration)
|
||||
{
|
||||
$this->recordDuration = (int) $recordDuration;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of activities that are included in the statistic result.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $count
|
||||
* @return $this
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = (int) $count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getActivityAmount()
|
||||
{
|
||||
return $this->activityAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $activityAmount
|
||||
* @return $this
|
||||
*/
|
||||
public function setActivityAmount($activityAmount)
|
||||
{
|
||||
$this->activityAmount = (int) $activityAmount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getProjectAmount()
|
||||
{
|
||||
return $this->projectAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $projectAmount
|
||||
* @return $this
|
||||
*/
|
||||
public function setProjectAmount($projectAmount)
|
||||
{
|
||||
$this->projectAmount = (int) $projectAmount;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
115
src/Model/ProjectStatistic.php
Normal file
115
src/Model/ProjectStatistic.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
/**
|
||||
* Project statistics
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class ProjectStatistic
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $count = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $recordAmount = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $recordDuration = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $activityAmount = 0;
|
||||
|
||||
/**
|
||||
* Returns the total amount of included timesheet records.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRecordAmount()
|
||||
{
|
||||
return $this->recordAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $recordAmount
|
||||
* @return ProjectStatistic
|
||||
*/
|
||||
public function setRecordAmount($recordAmount)
|
||||
{
|
||||
$this->recordAmount = (int) $recordAmount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total duration of all included timesheet records.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRecordDuration()
|
||||
{
|
||||
return $this->recordDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $recordDuration
|
||||
* @return ProjectStatistic
|
||||
*/
|
||||
public function setRecordDuration($recordDuration)
|
||||
{
|
||||
$this->recordDuration = (int) $recordDuration;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of activities that are included in the statistic result.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $count
|
||||
* @return ProjectStatistic
|
||||
*/
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->count = (int) $count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getActivityAmount()
|
||||
{
|
||||
return $this->activityAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $activityAmount
|
||||
* @return ProjectStatistic
|
||||
*/
|
||||
public function setActivityAmount($activityAmount)
|
||||
{
|
||||
$this->activityAmount = (int) $activityAmount;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
86
src/Model/Statistic/Month.php
Normal file
86
src/Model/Statistic/Month.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Model\Statistic;
|
||||
|
||||
/**
|
||||
* Yearly statistics
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class Month
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $month;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $totalDuration = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $totalRate = 0;
|
||||
|
||||
/**
|
||||
* Month constructor.
|
||||
* @param string $month
|
||||
*/
|
||||
public function __construct($month)
|
||||
{
|
||||
$this->month = $month;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getMonth()
|
||||
{
|
||||
return $this->month;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalDuration()
|
||||
{
|
||||
return $this->totalDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $totalDuration
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotalDuration($totalDuration)
|
||||
{
|
||||
$this->totalDuration = $totalDuration;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalRate()
|
||||
{
|
||||
return $this->totalRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $totalRate
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotalRate($totalRate)
|
||||
{
|
||||
$this->totalRate = $totalRate;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
78
src/Model/Statistic/Year.php
Normal file
78
src/Model/Statistic/Year.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Model\Statistic;
|
||||
|
||||
/**
|
||||
* Yearly statistics
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class Year
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $year;
|
||||
/**
|
||||
* @var Month[]
|
||||
*/
|
||||
protected $months;
|
||||
|
||||
/**
|
||||
* Year constructor.
|
||||
* @param string $year
|
||||
*/
|
||||
public function __construct($year)
|
||||
{
|
||||
$this->year = $year;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getYear()
|
||||
{
|
||||
return $this->year;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Month $month
|
||||
* @return $this
|
||||
*/
|
||||
public function setMonth(Month $month)
|
||||
{
|
||||
$this->months[(int)$month->getMonth()] = $month;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $month
|
||||
* @return null|Month
|
||||
*/
|
||||
public function getMonth($month)
|
||||
{
|
||||
if (isset($this->months[$month])) {
|
||||
return $this->months[$month];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Month[]
|
||||
*/
|
||||
public function getMonths()
|
||||
{
|
||||
return array_values($this->months);
|
||||
}
|
||||
}
|
||||
81
src/Model/TimesheetGlobalStatistic.php
Normal file
81
src/Model/TimesheetGlobalStatistic.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
/**
|
||||
* Timesheet statistics for all user.
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class TimesheetGlobalStatistic extends TimesheetStatistic
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $activeThisMonth = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $activeTotal = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $activeCurrently = 0;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getActiveCurrently()
|
||||
{
|
||||
return $this->activeCurrently;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $activeCurrently
|
||||
*/
|
||||
public function setActiveCurrently($activeCurrently)
|
||||
{
|
||||
$this->activeCurrently = $activeCurrently;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getActiveThisMonth()
|
||||
{
|
||||
return $this->activeThisMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $activeThisMonth
|
||||
*/
|
||||
public function setActiveThisMonth($activeThisMonth)
|
||||
{
|
||||
$this->activeThisMonth = $activeThisMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getActiveTotal()
|
||||
{
|
||||
return $this->activeTotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $activeTotal
|
||||
*/
|
||||
public function setActiveTotal($activeTotal)
|
||||
{
|
||||
$this->activeTotal = $activeTotal;
|
||||
}
|
||||
}
|
||||
123
src/Model/TimesheetStatistic.php
Normal file
123
src/Model/TimesheetStatistic.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use \DateTime;
|
||||
|
||||
/**
|
||||
* Timesheet statistics for one user.
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class TimesheetStatistic
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $durationThisMonth = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $durationTotal = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $amountThisMonth = 0;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $amountTotal = 0;
|
||||
/**
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $firstEntry;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getDurationThisMonth()
|
||||
{
|
||||
return $this->durationThisMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $durationThisMonth
|
||||
*/
|
||||
public function setDurationThisMonth($durationThisMonth)
|
||||
{
|
||||
$this->durationThisMonth = $durationThisMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getAmountTotal()
|
||||
{
|
||||
return $this->amountTotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $amountTotal
|
||||
*/
|
||||
public function setAmountTotal($amountTotal)
|
||||
{
|
||||
$this->amountTotal = $amountTotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getDurationTotal()
|
||||
{
|
||||
return $this->durationTotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $durationTotal
|
||||
*/
|
||||
public function setDurationTotal($durationTotal)
|
||||
{
|
||||
$this->durationTotal = $durationTotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getAmountThisMonth()
|
||||
{
|
||||
return $this->amountThisMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $amountThisMonth
|
||||
*/
|
||||
public function setAmountThisMonth($amountThisMonth)
|
||||
{
|
||||
$this->amountThisMonth = $amountThisMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getFirstEntry()
|
||||
{
|
||||
return $this->firstEntry;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateTime $firstEntry
|
||||
*/
|
||||
public function setFirstEntry(DateTime $firstEntry)
|
||||
{
|
||||
$this->firstEntry = $firstEntry;
|
||||
}
|
||||
}
|
||||
41
src/Model/UserStatistic.php
Normal file
41
src/Model/UserStatistic.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
/**
|
||||
* User statistics
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class UserStatistic
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $totalAmount = 0;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalAmount()
|
||||
{
|
||||
return $this->totalAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $totalAmount
|
||||
*/
|
||||
public function setTotalAmount($totalAmount)
|
||||
{
|
||||
$this->totalAmount = $totalAmount;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user