I am trying to create a fieldtype that requires comparison to it's previous data. Any idea how to get this data in the save()
function? I tried using $this->field_data
but that just returns the "new" data submitted to the form.
To provide a tangible example, what I am trying to do is take the prior data and store it with the new data as an array so my save()
function looks like this (if $this->field_data worked this should have):
function save($data)
{
if (!empty($this->field_data)) $data = json_decode($this->field_data, TRUE);
$data[] = $data;
return json_encode($data);
}