mirror of
https://github.com/janickiy/yii2-nomer
synced 2025-03-09 15:39:59 +00:00
add files to project
This commit is contained in:
commit
5cac498444
3729 changed files with 836998 additions and 0 deletions
60
models/Call.php
Normal file
60
models/Call.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
namespace app\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "calls".
|
||||
*
|
||||
* @property integer $id
|
||||
* @property string $tm
|
||||
* @property string $cuid
|
||||
* @property integer $duration
|
||||
* @property string $status
|
||||
* @property integer $phone
|
||||
* @property Organization $organization
|
||||
*/
|
||||
class Call extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'calls';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['tm'], 'safe'],
|
||||
[['duration', 'phone'], 'integer'],
|
||||
[['cuid', 'status'], 'string', 'max' => 255],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'tm' => 'Tm',
|
||||
'cuid' => 'Cuid',
|
||||
'duration' => 'Duration',
|
||||
'status' => 'Status',
|
||||
'phone' => 'Phone',
|
||||
];
|
||||
}
|
||||
|
||||
public function getOrganization()
|
||||
{
|
||||
return $this->hasOne(Organization::className(), ['id' => 'org_id'])
|
||||
->viaTable(OrganizationPhone::tableName(), ['phone2' => 'phone']);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue