objective-c-sql-query-builder
Public Member Functions | Static Public Member Functions | Protected Attributes | Properties
ZIMOrmModel Class Reference

#import <ZIMOrmModel.h>

Inheritance diagram for ZIMOrmModel:
<ZIMOrmModelDelegate>

List of all members.

Public Member Functions

(id) - initWithDelegate:
(id) - init
(id) - belongsTo:foreignKey:
(id) - hasOne:foreignKey:
(NSArray *) - hasMany:foreignKey:
(NSArray *) - hasMany:foreignKey:options:
(void) - delete
(void) - load
(void) - save
(NSString *) - hashCode [implementation]

Static Public Member Functions

(NSString *) + dataSource
(NSString *) + table
(NSArray *) + primaryKey
(BOOL) + isAutoIncremented
(NSDictionary *) + columns
(BOOL) + isSaveable
(BOOL) + isModel:

Protected Attributes

id __unsafe_unretained _delegate
NSString_saved

Properties

id delegate

Detailed Description

Discussion:
This class acts as the base model.
Updated:
2011-10-19

Member Function Documentation

- (id) belongsTo: (Class)  model
foreignKey: (NSArray *)  foreignKey 
Signature:
belongsTo:foreignKey:
Discussion:
This method uses the values stored in the foreign key columns of the current instance (i.e "self") to find a record in another table by comparing them against that foreign table's primary key columns.
Parameters:
modelThe model type to be loaded.
foreignKeyAn array of columns in the current instance that define the foreign key to be used. The order of the columns matters (i.e. columns must be placed in the same order as model's primary key).
Returns:
Returns a model of the specified class.
Updated:
2011-10-19
+ (NSDictionary *) columns
Signature:
columns
Discussion:
This method will return the table name associated with this class.
Returns:
A list of name/type pairs.
Updated:
2012-03-25
See also:
http://stackoverflow.com/questions/1213901/how-do-i-list-all-instance-variables-of-a-class-in-objective-c
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html
+ (NSString *) dataSource
Signature:
dataSource
Discussion:
This method will return the name of the data source (DSN).
Returns:
The file name of the database to be used.
Updated:
2012-03-10
- (void) delete
Signature:
delete
Discussion:
This method deletes the record matching the primary key.
Updated:
2011-10-23
- (NSString *) hashCode [implementation]
- (NSArray *) hasMany: (Class)  model
foreignKey: (NSArray *)  foreignKey 
Signature:
hasMany:foreignKey:
Discussion:
This method uses the values stored in the primary key columns of the current instance (i.e "self") to find a set of records in another table by comparing them against that table's foreign key columns.
Parameters:
modelThe model type to be loaded.
foreignKeyAn array of columns in the specified model that define the foreign key to be used. The order of the columns matters (i.e. columns must be placed in the same order as self's primary key).
Returns:
Returns an array of models of the specified class.
Updated:
2011-05-03
- (NSArray *) hasMany: (Class)  model
foreignKey: (NSArray *)  foreignKey
options: (NSDictionary *)  options 
Signature:
hasMany:foreignKey:options:
Discussion:
This method uses the values stored in the primary key columns of the current instance (i.e "self") to find a set of records in another table by comparing them against that table's foreign key columns.
Parameters:
modelThe model type to be loaded.
foreignKeyAn array of columns in the specified model that define the foreign key to be used. The order of the columns matters (i.e. columns must be placed in the same order as self's primary key).
optionsA dictionary options that will constraint the result set.
Returns:
Returns an array of models of the specified class.
Updated:
2011-10-23
See also:
http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
- (id) hasOne: (Class)  model
foreignKey: (NSArray *)  foreignKey 
Signature:
hasOne:foreignKey:
Discussion:
This method uses the values stored in the primary key columns of the current instance (i.e "self") to find a record in another table by comparing them against that table's foreign key columns.
Parameters:
modelThe model type to be loaded.
foreignKeyAn array of columns in the specified model that define the foreign key to be used. The order of the columns matters (i.e. columns must be placed in the same order as self's primary key).
Returns:
Returns a model of the specified class.
Updated:
2011-05-04
- (instancetype) init
Signature:
init
Discussion:
This method initializes the class.
Returns:
An instance of this class.
Updated:
2011-07-31
- (instancetype) initWithDelegate: (id)  delegate
Signature:
initWithDelegate:
Discussion:
This method initializes the class with the specified delegate.
Parameters:
delegateA class that implements the ZIMOrmModelDelegate.
Returns:
An instance of this class.
Updated:
2011-07-31
+ (BOOL) isAutoIncremented
Signature:
isAutoIncremented
Discussion:
This method returns whether the table's primary key auto-increments.
Returns:
Returns whether the table's primary key auto-increments.
Updated:
2011-04-14
+ (BOOL) isModel: (Class)  model
Signature:
isModel:
Discussion:
This method determines whether the specified class is a class of this type.
Parameters:
modelThe class to be tested.
Returns:
Returns whether the specified class is a class of this type.
Updated:
2011-05-01
See also:
http://cocoawithlove.com/2010/01/getting-subclasses-of-objective-c-class.html
+ (BOOL) isSaveable
Signature:
isSaveable
Discussion:
This method returns whether the model can be saved to the database.
Returns:
Returns whether the model can be saved to the database.
Updated:
2011-04-14
- (void) load
Signature:
load
Discussion:
This method will load/reload the record matching the primary key.
Updated:
2011-10-23
+ (NSArray *) primaryKey
Signature:
primaryKey
Discussion:
This method will return the table's primary key.
Returns:
The table's primary key.
Updated:
2011-04-18
- (void) save
Signature:
save
Discussion:
This method either creates or updates the record matching the primary key.
Updated:
2011-10-23
+ (NSString *) table
Signature:
table
Discussion:
This method will return the table name associated with this class.
Returns:
The table name associated with this class.
Updated:
2011-04-03

Member Data Documentation

- (id __unsafe_unretained) _delegate [protected]
- (NSString*) _saved [protected]

Property Documentation

- (id) delegate [read, write, retain]

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Properties Defines