I'm new to module development and I'm wondering where I would save data inputted from the user for my custom field. I have my own databases table structure so I'll be doing my own sql queries, but I'm really unsure how and where I can actually get the input information when the user hits the submit button. Is it in the hook_widget for the submit operation? If that's the case, when I save something and print out the contents of $field and $items, I don't get anything returned from those arrays so I don't know how to access the data being submitted. Is there an existing module I can refer to as an example?
This is what I have for my code so far. Basically I'm building a custom field for adding rows of ingredients, with 3 columns.
<?php
function ingredients_field_settings($op, $field) {
switch ($op) {
case 'form':
return form;
case 'callbacks':
return array(
'view' => CONTENT_CALLBACK_DEFAULT
);
}
}
function ingredients_field($op, &$node, $field, &$items, $teaser, $page) {
}
function ingredients_widget_info() {
$info = array(
'ingredients' => array(
'label' => t('Ingredients'),
'field types' => array('ingredients'),
),
);
return $info;
}
function ingredients_widget_settings($op, $widget) {