1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-25 05:58:21 +01:00
phorge-phorge/src/applications/multimeter/storage/MultimeterDimension.php

30 lines
660 B
PHP
Raw Normal View History

<?php
abstract class MultimeterDimension extends MultimeterDAO {
protected $name;
protected $nameHash;
public function setName($name) {
$this->nameHash = PhabricatorHash::digestForIndex($name);
return parent::setName($name);
}
protected function getConfiguration() {
return array(
self::CONFIG_TIMESTAMPS => false,
self::CONFIG_COLUMN_SCHEMA => array(
'name' => 'text',
'nameHash' => 'bytes12',
),
self::CONFIG_KEY_SCHEMA => array(
'key_hash' => array(
'columns' => array('nameHash'),
'unique' => true,
),
),
) + parent::getConfiguration();
}
}