A PHP model and useful class for Morris.js project