HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_ORMContentType Class Reference

#include <UT_ORMContentType.h>

+ Inheritance diagram for UT_ORMContentType:

Classes

class  Meta
 

Public Member Functions

 UT_ORMContentType (const UT_ORMModelMeta &meta=metaInfo())
 
 UT_ORMContentType (const UT_StringHolder &ns, const UT_StringHolder &model)
 
void setModelName (const UT_StringHolder &name)
 
void setNamespace (const UT_StringHolder &ns)
 
int id () const
 
const UT_StringHoldercontentTypeNamespace () const
 
const UT_StringHoldermodelName () const
 
- Public Member Functions inherited from UT_ORMModel< UT_ORMContentType >
 UT_ORMModel (const UT_ORMModelMeta &meta=UT_ORMContentType::metaInfo())
 
 UT_ORMModel (const UT_ORMModel &)=default
 
virtual ~UT_ORMModel ()=default
 
UT_ORMModeloperator= (const UT_ORMModel &)=default
 
bool save (UT_ErrorCode &ec, bool force_insert=false, bool force_update=false)
 
void remove (UT_ErrorCode &ec)
 
const UT_ORMModelMetameta () const
 
- Public Member Functions inherited from UT_ORMBaseModel
bool isAdding_ () const
 

Static Public Member Functions

static UT_Optional
< UT_ORMContentType
findFromMeta (const UT_ORMModelMeta &meta, UT_ErrorCode &ec, const UT_StringHolder &ns="sidefx")
 
static UT_Optional
< UT_ORMContentType
findByNaturalKey (const UT_StringHolder &ns, const UT_StringHolder &table_name, UT_ErrorCode &ec)
 
- Static Public Member Functions inherited from UT_ORMModel< UT_ORMContentType >
static UT_Array
< UT_ORMContentType
fetch (const std::initializer_list< UT::orm::FilterArg > &args, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=UT_ORMContentType::metaInfo())
 
static UT_Optional
< UT_ORMContentType
fetch (const PK &pk, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=UT_ORMContentType::metaInfo())
 
static UT_Array
< UT_ORMContentType
fetchAll (UT_ErrorCode &ec, const UT_ORMModelMeta &meta=UT_ORMContentType::metaInfo())
 
static UT_Optional
< UT_ORMContentType
filter (std::initializer_list< UT::orm::FilterArg > &&args, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=UT_ORMContentType::metaInfo())
 
static std::pair
< UT_ORMContentType, bool > 
getOrCreate (const std::initializer_list< UT::orm::FilterArg > &args, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=UT_ORMContentType::metaInfo())
 
static UT_Optional
< UT_ORMContentType
create (const std::initializer_list< UT::orm::FilterArg > &args, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=UT_ORMContentType::metaInfo())
 
static UT_Array
< UT_ORMContentType
bulkFetch (const ArrayT &items, UT_ErrorCode &ec, const UT_StringRef &col_name=UT_StringHolder::theEmptyString, const UT_ORMModelMeta &meta=UT_ORMContentType::metaInfo())
 
static void bulkSave (const UT_Array< UT_ORMContentType > &items, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=UT_ORMContentType::metaInfo())
 
static UT_ORMContentType fromDB (Args &&...args)
 
static UT_ORMContentType fromDB (const UT_ORMModelMeta &meta, Args &&...args)
 
static bool exists (const std::initializer_list< UT::orm::FilterArg > &args, UT_ErrorCode &ec, const UT_ORMModelMeta &meta=UT_ORMContentType::metaInfo())
 

Additional Inherited Members

- Protected Attributes inherited from UT_ORMModel< UT_ORMContentType >
std::reference_wrapper< const
UT_ORMModelMeta
myModelMeta
 
- Protected Attributes inherited from UT_ORMBaseModel
bool myOrmAdding = true
 

Detailed Description

A simple mechanism to link models to unrelated concepts. When a model is added or removed a content-type is inserted. If you have a model that applies to another model indirectly this allows that model to be added/removed by the foreign key to this content type. It would also allow for backtracking as you could lookup the model from the content type. The primary purpose is to remove some of the admin work required to have two models indirectly related to each other.

Definition at line 28 of file UT_ORMContentType.h.

Constructor & Destructor Documentation

UT_ORMContentType::UT_ORMContentType ( const UT_ORMModelMeta meta = metaInfo())
inline

Definition at line 43 of file UT_ORMContentType.h.

UT_ORMContentType::UT_ORMContentType ( const UT_StringHolder ns,
const UT_StringHolder model 
)
inline

Definition at line 47 of file UT_ORMContentType.h.

Member Function Documentation

const UT_StringHolder& UT_ORMContentType::contentTypeNamespace ( ) const
inline

Definition at line 66 of file UT_ORMContentType.h.

static UT_Optional<UT_ORMContentType> UT_ORMContentType::findByNaturalKey ( const UT_StringHolder ns,
const UT_StringHolder table_name,
UT_ErrorCode ec 
)
inlinestatic

Definition at line 84 of file UT_ORMContentType.h.

static UT_Optional<UT_ORMContentType> UT_ORMContentType::findFromMeta ( const UT_ORMModelMeta meta,
UT_ErrorCode ec,
const UT_StringHolder ns = "sidefx" 
)
inlinestatic

Definition at line 75 of file UT_ORMContentType.h.

int UT_ORMContentType::id ( ) const
inline

Definition at line 61 of file UT_ORMContentType.h.

const UT_StringHolder& UT_ORMContentType::modelName ( ) const
inline

Definition at line 70 of file UT_ORMContentType.h.

void UT_ORMContentType::setModelName ( const UT_StringHolder name)
inline

Definition at line 52 of file UT_ORMContentType.h.

void UT_ORMContentType::setNamespace ( const UT_StringHolder ns)
inline

Definition at line 56 of file UT_ORMContentType.h.


The documentation for this class was generated from the following file: