|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?php
-
-
-
- namespace common\models;
-
- use common\components\ActiveRecordCommon;
- use Yii;
-
-
- class DeliveryNote extends Document
- {
-
-
-
- public static function tableName()
- {
- return 'delivery_note';
- }
-
-
-
- public function rules()
- {
- return [
- [['date'], 'safe'],
- [['comment', 'address'], 'string'],
- [['id_user'], 'integer'],
- [['name', 'reference', 'city', 'postcode'], 'string', 'max' => 255],
- ];
- }
-
-
-
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'name' => 'Nom',
- 'reference' => 'Référence',
- 'date' => 'Date',
- 'comment' => 'Commentaire',
- 'id_user' => 'Utilisateur',
- 'address' => 'Adresse',
- 'city' => 'Ville',
- 'postcode' => 'Code postale',
- ];
- }
-
-
-
-
- public function getOrders()
- {
- return $this->relationOrders('id_delivery_note') ;
- }
-
-
-
- public static function defaultOptionsSearch()
- {
- return [
- 'with' => [],
- 'join_with' => ['user AS user_delivery_note', 'orders'],
- 'orderby' => 'date ASC',
- 'attribute_id_producer' => ''
- ];
- }
-
- }
|