45 lines
974 B
PHP
45 lines
974 B
PHP
<?php
|
|
|
|
namespace common\models;
|
|
|
|
use yii\base\BaseObject;
|
|
|
|
/**
|
|
* @property \common\models\PropertyDefinition $definition
|
|
* @property \common\models\Property $property
|
|
*/
|
|
class PropertySetting extends BaseObject
|
|
{
|
|
|
|
public $definition;
|
|
public $property;
|
|
|
|
public function getValue(){
|
|
$value = null;
|
|
if ( isset($this->property)){
|
|
$value = $this->property->value;
|
|
}
|
|
return $value;
|
|
}
|
|
|
|
public function setValue($value){
|
|
|
|
// @property integer $id
|
|
// * @property integer $id_user
|
|
// * @property integer $id_property_definition
|
|
// * @property string $value
|
|
$this->property = new Property(
|
|
[
|
|
'id_user' => \Yii::$app->user->id,
|
|
'id_property_definition' => $this->definition->id,
|
|
'value' => $value
|
|
]
|
|
);
|
|
}
|
|
|
|
public function getLabel(){
|
|
return $this->definition->label;
|
|
}
|
|
|
|
}
|