<?php

namespace App\Common\Defaults;

use \App\Core\Template\Output as Output;
use \App\Common\Defaults\Classes\Defaults as Defaults;

class DefaultsController {

    /**
    * Index
    *   Show the main Defaults list
    */
    function index(){
        Output::setView('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::addValue('list', $list );
        Output::render();
    }

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

    /**
    * Store
    *
    * Store the param on the database
    * @param Defaults $defaults
    */
    function store(Defaults $defaults){

    }

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

    /**
    * Show
    *
    * Render one register
    *
    * @param Defaults $defaults
    */
    function show(Defaults $defaults){

    }

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

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

    }

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

    }

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

    }
}