<?php

namespace App\Models;

use DB;
use Illuminate\Database\Eloquent\Model;

class Node extends Model
{
	
	public $table = 'node';
	public $timestamps = false;
	
    /*
     * Date: 28-08-2018
     * Author: Imran Khan
     * Parameter: data
     * Description:  this function will add record in node table
     */
    public static function Add($data)
    {
        $id = DB::table('node')->insertGetId($data);
        return $id;
    }
    /*
     * Date: 28-08-2018
     * Author: Imran Khan
     * Parameter: nid, fieldd
     * Description:  this function will return the selected journal node
     */
    public static function GetNode($nid)
    {
        $node = DB::table('node')->select('*')->where('nid', '=', $nid)->first();
        return $node;
    }

    /*
     * Date: 28-08-2018
     * Author: Imran Khan
     * Parameter: id
     * Description:  this function will delete the selected node
     */
    public static function DeleteNode($id)
    {
        DB::table('node')->where('nid', $id)->delete();

    }

}
