mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-07 07:47:24 +01:00
44 lines
836 B
PHP
44 lines
836 B
PHP
<?php
|
|
|
|
/**
|
|
* @link https://www.yiiframework.com/
|
|
* @copyright Copyright (c) 2008 Yii Software LLC
|
|
* @license https://www.yiiframework.com/license/
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace yiiunit\data\ar;
|
|
|
|
use ReflectionClass;
|
|
|
|
/**
|
|
* ProfileWithConstructor.
|
|
*
|
|
* @property int $id
|
|
* @property string $description
|
|
*/
|
|
class ProfileWithConstructor extends ActiveRecord
|
|
{
|
|
public static function tableName()
|
|
{
|
|
return 'profile';
|
|
}
|
|
|
|
public function __construct($description)
|
|
{
|
|
$this->description = $description;
|
|
parent::__construct();
|
|
}
|
|
|
|
public static function instance($refresh = false)
|
|
{
|
|
return self::instantiate([]);
|
|
}
|
|
|
|
public static function instantiate($row)
|
|
{
|
|
return (new ReflectionClass(static::class))->newInstanceWithoutConstructor();
|
|
}
|
|
}
|