load doctrine extensions during kernel bootstrap #84 (#92)

This commit is contained in:
Kevin Papst
2018-01-16 21:35:23 +01:00
committed by GitHub
parent 3f221fcdb8
commit 0a65965187
11 changed files with 126 additions and 172 deletions

View File

@@ -25,9 +25,10 @@ use App\Entity\Project;
class TimesheetQuery extends BaseQuery
{
const STATE_ALL = 0;
const STATE_RUNNING = 1;
const STATE_STOPPED = 2;
const STATE_ALL = 1;
const STATE_RUNNING = 2;
const STATE_STOPPED = 3;
/**
* Overwritten for different default order
* @var string
@@ -153,9 +154,15 @@ class TimesheetQuery extends BaseQuery
*/
public function setState($state)
{
if (!is_int($state) && $state != (int) $state) {
return $this;
}
$state = (int) $state;
if (in_array($state, [self::STATE_ALL, self::STATE_RUNNING, self::STATE_STOPPED], true)) {
$this->state = $state;
}
return $this;
}
}