<?php

namespace count_form\app\db;

class Entity extends Main
{
    private $props = array();
    private $instance;
    private $row;

    public function getInstance($name)
    {

            $class = 'count_form\app\\entity\\'.$name;

           /* $this->getEntity($name);*/

            $this->instance = new $class();


            /*$this->instance->props = $this->props;*/


            return $this->instance;

    }



    function setProperty($key, $val)
    {
        $this->props[$key] = $val;
    }

    public function getProperty($key)
    {
        return $this->props[$key];
    }


    /*function getEntity($name)
    {
        $sql = "SHOW COLUMNS FROM ".$name;

        $result = $this->db->query($sql);

        foreach($result->fetchAll(\PDO::FETCH_ASSOC) as $row){

            $this->setProperty($row['Field'],null);

        }

        return $this->row;
    }*/
}