Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (45 sloc) 1.1 KB
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\records;
use craft\db\ActiveRecord;
use craft\db\Table;
use yii\db\ActiveQueryInterface;
/**
* Class Widget record.
*
* @property int $id ID
* @property int $userId User ID
* @property string $type Type
* @property int $sortOrder Sort order
* @property int $colspan Colspan
* @property array $settings Settings
* @property User $user User
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 3.0
*/
class Widget extends ActiveRecord
{
// Public Methods
// =========================================================================
/**
* @inheritdoc
* @return string
*/
public static function tableName(): string
{
return Table::WIDGETS;
}
/**
* Returns the widget’s user.
*
* @return ActiveQueryInterface The relational query object.
*/
public function getUser(): ActiveQueryInterface
{
return $this->hasOne(User::class, ['id' => 'userId']);
}
}
You can’t perform that action at this time.