|
| __construct ($Name= '') |
|
| DefineSchema () |
|
| Save ($FormPostValues, $Settings=FALSE) |
|
| Insert ($Fields) |
|
| Update ($Fields, $Where=FALSE, $Limit=FALSE) |
|
| Delete ($Where= '', $Limit=FALSE, $ResetData=FALSE) |
|
| FilterForm ($Data) |
|
| FilterSchema ($Data) |
|
| Get ($OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) |
|
| GetCount ($Wheres= '') |
|
| GetID ($ID, $DatasetType=FALSE) |
|
| GetWhere ($Where=FALSE, $OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) |
|
| ValidationResults () |
|
| Validate ($FormPostValues, $Insert=FALSE) |
|
| SaveToSerializedColumn ($Column, $RowID, $Name, $Value= '') |
|
| SetProperty ($RowID, $Property, $ForceValue=FALSE) |
|
| __construct () |
|
| GetReturn ($PluginName, $HandlerName) |
|
| FireEvent ($EventName) |
|
| __call ($MethodName, $Arguments) |
|
| EnableSlicing (&$Sender) |
|
| Slice ($SliceName, $Arguments=array()) |
|
| AddSliceAsset ($Asset) |
|
| RenderSliceConfig () |
|
__construct |
( |
|
$Name = '' | ) |
|
Class constructor. Defines the related database table name.
- Parameters
-
string | $Name | An optional parameter that allows you to explicitly define the name of the table that this model represents. You can also explicitly set this value with $this->Name. |
A overridable function called before the various get queries.
AddInsertFields |
( |
& |
$Fields | ) |
|
|
protected |
Adds $this->InsertUserID and $this->DateInserted fields to an associative array of fieldname/values if those fields exist on the table being inserted.
- Parameters
-
array | $Fields | The array of fields to add the values to. |
AddUpdateFields |
( |
& |
$Fields | ) |
|
|
protected |
Adds $this->UpdateUserID and $this->DateUpdated fields to an associative array of fieldname/values if those fields exist on the table being updated.
- Parameters
-
array | $Fields | The array of fields to add the values to. |
Connects to the database and defines the schema associated with $this->Name. Also instantiates and automatically defines $this->Validation.
Delete |
( |
|
$Where = '' , |
|
|
|
$Limit = FALSE , |
|
|
|
$ResetData = FALSE |
|
) |
| |
- Parameters
-
unknown_type | $Where | |
unknown_type | $Limit | |
unknown_type | $ResetData | |
- Todo:
- add doc
Filter out any potentially insecure fields before they go to the database.
- Parameters
-
Returns an array with only those keys that are actually in the schema.
- Parameters
-
array | $Data | An array of key/value pairs. |
- Returns
- array The filtered array.
Get |
( |
|
$OrderFields = '' , |
|
|
|
$OrderDirection = 'asc' , |
|
|
|
$Limit = FALSE , |
|
|
|
$Offset = FALSE |
|
) |
| |
- Parameters
-
unknown_type | $OrderFields | |
unknown_type | $OrderDirection | |
unknown_type | $Limit | |
unknown_type | $Offset | |
- Returns
- unknown
- Todo:
- add doc
Returns a count of the # of records in the table
- Parameters
-
GetID |
( |
|
$ID, |
|
|
|
$DatasetType = FALSE |
|
) |
| |
Get the data from the model based on its primary key.
- Parameters
-
mixed | $ID | The value of the primary key in the database. |
string | $DatasetType | The format of the result dataset. |
- Returns
- Gdn_DataSet
GetWhere |
( |
|
$Where = FALSE , |
|
|
|
$OrderFields = '' , |
|
|
|
$OrderDirection = 'asc' , |
|
|
|
$Limit = FALSE , |
|
|
|
$Offset = FALSE |
|
) |
| |
Get a dataset for the model with a where filter.
- Parameters
-
array | $Where | A filter suitable for passing to Gdn_SQLDriver::Where(). |
string | $OrderFields | A comma delimited string to order the data. |
string | $OrderDirection | One of asc or desc |
int | $Limit | |
int | $Offset | |
- Returns
- Gdn_DataSet
- Parameters
-
- Returns
- unknown
- Todo:
- add doc
Save |
( |
|
$FormPostValues, |
|
|
|
$Settings = FALSE |
|
) |
| |
Takes a set of form data ($Form->_PostValues), validates them, and inserts or updates them to the datatabase.
- Parameters
-
array | $FormPostValues | An associative array of $Field => $Value pairs that represent data posted from the form in the $_POST or $_GET collection. |
array | $Settings | If a custom model needs special settings in order to perform a save, they would be passed in using this variable as an associative array. |
- Returns
- unknown
SaveToSerializedColumn |
( |
|
$Column, |
|
|
|
$RowID, |
|
|
|
$Name, |
|
|
|
$Value = '' |
|
) |
| |
SetProperty |
( |
|
$RowID, |
|
|
|
$Property, |
|
|
|
$ForceValue = FALSE |
|
) |
| |
Update |
( |
|
$Fields, |
|
|
|
$Where = FALSE , |
|
|
|
$Limit = FALSE |
|
) |
| |
- Parameters
-
unknown_type | $Fields | |
unknown_type | $Where | |
unknown_type | $Limit | |
- Todo:
- add doc
Validate |
( |
|
$FormPostValues, |
|
|
|
$Insert = FALSE |
|
) |
| |
- Parameters
-
unknown_type | $FormPostValues | |
unknown_type | $Insert | |
- Returns
- unknown
- Todo:
- add doc
$DateInserted = 'DateInserted' |
$DateUpdated = 'DateUpdated' |
$InsertUserID = 'InsertUserID' |
$UpdateUserID = 'UpdateUserID' |
The documentation for this class was generated from the following file: