| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "Red".
- *
- * @property int $idEvento
- * @property string|null $key
- * @property string $url
- * @property string|null $redSocial
- *
- * @property Evento $evento
- */
- class Red extends \yii\db\ActiveRecord {
- /**
- * {@inheritdoc}
- */
- public static function tableName() {
- return 'Red';
- }
- /**
- * {@inheritdoc}
- */
- public function rules() {
- return [
- [['idEvento', 'url'], 'required'],
- [['idEvento'], 'default', 'value' => null],
- [['idEvento'], 'integer'],
- [['key'], 'string', 'max' => 50],
- [['url'], 'string', 'max' => 500],
- [['redSocial'], 'string', 'max' => 250],
- [['idEvento', 'url'], 'unique', 'targetAttribute' => ['idEvento', 'url']],
- [['idEvento'], 'exist', 'skipOnError' => true, 'targetClass' => Evento::class, 'targetAttribute' => ['idEvento' => 'id']],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels() {
- return [
- 'idEvento' => 'Id Evento',
- 'key' => 'Key',
- 'url' => 'Url',
- 'redSocial' => 'Red Social',
- ];
- }
- /**
- * Gets query for [[evento]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getEvento() {
- return $this->hasOne(Evento::class, ['id' => 'idEvento']);
- }
- }
|