protected function getChangedFields($obj)
    {
        $changedFields = $obj->getChangedFields(true, 2);
        foreach ($changedFields as $key => $value) {
            $changedFields[$key]['before'] = '(' . gettype($value['before']) . ') ' . $value['before'];
            $changedFields[$key]['after'] = '(' . gettype($value['after']) . ') ' . $value['after'];
            unset($changedFields[$key]['level']);
        }
        return $changedFields;
    }
protected function getChangedFields($obj)
    {
        $changedFields = $obj->getChangedFields(true, 2);
        foreach ($changedFields as $key => $value) {
            $changedFields[$key]['before'] = '(' . gettype($value['before']) . ') ' . $value['before'];
            $changedFields[$key]['after'] = '(' . gettype($value['after']) . ') ' . $value['after'];
            unset($changedFields[$key]['level']);
        }
        return $changedFields;
    }
protected function getChangedFields ( $ obj ) { $ changedFields = $ obj -> getChangedFields ( true , 2 ) ; foreach ( $ changedFields as $ key => $ value ) { $ changedFields [ $ key ] [ 'before' ] = '(' . gettype ( $ value [ 'before' ] ) . ') ' . $ value [ 'before' ] ; $ changedFields [ $ key ] [ 'after' ] = '(' . gettype ( $ value [ 'after' ] ) . ') ' . $ value [ 'after' ] ; unset ( $ changedFields [ $ key ] [ 'level' ] ) ; } return $ changedFields ; }
Modelled on the getChangedFields of DataObject, with the addition of the variable's type
@param \SilverStripe\ORM\DataObject $obj
@return array The before/after changes of each field
Modelled on the getChangedFields of DataObject with the addition of the variable s type