add rfid_key to card and key

This commit is contained in:
2015-12-28 21:03:52 +01:00
parent f6b483a9f9
commit 3b2f19b909
18 changed files with 108 additions and 11 deletions

View File

@@ -39,6 +39,7 @@ class Key extends \yii\db\ActiveRecord
//[['created_at', 'updated_at'], 'required'],//kötelezőek
//[['created_at', 'updated_at'], 'safe'], //bármi lehet
[['number'], 'string', 'max' => 255],
[['rfid_key'], 'string', 'max' => 25],
[['number' ], 'unique'],
];
}
@@ -61,6 +62,7 @@ class Key extends \yii\db\ActiveRecord
return [
'id_key' => Yii::t('common/key', 'Id Key'),
'number' => Yii::t('common/key', 'Number'),
'rfid_key' => Yii::t('common/key', 'RFID key'),
'status' => Yii::t('common/key', 'Status'),
'type' => Yii::t('common/key', 'Type'),
'created_at' => Yii::t('common/key', 'Created At'),
@@ -80,5 +82,14 @@ class Key extends \yii\db\ActiveRecord
self::TYPE_NORMAL => Yii::t('common/key', 'Key'),
];
}
public function getHumanType(){
$result = "";
$types = self::types();
if ( array_key_exists($this->type, $types) ){
$result = $types[$this->type];
}
return $result;
}
}