<?php

namespace App\Controllers\Owner;

use App\Controllers\BaseController;
use App\Models\ProductDrawingModel;
use App\Models\ProductModel;

class ProductDrawing extends BaseController
{
    protected $drawing;
    protected $product;

    public function __construct()
    {
        $this->drawing = new ProductDrawingModel();
        $this->product = new ProductModel();
    }

    public function index($id)
    {
        $data = [

            'product' => $this->product->find($id),

            'drawings' => $this->drawing
                            ->where('id_product',$id)
                            ->findAll()

        ];

        return view('owner/product/drawing',$data);

    }

}