<?php

namespace App\Models;

# use Illuminate\Database\Eloquent\Model;

class ClientInfoLine extends Model
{
    protected $table = 'client_info_line';

    public function createdBySession() {
        return $this->hasOne(AppSession::class, 'id', 'created_by_session_id');
    }

    public function contentDetail($prop = null) {
        $x = json_decode($this->content_detail);
	if(!$prop){        
		return $x;	
	}else{
		$x = json_decode($this->content_detail, true);
		if(isset($x[$prop])){
			return $x[$prop];
		}else{
			return '';
		}
	}
    }
}
