Skip to content

Задание#8

Open
bda-nt wants to merge 2 commits intoartsofte-php-course:mainfrom
bda-nt:main
Open

Задание#8
bda-nt wants to merge 2 commits intoartsofte-php-course:mainfrom
bda-nt:main

Conversation

@bda-nt
Copy link

@bda-nt bda-nt commented Jun 2, 2022

Сделал 7 задач.

* @param $id
* @return void
*/
public function show($id): Response

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно добавить проверку что пользователю доступен данные проект

throw $this->createNotFoundException(sprintf("Project with id %s not found", $id));
}

$tasks = $this->getDoctrine()->getRepository(Task::class)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно использовать $project->getTasks();
Для этого надо https://symfony.com/doc/4.4/doctrine/associations.html#joining-related-records

parent::__construct($registry, Project::class);
}

public function getAvailableProjects(int $id, bool $hasAdmin = false) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше использовать не $id, а $authorId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants