option to move entries from one entity to another upon deletion (#409)

This commit is contained in:
Kevin Papst
2018-11-12 00:01:49 +01:00
committed by GitHub
parent 1dabeedaa0
commit f9dc42d1f9
18 changed files with 524 additions and 23 deletions

View File

@@ -25,6 +25,10 @@ class ProjectFixtures extends Fixture
* @var int
*/
protected $amount = 0;
/**
* @var bool
*/
protected $isVisible = null;
/**
* @return int
@@ -45,6 +49,17 @@ class ProjectFixtures extends Fixture
return $this;
}
/**
* @param bool $visible
* @return $this
*/
public function setIsVisible(bool $visible)
{
$this->isVisible = $visible;
return $this;
}
/**
* {@inheritdoc}
*/
@@ -55,6 +70,9 @@ class ProjectFixtures extends Fixture
for ($i = 0; $i < $this->amount; $i++) {
$visible = 0 != $i % 3;
if (null !== $this->isVisible) {
$visible = $this->isVisible;
}
$entity = new Project();
$entity
->setName($faker->catchPhrase . ($visible ? '' : ' (x)'))