shivoham / value-object-form-bundle
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 2
Type:symfony-bundle
Requires
- symfony/config: ^3.1
- symfony/dependency-injection: ^3.1
- symfony/form: ^3.1
- symfony/http-kernel: ^3.1
This package is not auto-updated.
Last update: 2024-12-11 18:40:51 UTC
README
Usage
The Kebab model
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; // ... } }
The "POPO" Kebab identifier
class Identity { public $name; // ... }
The Kebab identifier form
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 ]);