| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace addons\StarChain\common\models;
- use Yii;
- /**
- * This is the model class for table "{{%addons_star_chain_express}}".
- *
- * @property int $id
- * @property int $express_id
- * @property string $name
- * @property string $code
- */
- class Express extends BaseModel
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_star_chain_express}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['express_id'], 'integer'],
- [['name', 'code'], 'string', 'max' => 64],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'express_id' => 'Express ID',
- 'name' => 'Name',
- 'code' => 'Code',
- ];
- }
- /**
- * @param string $code
- * @return static|null
- */
- public static function getExpressByCode(string $code)
- {
- return static::find()->where(['code' => $code])->one();
- }
- }
|