59 lines
1.1 KiB
C#
59 lines
1.1 KiB
C#
using MySql.Data.MySqlClient;
|
|
using Pluralize.NET;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Articulate
|
|
{
|
|
public abstract class Model
|
|
{
|
|
protected virtual string Table => new Pluralizer().Pluralize(this.GetType().Name);
|
|
|
|
protected virtual string PrimaryKey => "id";
|
|
protected virtual MySqlDbType KeyType => MySqlDbType.Int32;
|
|
|
|
protected bool Incrementing = true;
|
|
|
|
protected bool Timestamps = false;
|
|
|
|
public Model()
|
|
{
|
|
}
|
|
|
|
public bool Insert()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public Model[] Get(params string[][] conditions)
|
|
{
|
|
string query = QueryBuilder.Select(this, conditions);
|
|
|
|
//DBConnection.Instance()
|
|
|
|
return null;
|
|
}
|
|
|
|
public string GetTable()
|
|
{
|
|
return Table;
|
|
}
|
|
|
|
public string GetPrimaryKey()
|
|
{
|
|
return PrimaryKey;
|
|
}
|
|
|
|
public MySqlDbType GetKeyType()
|
|
{
|
|
return KeyType;
|
|
}
|
|
|
|
public void Save()
|
|
{
|
|
//Insert into database;
|
|
}
|
|
}
|
|
}
|