option to move entries from one entity to another upon deletion (#409)
This commit is contained in:
@@ -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)'))
|
||||
|
||||
Reference in New Issue
Block a user