detail pages for customers and projects (#1371)

This commit is contained in:
Kevin Papst
2020-01-16 16:25:28 +01:00
committed by GitHub
parent 28c5357f11
commit 6a44dbfe83
131 changed files with 3055 additions and 1742 deletions

View File

@@ -12,7 +12,7 @@ namespace App\Tests\DataFixtures;
use App\Entity\Activity;
use App\Entity\Project;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Faker\Factory;
/**
@@ -36,6 +36,10 @@ final class ActivityFixtures extends Fixture
* @var callable
*/
private $callback;
/**
* @var Project[]
*/
private $projects = [];
/**
* Will be called prior to persisting the object.
@@ -79,15 +83,28 @@ final class ActivityFixtures extends Fixture
return $this;
}
/**
* @param Project[] $projects
* @return ActivityFixtures
*/
public function setProjects(array $projects): ActivityFixtures
{
$this->projects = $projects;
return $this;
}
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
$projects = $this->getAllProjects($manager);
$projects = $this->projects;
if (empty($projects)) {
$projects = $this->getAllProjects($manager);
}
$faker = Factory::create();
// random amount of timesheet entries for every user
for ($i = 0; $i < $this->amount; $i++) {
$project = null;
if (false === $this->isGlobal) {