public function bindToProperty(string $name) : FormFieldBindingDefinition
    {
        if (!$this->field->getProcessedType()->isSubsetOf($this->class->getProperty($name)->getType())) {
            throw TypeMismatchException::format(
                    'Cannot bind property %s::$%s to field \'%s\': field type must be compatible with property type %s, %s given',
                    $this->class->getClassName(), $name, $this->field->getName(),
                    $this->class->getProperty($name)->getType()->asTypeString(), $this->field->getProcessedType()->asTypeString()
            );
        }

        return $this->bindTo(new FieldPropertyAccessor($this->class, $name));
    }
public function bindToProperty(string $name) : FormFieldBindingDefinition
    {
        if (!$this->field->getProcessedType()->isSubsetOf($this->class->getProperty($name)->getType())) {
            throw TypeMismatchException::format(
                    'Cannot bind property %s::$%s to field \'%s\': field type must be compatible with property type %s, %s given',
                    $this->class->getClassName(), $name, $this->field->getName(),
                    $this->class->getProperty($name)->getType()->asTypeString(), $this->field->getProcessedType()->asTypeString()
            );
        }

        return $this->bindTo(new FieldPropertyAccessor($this->class, $name));
    }
public function bindToProperty ( string $ name ) : FormFieldBindingDefinition { if ( ! $ this -> field -> getProcessedType ( ) -> isSubsetOf ( $ this -> class -> getProperty ( $ name ) -> getType ( ) ) ) { throw TypeMismatchException :: format ( 'Cannot bind property %s::$%s to field \'%s\': field type must be compatible with property type %s, %s given' , $ this -> class -> getClassName ( ) , $ name , $ this -> field -> getName ( ) , $ this -> class -> getProperty ( $ name ) -> getType ( ) -> asTypeString ( ) , $ this -> field -> getProcessedType ( ) -> asTypeString ( ) ) ; } return $ this -> bindTo ( new FieldPropertyAccessor ( $ this -> class , $ name ) ) ; }
Binds the field to the supplied property name.

@param string $name

@return FormFieldBindingDefinition
@throws TypeMismatchException
@throws InvalidArgumentException
Binds the field to the supplied property name .