123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <?php
- namespace PhpMyAdmin;
- class IndexColumn
- {
-
- private $_name = '';
-
- private $_seq_in_index = 1;
-
- private $_collation = null;
-
- private $_sub_part = null;
-
- private $_null = '';
-
- private $_cardinality = null;
-
- public function __construct(array $params = array())
- {
- $this->set($params);
- }
-
- public function set(array $params)
- {
- if (isset($params['Column_name'])) {
- $this->_name = $params['Column_name'];
- }
- if (isset($params['Seq_in_index'])) {
- $this->_seq_in_index = $params['Seq_in_index'];
- }
- if (isset($params['Collation'])) {
- $this->_collation = $params['Collation'];
- }
- if (isset($params['Cardinality'])) {
- $this->_cardinality = $params['Cardinality'];
- }
- if (isset($params['Sub_part'])) {
- $this->_sub_part = $params['Sub_part'];
- }
- if (isset($params['Null'])) {
- $this->_null = $params['Null'];
- }
- }
-
- public function getName()
- {
- return $this->_name;
- }
-
- public function getCollation()
- {
- return $this->_collation;
- }
-
- public function getCardinality()
- {
- return $this->_cardinality;
- }
-
- public function getNull($as_text = false)
- {
- if ($as_text) {
- if (!$this->_null || $this->_null == 'NO') {
- return __('No');
- }
- return __('Yes');
- }
- return $this->_null;
- }
-
- public function getSeqInIndex()
- {
- return $this->_seq_in_index;
- }
-
- public function getSubPart()
- {
- return $this->_sub_part;
- }
-
- public function getCompareData()
- {
- return array(
- 'Column_name' => $this->_name,
- 'Seq_in_index' => $this->_seq_in_index,
- 'Collation' => $this->_collation,
- 'Sub_part' => $this->_sub_part,
- 'Null' => $this->_null,
- );
- }
- }
|