CFWheels JSON Properties Plugin
The JSON properties plugin allows you to easily add structured data to a single database table field. You can easily store arrays and structures without the need for extra tables in your model.
The JSON properties plugin has a single initialization method that you must call in your model's
property- the model property the serialize and deserialize when interacting with the database.
type- possible values include
registerCallbacks- (defaults to
true) Whether or not this plugin should automatically add the
$serializePropertiescallbacks. Set this to false if you want to invoke them or register them yourself.
Once you have initialized your model, there is no extra work required to start using the functionality of this plugin.
How to Use
Simply add structure data to your JSON property. That's it!
The JSON proerties plugin works by adding callbacks to the initialized model to transparently serialize/deserialize complex data types into strings that can be stored in a database.
$deserializeJSONPropertiesis called on
$serializeJSONPropertiesis called on
The MIT License (MIT)
Copyright (c) 2015 Liquifusion Studios