public function prepareRelatedTableForPersist($field, $data)
    {
        // If the field is nullable, then having associated records is optional.
        if (
            ( ($data == "")   ||
                ($data == null) ||
                (!$data)        ||
                (empty($data)) )
            &&
            ($field['nullable'])
        )
        {
            $data = null;
        }

        return $data;
    }