Files
fmgapp/app/models/admin/AzureProcess.php

222 lines
3.9 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php declare(strict_types=1); namespace IR\App\Models\Admin; if (!defined('IR_START')) exit('<pre>No direct script access allowed</pre>');
/**
* @framework Wevads Framework
* @version 1.0
* @author H1 <h1@live.fi>
* @date 2019
* @name AzureProcess.php
*/
# orm
use IR\Orm\ActiveRecord as ActiveRecord;
# helpers
use IR\App\Helpers\AuditLog as AuditLog;
/**
* @name AzureProcess
* @description AzureProcess Model
*/
class AzureProcess extends ActiveRecord
{
/**
* @database
* @readwrite
*/
protected $_databaseKey = 'system';
/**
* @schema
* @readwrite
*/
protected $_schema = 'admin';
/**
* @table
* @readwrite
*/
protected $_table = 'azure_processes';
# columns
/**
* @column
* @readwrite
* @primary
* @indexed
* @autoincrement
* @type integer
* @nullable false
* @length
*/
protected $_id;
/**
* @column
* @readwrite
* @indexed
* @type text
* @nullable false
* @length 20
*/
protected $_status;
/**
* @column
* @readwrite
* @indexed
* @type text
* @nullable true
* @length 20
*/
protected $_process_id;
/**
* @column
* @readwrite
* @indexed
* @type integer
* @nullable false
* @length
*/
protected $_account_id;
/**
* @column
* @readwrite
* @type text
* @nullable false
* @length 100
*/
protected $_account_name;
/**
* @column
* @readwrite
* @type text
* @nullable false
* @length
*/
protected $_region;
/**
* @column
* @readwrite
* @type text
* @nullable false
* @length
*/
protected $_region_name;
/**
* @column
* @readwrite
* @type integer
* @nullable false
* @length
*/
protected $_nb_instances;
/**
* @column
* @readwrite
* @type integer
* @nullable false
* @length
*/
protected $_nb_private_ips;
/**
* @column
* @readwrite
* @type text
* @nullable false
* @length
*/
protected $_domains;
/**
* @column
* @readwrite
* @type text
* @nullable false
* @length 100
*/
protected $_instance_type;
/**
* @column
* @readwrite
* @type text
* @nullable false
* @length 10
*/
protected $_progress;
/**
* @column
* @readwrite
* @type integer
* @nullable true
* @length
*/
protected $_instances_created;
/**
* @column
* @readwrite
* @type integer
* @nullable true
* @length
*/
protected $_instances_installed;
/**
* @column
* @readwrite
* @type timestamp
* @nullable false
* @length
*/
protected $_start_time;
/**
* @column
* @readwrite
* @type timestamp
* @nullable true
* @length
*/
protected $_finish_time;
/**
* @name insert
* @description creates a record base on the primary key
* @access public
* @return integer
* @throws DatabaseException
*/
public function insert() : int
{
$this->_id = parent::insert();
# register audit log
AuditLog::registerLog($this->_id,'Azure Process','Instances Creation','Start');
return $this->_id;
}
/**
* @name delete
* @description creates a query object, only if the primary key property value is not empty, and executes the querys delete() method.
* @access public
* @return integer
*/
public function delete() : int
{
# register audit log
AuditLog::registerLog($this->_id,'Azure Process','Instances Termination','Delete');
return parent::delete();
}
}