private function setValuesFromDatafields(array $source): array
    {
        $values = [];
        foreach ($this->datafields as $fieldname => $field) {
            $values[$fieldname] = $this->castValueWithCommonType(
                array_key_exists($fieldname, $source) ? $source[$fieldname] : null,
                $field['commontype']
            );
        }
        return $values;
    }
private function setValuesFromDatafields(array $source): array
    {
        $values = [];
        foreach ($this->datafields as $fieldname => $field) {
            $values[$fieldname] = $this->castValueWithCommonType(
                array_key_exists($fieldname, $source) ? $source[$fieldname] : null,
                $field['commontype']
            );
        }
        return $values;
    }
private function setValuesFromDatafields ( array $ source ) : array { $ values = [ ] ; foreach ( $ this -> datafields as $ fieldname => $ field ) { $ values [ $ fieldname ] = $ this -> castValueWithCommonType ( array_key_exists ( $ fieldname , $ source ) ? $ source [ $ fieldname ] : null , $ field [ 'commontype' ] ) ; } return $ values ; }
Internal function that returns an array with the content of all datafields
filled with the values casted

@param array $source
@return array
Internal function that returns an array with the content of all datafields filled with the values casted