[eluser]Daniel H[/eluser]
I start my models with..
Code:
<?php
class x_model extends Model {
// Table name
var $table = '';
// Order field name
var $order_field = array();
// Limit and offset
var $limit = NULL;
var $offset = NULL;
// Field names in the database table
var $id = NULL;
var $name = NULL;
// etc...
... and then I have a reset() function that looks like this...
Code:
function reset()
{
// Ensure all the variables are listed here
$this->id = NULL;
$this->name = NULL;
// etc...
$this->limit = NULL;
$this->offset = NULL;
$this->order_field = array();
}
Instead of listing out all the variables again with their defaults, is there a shorthand which just sets the variables back to their original values?
Many thanks,
Dan.