#include <record.h>
Public Member Functions | |
void | update () |
bool | operator== (const Record &other) const |
bool | operator!= (const Record &other) const |
void | save () |
void | set (std::string key, const char *s) |
void | set (std::string key, std::string value) |
void | set (std::string key, int value) |
void | set (std::string key, DateTime value) |
void | set (std::string key, bool value) |
void | get (std::string key, std::string &value, std::string alt) |
void | get (std::string key, std::string &value) |
void | get (std::string key, int &value, int alt) |
void | get (std::string key, int &value) |
void | get (std::string key, bool &value, bool alt) |
void | get (std::string key, bool &value) |
void | get (std::string key, DateTime &value, DateTime alt) |
void | get (std::string key, DateTime &value) |
void | del (std::string key) |
bool | isset (std::string colname) |
template<class T > | |
bool | isset () |
coltype | type (std::string colname) |
void | del () |
bool | has_been_saved () |
template<class T > | |
void | setOne (Record< T > &r) |
template<class T > | |
void | setMany (ObjGroup< T > og) |
template<class T > | |
void | del () |
template<class T > | |
void | getOne (T &record) |
template<class T > | |
ObjGroup< T > | getMany () |
Static Public Member Functions | |
static ObjGroup< Klass > | find (Q query) |
static ObjGroup< Klass > | all () |
static bool | exists (int id) |
static void | delete_all () |
Public Attributes | |
int | id |
std::string | classname |
Protected Member Functions | |
Record (int _id) |
All objects should extend Record. See the simple example in the examples folder to get started.
static ObjGroup<Klass> stactiverecord::Record< Klass >::all | ( | ) | [inline, static] |
Get all objects of type T
void stactiverecord::Record< Klass >::del | ( | ) | [inline] |
Delete Klass record
void stactiverecord::Record< Klass >::del | ( | std::string | key ) | [inline] |
Delete property with the given key name
Delete related record (one->one)
static void stactiverecord::Record< Klass >::delete_all | ( | ) | [inline, static] |
Delete all records of type Klass
static bool stactiverecord::Record< Klass >::exists | ( | int | id ) | [inline, static] |
Determine if a Klass with the given id exists
static ObjGroup<Klass> stactiverecord::Record< Klass >::find | ( | Q | query ) | [inline, static] |
Find all objects of type T that match a given query Q
ObjGroup<T> stactiverecord::Record< Klass >::getMany | ( | ) | [inline] |
Get related records (one->many)
void stactiverecord::Record< Klass >::getOne | ( | T & | record ) | [inline] |
Get related record (one->one)
bool stactiverecord::Record< Klass >::isset | ( | std::string | colname ) | [inline] |
Determine if a property is set
Determine if an object relation is set
void stactiverecord::Record< Klass >::save | ( | ) | [inline] |
Save record changes to DB. If there are no changes, nothing will be done.
void stactiverecord::Record< Klass >::setMany | ( | ObjGroup< T > | og ) | [inline] |
Assuming here that each member of og is of type T, set record relationship (one->many)
void stactiverecord::Record< Klass >::setOne | ( | Record< T > & | r ) | [inline] |
Assuming here that r is of type T, set record relationship (one->one)
coltype stactiverecord::Record< Klass >::type | ( | std::string | colname ) | [inline] |
Determine the column type for the given column. Return coltype if found, NONE if not found
void stactiverecord::Record< Klass >::update | ( | ) | [inline] |
Update properties of an object. Will overwrite any changes made since the object was created.