|
- <?php
-
-
-
- namespace domain\Feature\FeatureProducer;
-
- use common\components\ActiveRecordCommon;
- use domain\Feature\Feature\Feature;
- use domain\Producer\Producer\Producer;
- use yii\db\ActiveQuery;
-
- class FeatureProducer extends ActiveRecordCommon
- {
-
-
- public static function tableName()
- {
- return 'feature_producer';
- }
-
-
-
- public function rules()
- {
- return [
- [['id_producer', 'id_feature'], 'required'],
- [['status'], 'boolean'],
- ];
- }
-
-
-
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- ];
- }
-
- public function getProducer(): ActiveQuery
- {
- return $this->hasOne(Producer::class, ['id' => 'id_producer']);
- }
-
- public function populateProducer(Producer $producer): void
- {
- $this->populateFieldObject('id_producer', 'producer', $producer);
- }
-
- public function getFeature(): ActiveQuery
- {
- return $this->hasOne(Feature::class, ['id' => 'id_feature']);
- }
-
- public function populateFeature(Feature $feature): void
- {
- $this->populateFieldObject('id_feature', 'feature', $feature);
- }
- }
|