fix folder name

This commit is contained in:
2021-03-18 13:37:13 +01:00
parent a2f6773f5a
commit eaa0ad925f
1578 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace Chill\MainBundle\Form\DataMapper;
use Chill\MainBundle\Entity\Scope;
use Symfony\Component\Form\DataMapperInterface;
use Symfony\Component\Form\FormInterface;
class ScopePickerDataMapper implements DataMapperInterface
{
/**
* @var \Chill\MainBundle\Entity\Scope
*/
private $scope;
public function __construct(Scope $scope = null)
{
$this->scope = $scope;
}
public function mapDataToForms($data, $forms)
{
$forms = iterator_to_array($forms);
if ($this->scope instanceof Scope) {
$forms['scope']->setData($this->scope);
return;
}
if (null === $data) {
return;
}
if ($data instanceof Scope) {
$forms['scope']->setData($data);
}
}
public function mapFormsToData($forms, &$data)
{
$forms = iterator_to_array($forms);
if (isset($forms['scope'])) {
if ($this->scope instanceof Scope) {
$data = $this->scope;
} else {
$data = $forms['scope']->getData();
}
}
}
}