Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402]
Extra information generated during the analysis by calculable elements.
Copyright: | 2019 David Monllao {@link http://www.davidmonllao.com} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 184 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
calculation_info:: (5 methods):
add_shared()
save()
pull_info()
get_data_key()
get_sample_key()
Class: calculation_info - X-Ref
Extra information generated during the analysis by calculable elements.add_shared(int $sampleid, array $info) X-Ref |
Adds info related to the current calculation for later use when generating insights. Note that the data in $info array is reused across multiple samples, if you want to add data just for this sample you can use the sample id as key. We store two different arrays so objects that appear multiple times for different samples appear just once in memory. param: int $sampleid The sample id this data is associated with param: array $info The data. Indexed by an id unique across the site. E.g. an activity id. return: null |
save(\core_analytics\calculable $calculable, \core_analytics\local\time_splitting\base $timesplitting,int $rangeindex) X-Ref |
Stores in MUC the previously added data and it associates it to the provided $calculable. param: \core_analytics\calculable $calculable param: \core_analytics\local\time_splitting\base $timesplitting param: int $rangeindex return: null |
pull_info(array $predictionrecords) X-Ref |
Pulls the info related to the provided records out from the cache. Note that this function purges 'calculablesinfo' cache. param: \stdClass[] $predictionrecords return: array|false |
get_data_key(string $calculableclass, $key) X-Ref |
Gets the key used to store data. param: string $calculableclass param: string|int $key return: string |
get_sample_key(string $uniquesampleid) X-Ref |
Gets the key used to store samples. param: string $uniquesampleid return: string |