Form.php
public function setData($entity)
    {
        if ($this->accessor == null) {
            $this->accessor = new PropertyAccessor;
        }

        foreach ($this->getFields() as $field) {
            if (is_object($field)) {
                if (($mapping = $field->getMappingName()) && !$field->readOnly()) {
                    if (is_array($entity)) {
                        if (isset($entity[$mapping])) {
                            $field->setValue($entity[$mapping], 1);
                        }
                    } else {
                        $value = $this->accessor->getValue($entity, $mapping);
                        $field->setValue($value, 1);
                    }
                }
            }
        }
    }
public function setData($entity)
    {
        if ($this->accessor == null) {
            $this->accessor = new PropertyAccessor;
        }

        foreach ($this->getFields() as $field) {
            if (is_object($field)) {
                if (($mapping = $field->getMappingName()) && !$field->readOnly()) {
                    if (is_array($entity)) {
                        if (isset($entity[$mapping])) {
                            $field->setValue($entity[$mapping], 1);
                        }
                    } else {
                        $value = $this->accessor->getValue($entity, $mapping);
                        $field->setValue($value, 1);
                    }
                }
            }
        }
    }
public function setData ( $ entity ) { if ( $ this -> accessor == null ) { $ this -> accessor = new PropertyAccessor ; } foreach ( $ this -> getFields ( ) as $ field ) { if ( is_object ( $ field ) ) { if ( ( $ mapping = $ field -> getMappingName ( ) ) && ! $ field -> readOnly ( ) ) { if ( is_array ( $ entity ) ) { if ( isset ( $ entity [ $ mapping ] ) ) { $ field -> setValue ( $ entity [ $ mapping ] , 1 ) ; } } else { $ value = $ this -> accessor -> getValue ( $ entity , $ mapping ) ; $ field -> setValue ( $ value , 1 ) ; } } } } }
Define the values using mapping
Define the values using mapping