| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "{{%organizations}}".
- *
- * @property int $id
- * @property string $name
- * @property string|null $short_name
- * @property int|null $vat
- * @property int|null $edrpou
- * @property string|null $address_1
- * @property string|null $address_2
- * @property string|null $address_3
- * @property string|null $comment
- * @property int|null $bank_id
- * @property int|null $person_id
- * @property int|null $created_at
- * @property int|null $updated_at
- * @property int|null $deleted_at
- *
- * @property Persons[] $persons
- */
- class Organizations extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%organizations}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['name'], 'required'],
- [['vat', 'edrpou', 'bank_id', 'person_id', 'created_at', 'updated_at', 'deleted_at'], 'integer'],
- [['comment'], 'string'],
- [['name', 'short_name', 'address_1', 'address_2', 'address_3'], 'string', 'max' => 191],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'name' => 'Name',
- 'short_name' => 'Short Name',
- 'vat' => 'Vat',
- 'edrpou' => 'Edrpou',
- 'address_1' => 'Address 1',
- 'address_2' => 'Address 2',
- 'address_3' => 'Address 3',
- 'comment' => 'Comment',
- 'bank_id' => 'Bank ID',
- 'person_id' => 'Person ID',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- 'deleted_at' => 'Deleted At',
- ];
- }
- /**
- * Gets query for [[Persons]].
- *
- * @return \yii\db\ActiveQuery|PersonsQuery
- */
- public function getPersons()
- {
- return $this->hasMany(Persons::className(), ['org_id' => 'id'])->inverseOf('org');
- }
- /**
- * {@inheritdoc}
- * @return OrganizationsQuery the active query used by this AR class.
- */
- public static function find()
- {
- return new OrganizationsQuery(get_called_class());
- }
- }
|