For instance I'm writing a plugin which is going to be periodically pulling stuff from Twitter, so I'd like to keep a hold of when the plugin was last run and maybe some Ids relevant to Twitter that sort of thing.

I know there is the settings array which you use for user defined values, should I also use it for other stuff that the user can't change, or is there a more sensible place to stick those?

1 Answer
1

You could create a Record which will give you a custom table to store your twitter related settings and update them as needed but I think that your use case is still simple enough that you could leave them in the settings array and then use the Plugins Service to update those settings.

Thanks Selvin, Records was the piece of the puzzle I was missing. I do also want to keep a log of each run of the plugin, so I think in this instance a Record may make more sense. Your code will come in handy next time for instances where a Record is a little too much.
–
Steve HollandJun 20 '14 at 13:19

Thanks for adding the link to the docs for the record @Steve and yes, in that case you'll definitely need one. Craft makes it a joy to interact with the database via records and the query builder: )
–
Selvin OrtizJun 20 '14 at 13:33