Skip to content

Symfony

EqualTo and NotEqualTo resolve propertyPath from the field itself, so start from root to reach another field. In nested forms use parent[field_one].data.

$this->createFormBuilder()
->add('field_one')
->add('field_two', null, [
'constraints' => [
new NotEqualTo(propertyPath: 'root[field_one].data'),
],
])
->getForm();

In config/packages/framework.yaml, with the guest and host path mapping:

when@dev:
framework:
ide: 'phpstorm://open?file=%%f&line=%%l&/www/project.localhost/>/home/user/PhpstormProjects/project/'

See Framework: ide + PhpStorm URL Handler for the phpstorm:// links.

Only for the standalone Serializer component (the framework wires this itself):

$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
$normalizer = new ObjectNormalizer($classMetadataFactory);
  • state_machine: a transition has one input. In YAML, from: [a, b] is expanded into separate transitions.
  • workflow: from: [a, b] means both places are required. For “either of them”, add several transitions with the same name.

Workflow docs