12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace app\models\entity;
- use Yii;
- /**
- * This is the model class for table "tmc_warehouse".
- *
- * @property int $id
- * @property string $title
- * @property int $company
- * @property int $number
- */
- class Warehouse extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'tmc_warehouse';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['number', 'company'], 'integer'],
- [['title'], 'string', 'max' => 255],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'title' => 'Title',
- 'company' => 'ID company',
- 'number' => 'Number of warehouse',
- ];
- }
- /**
- * @return Companies|null
- */
- public function getCompany()
- {
- return Companies::findOne($this->company);
- }
- /**
- * @return Stack[]
- */
- public function getStacks()
- {
- return Stack::findAll(['warehouse' => $this->id]);
- }
- }
|