⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

enum field type start from 1.



JesterRoberts
  • profile picture
  • Member

Posted 25 April 2013 - 14:59 PM

Can I have them enum field type start from 1 instead of 0?


davidoster
  • profile picture
  • Member

Posted 26 April 2013 - 08:00 AM

Where do you want to have this? On a MySQL table? Check this.

In PHP? Check this.


JesterRoberts
  • profile picture
  • Member

Posted 02 May 2013 - 01:20 AM

Well my question applies specifically to grocery crud.

I origionally had a table column for the day of the week being ant integer 1-7.

If I change field_type to enum in grocery crud then the days start at 0 which means I have to change alot of code elsewhere.

I'm guessing I would need to used a callback to add 1 to the selection??


davidoster
  • profile picture
  • Member

Posted 02 May 2013 - 07:10 AM

Well GC is PHP based so the limitations of PHP come along to GC as well.

Now in terms of having to change a lot of code... I am not sure what exactly you have implemented but this shouldn't be an issue if you follow the MVC approach.

The reason I am saying this is because you mentioned that you were having a table holding the days of the week.

Why don't you change just the model? Controller and view shouldn't be affected from this.