add property and property definition

This commit is contained in:
Roland Schneider
2021-10-11 22:32:43 +02:00
parent a2c828cc19
commit e6d4d0ffc4
13 changed files with 604 additions and 1 deletions

View File

@@ -0,0 +1,44 @@
<?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;
}
}