Translated using Weblate (Slovenian)
[phpmyadmin.git] / libraries / SubPartition.php
blobfda338ceecbc1d054022abf0eeec3fb681a2533a
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Library for extracting information about the sub-partitions
6 * @package PhpMyAdmin
7 */
8 namespace PMA\libraries;
10 /**
11 * Represents a sub partition of a table
13 * @package PhpMyAdmin
15 class SubPartition
17 /**
18 * @var string the database
20 protected $db;
21 /**
22 * @var string the table
24 protected $table;
25 /**
26 * @var string partition name
28 protected $name;
29 /**
30 * @var integer ordinal
32 protected $ordinal;
33 /**
34 * @var string partition method
36 protected $method;
37 /**
38 * @var string partition expression
40 protected $expression;
41 /**
42 * @var integer no of table rows in the partition
44 protected $rows;
45 /**
46 * @var integer data length
48 protected $dataLength;
49 /**
50 * @var integer index length
52 protected $indexLength;
53 /**
54 * @var string partition comment
56 protected $comment;
58 /**
59 * Constructs a partition
61 * @param array $row fetched row from information_schema.PARTITIONS
63 public function __construct($row)
65 $this->db = $row['TABLE_SCHEMA'];
66 $this->table = $row['TABLE_NAME'];
67 $this->loadData($row);
70 /**
71 * Loads data from the fetched row from information_schema.PARTITIONS
73 * @param array $row fetched row
75 * @return void
77 protected function loadData($row)
79 $this->name = $row['SUBPARTITION_NAME'];
80 $this->ordinal = $row['SUBPARTITION_ORDINAL_POSITION'];
81 $this->method = $row['SUBPARTITION_METHOD'];
82 $this->expression = $row['SUBPARTITION_EXPRESSION'];
83 $this->loadCommonData($row);
86 /**
87 * Loads some data that is common to both partitions and sub partitions
89 * @param array $row fetched row
91 * @return void
93 protected function loadCommonData($row)
95 $this->rows = $row['TABLE_ROWS'];
96 $this->dataLength = $row['DATA_LENGTH'];
97 $this->indexLength = $row['INDEX_LENGTH'];
98 $this->comment = $row['PARTITION_COMMENT'];
102 * Return the partition name
104 * @return string partition name
106 public function getName()
108 return $this->name;
112 * Return the ordinal of the partition
114 * @return number the ordinal
116 public function getOrdinal()
118 return $this->ordinal;
122 * Returns the partition method
124 * @return string partition method
126 public function getMethod()
128 return $this->method;
132 * Returns the partition expression
134 * @return string partition expression
136 public function getExpression()
138 return $this->expression;
142 * Returns the number of data rows
144 * @return integer number of rows
146 public function getRows()
148 return $this->rows;
152 * Returns the data length
154 * @return integer data length
156 public function getDataLength()
158 return $this->dataLength;
162 * Returns the index length
164 * @return integer index length
166 public function getIndexLength()
168 return $this->indexLength;
172 * Returns the partition comment
174 * @return string partition comment
176 public function getComment()
178 return $this->comment;