| Total Complexity | 4 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class CustomerContactPhones extends Model |
||
| 8 | { |
||
| 9 | protected $fillable = ['cont_id', 'phone_type_id', 'phone_number', 'extension']; |
||
| 10 | protected $appends = ['type_icon', 'type_name', 'readable']; |
||
| 11 | |||
| 12 | // public function CustomerContacts() |
||
| 13 | // { |
||
| 14 | // return $this->hasMany('App\CustomerContacts', 'cont_id', 'cont_id'); |
||
| 15 | // } |
||
| 16 | |||
| 17 | public function getTypeIconAttribute() |
||
| 18 | { |
||
| 19 | return PhoneNumberTypes::find($this->phone_type_id)->icon_class; |
||
| 20 | } |
||
| 21 | |||
| 22 | public function getTypeNameAttribute() |
||
| 25 | } |
||
| 26 | |||
| 27 | public function getReadableAttribute() |
||
| 28 | { |
||
| 29 | return PhoneNumberTypes::readablePhoneNumber($this->phone_number); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function PhoneNumberTypes() |
||
| 35 | } |
||
| 36 | } |
||
| 37 |