RWDE::RObject
Base class for various records All derived classes must be hashes and correspond to a standard derived class format
new()
is_instance()
Determine if this reference instance of a class
check_object()
Verify that this reference is an object.
DevelException is thrown if this is not an object instantiation.
field_desc($fn)
Get the field description stored within the object for the param $fn.
field_type($fn)
Get the field type stored within the object for the param $fn.
FIELDNAME
All field names of the record are accessible via the field name. If a second parameter is provided, that value is stored as the data, otherwise the existing value if any is returned. Throws an 'undef' exception on error. It is intended to be called by an AUTOLOAD() method from the subclass.
Example:
$rec->owner_email('new\@add.ress');
$rec->user_addr2(undef);
print $rec->user_fname();
Would be converted by F<AUTOLOAD()> in the subclass to calls like
$rec->FIELDNAME('owner_email','new@add.ress');
and so forth.
validate_email()
Check the syntactical format of an email address to reduce risk of bogus addresses.
RWDE::DevelException thrown if invalid format detected, otherwise just returns
Ensures that the address is in somewhat reasonable domain style, does not contain blanks, commas, brackets, colons, semicolons, or end in a period.
validate_ip()
Check the syntactical format of an ip address to reduce risk of storing a bogus or faked ip.
RWDE::DevelException thrown if invalid format detected, otherwise just returns
Ensures that the address is the standard aaa.bbb.ccc.ddd ip address format
validate_boolean()
Check to make sure that any of the accepted variations on a boolean is present.
RWDE::DevelException thrown if invalid boolean detected, otherwise just returns
DESTROY()
Do nothing. Here just to shut up TT when AUTOLOAD is present
display()
AUTOLOAD()
All field names of the record are accessible via the field name. If a parameter is provided, that value is stored as the data, otherwise the existing value if any is returned. Throws an 'undef' exception on error.
Example:
$rec->password('blahblah');
print $rec->password();
@return (Enter explanation for return value here)
copy_record()
Copy a source record over top of this object.
In doing so we need to verify that this is an object instance, that this object is different than the source record.
If both of those are true then we simply copy the data present within $source into this object instance.
fill()
Fill an object with data specified in the params hash. If the params hash does not have every piece of data, an exception is thrown.
fill_required()
This function takes the required array of elements, populates the current object and notifies if there are any missing elements
fill_optional()
This function takes the required array of elements, populates the current object and notifies if there are any missing elements
get_id()
Get the id value present in this classes id_name
get_id_name()
Get the id_name stored within the class
fetch_by_id()
_fetch_by_id()
get_static()
check_params()
Verify that all fields specified in the required array are present within the params
Note that other fields may be present within the params, but that the required elements must be present at a minimum.
RWDE::DevelException is thrown if the required fields are not present within the params, along with a string that includes the names of all missing fields. This information maybe be useful to pass back to the user in an alternate form.