<?php
// This class was automatically generated by a giiant build task
// You should not change it manually as it will be overwritten on next build

namespace onespace\tools\rabbit\models\base;

use Yii;
use yii\helpers\ArrayHelper;

/**
 * This is the base-model class for table "rabbit_outbox".
 *
 * @property integer $id
 * @property string $exchange
 * @property resource $message
 * @property string $routingKey
 * @property array $headers
 * @property integer $timestamp
 * @property string $contentType
 * @property integer $persistent
 * @property integer $priority
 * @property string $ttl
 */
abstract class RabbitOutbox extends \yii\db\ActiveRecord
{

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'rabbit_outbox';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        $parentRules = parent::rules();
        return ArrayHelper::merge($parentRules, [
            [['routingKey', 'headers', 'timestamp', 'priority', 'ttl'], 'default', 'value' => null],
            [['contentType'], 'default', 'value' => 'application/json'],
            [['persistent'], 'default', 'value' => 1],
            [['exchange', 'message'], 'required'],
            [['message'], 'string'],
            [['headers'], 'safe'],
            [['timestamp', 'persistent', 'priority', 'ttl'], 'integer'],
            [['exchange', 'routingKey'], 'string', 'max' => 1024],
            [['contentType'], 'string', 'max' => 125]
        ]);
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return ArrayHelper::merge(parent::attributeLabels(), [
            'id' => 'ID',
            'exchange' => 'Exchange',
            'message' => 'Message',
            'routingKey' => 'Routing Key',
            'headers' => 'Headers',
            'timestamp' => 'Timestamp',
            'contentType' => 'Content Type',
            'persistent' => 'Persistent',
            'priority' => 'Priority',
            'ttl' => 'Ttl',
        ]);
    }

}
