php-kitchen/yii2-domain

View on GitHub
docs/examples/user/ProfileRecord.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace PHPKitchen\Examples\User;

use PHPKitchen\Domain\DB\Record;

/**
 * Represents user profile record in the DB.
 *
 * Attributes:
 *
 * @property int $fullName
 * @property int $dateOfBirth
 *
 * @package PHPKitchen\Examples\User
 * @author Dmitry Kolodko <prowwid@gmail.com>
 */
class ProfileRecord extends Record {
    /**
     * @override
     * @inheritdoc
     */
    public static function tableName() {
        return 'UserProfile';
    }

    /**
     * @override
     * @inheritdoc
     */
    public function rules() {
        return [
            [
                [
                    'id',
                    'userId',
                    'fullName',
                    'dateOfBirth',
                ],
                'required',
            ],
        ];
    }
}