mirror of
https://github.com/elyby/accounts.git
synced 2024-12-29 16:40:25 +05:30
43 lines
872 B
PHP
43 lines
872 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace common\models;
|
|
|
|
use yii\behaviors\TimestampBehavior;
|
|
use yii\db\ActiveQueryInterface;
|
|
use yii\db\ActiveRecord;
|
|
|
|
/**
|
|
* Fields:
|
|
* @property int $id
|
|
* @property string $url
|
|
* @property string|null $secret
|
|
* @property int $created_at
|
|
*
|
|
* Relations:
|
|
* @property WebHookEvent[] $events
|
|
*
|
|
* Behaviors:
|
|
* @mixin TimestampBehavior
|
|
*/
|
|
class WebHook extends ActiveRecord {
|
|
|
|
public static function tableName(): string {
|
|
return '{{%webhooks}}';
|
|
}
|
|
|
|
public function behaviors(): array {
|
|
return [
|
|
[
|
|
'class' => TimestampBehavior::class,
|
|
'updatedAtAttribute' => false,
|
|
],
|
|
];
|
|
}
|
|
|
|
public function getEvents(): ActiveQueryInterface {
|
|
return $this->hasMany(WebHookEvent::class, ['webhook_id' => 'id']);
|
|
}
|
|
|
|
}
|