Base\Base::createItem PHP Method

createItem() public method

public createItem ( string $table, array $Data ) : integer
$table string
$Data array
return integer
    function createItem($table, array $Data)
    {
        $statement = "INSERT INTO `{$table}` SET";
        $parameters = array();
        foreach ($Data as $name => $value) {
            $statement .= " `{$name}` = ?,";
            $parameters[] = $value;
        }
        $statement = substr($statement, 0, -1);
        $this->execute($statement, $parameters);
        $lastId = $this->lastId();
        return $lastId;
    }