<?php
namespace App\Repositories;

use App\Models\MakeAndModel;
use App\Models\TechnicalSpecs as TechnicalSpecsModel;

class TechnicalSpecs
{

	public function getTechnicalSpecsFilter($assettypeid = null, $type = null)
	{
		$query = TechnicalSpecsModel::with('makeAndModel');

		if($type == 'it') {
		    $query = $query->getIT();
		}

		if($type == 'avassets') {
			$query = $query->getAv();
		}

		if($type == 'mobile') {
			$query = $query->getMobile();
		}

		if($assettypeid == null) {
			return $query->active();
		}

		return $query->getTechnicalSpecsFromModels($assettypeid);
	}
}