|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?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);
- }
- }
|