Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Record.php « ArchiveProcessing « modules - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2dba870d19a1f8f77b7437f56079f851f97175ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
 * Piwik - Open source web analytics
 * 
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
 * @version $Id$
 * 
 * @package Piwik_ArchiveProcessing
 */

require_once "ArchiveProcessing/Record/Blob.php";
require_once "ArchiveProcessing/Record/BlobArray.php";
require_once "ArchiveProcessing/Record/Numeric.php";
require_once "ArchiveProcessing/Record/Manager.php";


/**
 * A Record is a tuple (name, value) to be saved in the database.
 * At its creation, the record registers itself to the RecordManager. 
 * The record will then be automatically saved in the DB once the Archiving process is finished. 
 * 
 * We have two record types available:
 * - numeric ; the value will be saved as float in the DB.
 * 	 It should be used for INTEGER, FLOAT
 * - blob ; the value will be saved in a binary field in the DB
 * 	 It should be used for all the other types: PHP variables, STRING, serialized OBJECTS or ARRAYS, etc.
 * 
 * @package Piwik_ArchiveProcessing
 * @subpackage Piwik_ArchiveProcessing_Record
 */
abstract class Piwik_ArchiveProcessing_Record
{
	public $name;
	public $value;
	
	function __construct( $name, $value)
	{
		$this->name = $name;
		$this->value = $value;
		Piwik_ArchiveProcessing_Record_Manager::getInstance()->registerRecord($this);
	}
	
	public function delete()
	{
		Piwik_ArchiveProcessing_Record_Manager::getInstance()->unregister($this);
	}
	
	public function __destruct()
	{
	}
}