|
- <?php
-
- namespace common\models;
-
- use Yii;
- use common\models\Commande ;
-
- /**
- * This is the model class for table "production".
- *
- * @property integer $id
- * @property string $date
- * @property integer $actif
- */
- class Production extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'production';
- }
-
- public function getEtablissement() {
- return $this->hasOne(Etablissement::className(), ['id'=>'id_etablissement']) ;
- }
-
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['date'], 'required'],
- [['date'], 'safe'],
- [['actif'], 'integer']
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'date' => 'Date',
- 'actif' => 'Actif',
- ];
- }
-
- public function getCommande()
- {
- return $this->hasMany(Commande::className(), ['id_production' => 'id']) ;
- }
-
-
- }
|