Conversation
Artem Burdakov
| } | ||
| $this->denyAccessUnlessGranted('complete', $task); | ||
|
|
||
| if($task->isCompleted()) |
There was a problem hiding this comment.
Лучше вынести в метод сущности, например, $task->toggleComplete()
$this->complete = $this->complete ? false : true;
| } | ||
| } | ||
|
|
||
| public function getAvailableProject(int $id, Bool $hasAdmin = false): array |
There was a problem hiding this comment.
Лучше вместо $id использовать $authorId
|
|
||
| foreach ($filter as $key => $value) | ||
| { | ||
| if($key === null) |
There was a problem hiding this comment.
Тут вероятно должно быть if($name === null)
| ]) | ||
| ->add("due_date", ChoiceType::class, [ | ||
| 'choices' => [ | ||
| 'Newest' => true, |
| public function getAvaiableTaskWithFilter(int $id, array $filter, Bool $hasAdmin = false): array | ||
| { | ||
|
|
||
| if($filter['due_date'] or $filter['due_date'] === null) |
There was a problem hiding this comment.
Как-то так должно быть кажется.
$sorting = ['due_date' => 'asc'];
if(isset($filter['due_date'] && in_array($filter['due_date'], ['asc', 'desc']) {
$sorting = [
'due_date' => $filter['due_date'];
];
}
| } | ||
| else | ||
| { | ||
| $this->id = $id; |
There was a problem hiding this comment.
Удалить, ниже использование $this->id заменить на $id
| } | ||
| else | ||
| { | ||
| $this->id = $id; |
There was a problem hiding this comment.
Аналогично методу ::getAvailableProjects
|
|
||
| class TaskType extends AbstractType | ||
| { | ||
| private $hasAdmin; |
There was a problem hiding this comment.
Нет необходимости использовать свойства.
No description provided.