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

177 lines
3.3 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 2021
* @name AzureAccountProcess.php
*/
# orm
use IR\Orm\ActiveRecord as ActiveRecord;
# helpers
use IR\App\Helpers\AuditLog as AuditLog;
/**
* @name AzureAccountProcess
* @description AzureAccountProcess Model
*/
class AzureAccountProcess extends ActiveRecord
{
/**
* @database
* @readwrite
*/
protected $_databaseKey = 'system';
/**
* @schema
* @readwrite
*/
protected $_schema = 'admin';
/**
* @table
* @readwrite
*/
protected $_table = 'azure_accounts_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 100
*/
protected $_regions;
/**
* @column
* @readwrite
* @type text
* @nullable false
* @length 100
*/
protected $_process_type;
/**
* @column
* @readwrite
* @type text
* @nullable false
* @length 100
*/
protected $_processtime_unit;
/**
* @column
* @readwrite
* @type text
* @nullable false
* @length 100
*/
protected $_processtime_value;
/**
* @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 Account Process',$this->_process_type,'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 Account Process',$this->_process_type,'Stop');
return parent::delete();
}
}