|
@@ -0,0 +1,68 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace reactlogic\referral\models;
|
|
|
+
|
|
|
+use Yii;
|
|
|
+
|
|
|
+/**
|
|
|
+ * This is the model class for table "referral_link".
|
|
|
+ *
|
|
|
+ * @property int $id
|
|
|
+ * @property string $title
|
|
|
+ * @property string $source
|
|
|
+ * @property string|null $link
|
|
|
+ * @property string|null $link_hash
|
|
|
+ * @property int $clicks
|
|
|
+ * @property int $registrations
|
|
|
+ * @property int|null $owner
|
|
|
+ */
|
|
|
+class ReferralLink extends \yii\db\ActiveRecord
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ */
|
|
|
+ public static function tableName()
|
|
|
+ {
|
|
|
+ return 'referral_link';
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ */
|
|
|
+ public function rules()
|
|
|
+ {
|
|
|
+ return [
|
|
|
+ [['title', 'source', 'clicks', 'registrations'], 'required'],
|
|
|
+ [['link'], 'string'],
|
|
|
+ [['clicks', 'registrations', 'owner'], 'integer'],
|
|
|
+ [['title', 'source', 'link_hash'], 'string', 'max' => 191],
|
|
|
+ [['link_hash'], 'unique'],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ */
|
|
|
+ public function attributeLabels()
|
|
|
+ {
|
|
|
+ return [
|
|
|
+ 'id' => Yii::t('app', 'ID'),
|
|
|
+ 'title' => Yii::t('app', 'Title'),
|
|
|
+ 'source' => Yii::t('app', 'Source'),
|
|
|
+ 'link' => Yii::t('app', 'Link'),
|
|
|
+ 'link_hash' => Yii::t('app', 'Link Hash'),
|
|
|
+ 'clicks' => Yii::t('app', 'Clicks'),
|
|
|
+ 'registrations' => Yii::t('app', 'Registrations'),
|
|
|
+ 'owner' => Yii::t('app', 'Owner'),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ * @return ReferralLinkQuery the active query used by this AR class.
|
|
|
+ */
|
|
|
+ public static function find()
|
|
|
+ {
|
|
|
+ return new ReferralLinkQuery(get_called_class());
|
|
|
+ }
|
|
|
+}
|