12/06
2016
dev-master
9999999-dev
The Requires
by schevalier
class Kebab { private $name; public function getName() { return $this->name; } public function getIdentity() { return [ 'name' => $this->name, ]; } public function setIdentity(Identity $identity) { $this->name = $identity->name; // ... } }
class Identity { public $name; // ... }
use AppBundle\Form\Type\KebabIdentifierType; use AppBundle\Entity\Kebab; use AppBundle\Entity\Kebab\Identity; $this->createForm(KebabIdentifierType::CLASS, $kebab, [ 'object_accessor' => 'getIdentity', 'object_mutator' => 'setIdentity', 'value_object_class' => Identity::class ]);