/** * Конструктор * @param ActiveRecord $model модель * @param string $attr атрибут * @param string $relation имя Has One связи */ public function __construct(ActiveRecord $model, $attr, $relation, $config = []) { $this->relation = $relation; parent::__construct($model, $attr, $config); }