|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?php
-
-
-
- namespace common\models;
-
- use common\components\ActiveRecordCommon ;
-
-
- class ProductPointSale extends ActiveRecordCommon
- {
-
-
- public static function tableName()
- {
- return 'product_point_sale';
- }
-
-
-
- public function rules()
- {
- return [
- [['id_product', 'id_point_sale'], 'required'],
- [['id_product', 'id_point_sale'], 'integer'],
- [['available'], 'boolean'],
- ];
- }
-
-
-
- public function attributeLabels()
- {
- return [
- 'id_product' => 'Produit',
- 'id_point_sale' => 'Point de vente',
- 'available' => 'Disponible',
- ];
- }
-
-
-
-
- public function getProduct()
- {
- return $this->hasOne(Product::className(), ['id' => 'id_product']);
- }
-
- public function getPointSale()
- {
- return $this->hasOne(PointSale::className(), ['id' => 'id_point_sale']);
- }
-
-
-
- public static function defaultOptionsSearch() {
- return [
- 'with' => ['product', 'pointSale'],
- 'join_with' => [],
- 'orderby' => '',
- 'attribute_id_producer' => ''
- ] ;
- }
- }
|