Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "clients".
- *
- * @property int $id
- * @property string $name
- * @property string $email
- * @property string $address
- * @property string $profession
- * @property string $created_date
- * @property string $updated_date
- */
- class Clients extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'clients';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['name', 'email', 'address', 'profession', 'created_date', 'updated_date'], 'required'],
- [['address'], 'string'],
- [['created_date', 'updated_date'], 'safe'],
- [['name', 'email', 'profession'], 'string', 'max' => 255],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'name' => 'Name',
- 'email' => 'Email',
- 'address' => 'Address',
- 'profession' => 'Profession',
- 'created_date' => 'Created Date',
- 'updated_date' => 'Updated Date',
- ];
- }
- public function getTransactions()
- {
- return $this->hasMany(Transactions::class, ['client_id'=> 'id']);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment