<?php

namespace App\Geo\Zone;

use \App\Core\Template\Output as Output;
use \App\Geo\Zone\Classes\Zone as Zone;

class ZoneController {

    /**
    * Index
    *   Show the main Zone list
    */
    function index(){        
        $list = Array();

        for($i = 0; $i <= 10; $i++){
            $obj = Array();
            $obj['id'] = $i;
            $obj['value'] = md5($i);
            $obj['description'] = sha1($i);
            $list[] = $obj;
        }        
        Output::render('index', $list);
    }

    /**
    * Create
    *
    * Render the main Zone formulary
    */
    function create(){        
        Output::render('form', ['id' => 0]);
    }

    /**
    * Store
    *
    * Store the param on the database
    * @param Zone $zone
    */
    function store(Zone $zone){

    }

    /**
    * Search
    *
    * Store the param on the database
    * @param Zone $zone
    */
    function search(){
    
    }

    /**
    * Show
    *
    * Render one register
    *
    * @param Zone $zone
    */
    function show(Zone $zone){

    }

    /**
    * Edit
    *
    * Render the formular for a database Zone
    *
    * @param Zone $zone
    */
    function edit(Zone $zone){        
        Output::render('form', $zone);
    }

    /**
    * Update
    * Store the changes of the param on the database
    *
    * @param Zone $zone
    */
    function update(Zone $zone){

    }

    /**
    * Destroy
    * If the object has soft delete.
    *
    * @param Zone $zone
    */
    function destroy(Zone $zone){

    }

    /**
    * Purge
    * Remove object even with soft delete.
    *
    * @param Zone $zone
    */
    function purge(Zone $zone){

    }
}