First of all I want to thank you for your great job. It helps me to save a lot of time.
I've several questions related to groceryCRUD.
1. I try to use a primary key which is not in INT data type. I use user_name as a primary key of table_user. I've successfully add a user, but when I click "edit" (a link that appear after I insert new data), It showed error. I guess it is related to "auto increment" (Maybe you assume that all primary key should be integer and auto increment). It is not a big problem since I can change my table structure so that each table will have "auto increment primary key". The question is: Is it right that current groceryCRUD version only support "auto increment primary key"?
2. I also try to make a navigation table which is used as "tree structure" representation.
table_navigation(id, parent_id, is_root, title, url)
"parent_id" is a foreign key to "id", and it is allowed to be null.
I use before_insert and before_update callback, both are directed to before_insert_or_update_navigation function.
public function before_insert_or_update_navigation($post_array){
if($post_array['is_root']==1){
unset($post_array['parent_id']); //this doesn't work, there is no change for the value of parent_id
$post_array['parent_id'] = NULL; //doesn't work as above
$post_array['parent_id'] = ''; //doesn't work, produce error
}
return $post_array;
}
Is that any way to do what I want correctly?
thank you in advance
goFrendiAsgard;