You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virt/web/app/Models/CloudRescueTemplateReplica.php

38 lines
1.1 KiB
PHP

<?php
namespace App\Models;
/** Host-local exact rescue ISO copy and retirement cleanup debt. */
final class CloudRescueTemplateReplica extends Model
{
protected $connection = 'default';
protected $table = 'cloud_rescue_template_replicas';
public $incrementing = false;
protected $primaryKey = 'template_id';
protected $keyType = 'string';
protected $casts = [
'host_id' => 'int',
'revision' => 'int',
'size_bytes' => 'int',
'job_id' => 'int',
'observed_revision' => 'int',
'observed_size_bytes' => 'int',
'last_verified_at' => 'int',
'cleanup_resolved_at' => 'int',
'created_at' => 'int',
'updated_at' => 'int',
];
/** Eloquent has no native composite-key support; scope every update. */
protected function setKeysForSaveQuery($query)
{
return $query
->where('host_id', '=', (int) $this->getAttribute('host_id'))
->where(
'template_id',
'=',
(string) $this->getAttribute('template_id')
);
}
}