<commit_before><?php

namespace AppBundle\Controller;

use AppBundle\Entity\Project;
use AppBundle\Entity\Stage;
use AppBundle\Entity\UserProject;
use AppBundle\Form\ProjectType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class ProjectController extends Controller {

	public function listAction($page) {
		$em = $this->getDoctrine()->getManager();
		$repoP = $em->getRepository('AppBundle:Project');
		$projects = $repoP->findProjectsEager();

		return $this->render('AppBundle:Project:list.html.twig', array(
					'projects' => $projects
		));
	}
	

	public function myProjectsAction() {
		return $this->render('AppBundle:Project:myProjects.html.twig');
	}

	public function detailAction($id) {
		$em = $this->getDoctrine()->getManager();
		$repoP = $em->getRepository('AppBundle:Project');
		$project = $repoP->findProjectEager($id);


		return $this->render('AppBundle:Project:project.html.twig', array(
					'project' => $project
		));
	}

	public function addAction() {
		//test
		$repoUser = $this->getDoctrine()->getManager()->getRepository('AppBundle:User');
		$stage1 = (new Stage())->setTitle('Blablo')->setVolume(32)->setStatus(true);
		$stage2 = (new Stage())->setTitle('TesStage')->setVolume(12)->setStatus(false);
		$userProject1 = (new UserProject())->setUser($repoUser->find(2))->setStatus(1);
		$userProject2 = (new UserProject())->setUser($repoUser->find(3))->setStatus(1);
		$project = (new Project())->addStage($stage1)->addStage($stage2)
				->addUserProject($userProject1)
				->addUserProject($userProject2);
		// /test

		$form = $this->createForm(new ProjectType(), $project, array(
			'action' => $this->generateUrl('project_add')
		));<commit_msg>Project Add : UserType  Mapping : Leader-Project<commit_after><?php

namespace AppBundle\Controller;

use AppBundle\Entity\Project;
use AppBundle\Entity\Stage;
use AppBundle\Entity\UserProject;
use AppBundle\Form\ProjectType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class ProjectController extends Controller {

	public function listAction($page) {
		$em = $this->getDoctrine()->getManager();
		$repoP = $em->getRepository('AppBundle:Project');
		$projects = $repoP->findProjectsEager();

		return $this->render('AppBundle:Project:list.html.twig', array(
					'projects' => $projects
		));
	}
	

	public function myProjectsAction() {
		return $this->render('AppBundle:Project:myProjects.html.twig');
	}

	public function detailAction($id) {
		$em = $this->getDoctrine()->getManager();
		$repoP = $em->getRepository('AppBundle:Project');
		$project = $repoP->findProjectEager($id);


		return $this->render('AppBundle:Project:project.html.twig', array(
					'project' => $project
		));
	}

	public function addAction() {
		//test
		$repoUser = $this->getDoctrine()->getManager()->getRepository('AppBundle:User');
		$stage1 = (new Stage())->setTitle('Blablo')->setVolume(32)->setStatus(true);
		$stage2 = (new Stage())->setTitle('TesStage')->setVolume(12)->setStatus(false);
		$userProject1 = (new UserProject())->setUser($repoUser->find(2))->setStatus(1);
		$userProject2 = (new UserProject())->setUser($repoUser->find(3))->setStatus(1);
		$userProject3 = (new UserProject())->setUser($repoUser->find(4))->setStatus(4);
		$project = (new Project())->addStage($stage1)->addStage($stage2)
				->addUserProject($userProject1)
				->addUserProject($userProject2)
				->addUserProject($userProject3);
		// /test

		$form = $this->createForm(new ProjectType(), $project, array(
			'action' => $this->generateUrl('project_add')
		));
{'fraction_non_alphanumeric': 0.1867043847241867, 'fraction_numerical': 0.010183875530410185, 'mean_word_length': 5.826254826254826, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2393844', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1130, 'n_words': 170}