Comments: on this page. Click to read or post your own.

Interface DataObjectInterface

Description

DataObjectInterface is an interface that other data systems in your application can implement in order to behave in a manner similar to DataObject.

In addition to the methods defined below, the data of the object should be directly accessible as fields.

Located in /sapphire/core/model/DataObjectInterface.php (line 15)


	
			
Method Summary
DataObjectInterface __construct ()
void delete ()
void instance_get ([$filter $filter = ""], [$sort $sort = ""], [$join $join = ""], [$limit $limit = ""], [ $containerClass = "DataObjectSet"])
void instance_get_one ($filter $filter, [$sort $sort = ""], $join 2, $limit 3)
void setCastedField ( $fieldName,  $val)
void write ()
void __get ( $fieldName)
Methods
Constructor __construct (line 20)

Create a new data object, not yet in the database. To load an object into the database, a null object should be constructed, its fields set, and the write() method called.

DataObjectInterface __construct ()
delete (line 51)

Remove this object from the database. Doesn't do anything if this object isn't in the database.

void delete ()
instance_get (line 30)

Perform a search query on this data source

void instance_get ([$filter $filter = ""], [$sort $sort = ""], [$join $join = ""], [$limit $limit = ""], [ $containerClass = "DataObjectSet"])
  • $filter $filter: A filter expression of some kind, in SQL format.
  • $sort $sort: A sort expression, in SQL format.
  • $join $join: A join expression. May or may not be relevant.
  • $limit $limit: A limit expression, either "(count)", or "(start), (count)"
  • $containerClass
instance_get_one (line 40)

Retrieve a single record from this data source

void instance_get_one ($filter $filter, [$sort $sort = ""], $join 2, $limit 3)
  • $join 2: A join expression. May or may not be relevant.
  • $limit 3: A limit expression, either "(count)", or "(start), (count)"
  • $filter $filter: A filter expression of some kind, in SQL format.
  • $sort $sort: A sort expression, in SQL format.
setCastedField (line 64)

Save content from a form into a field on this data object.

Since the data comes straight from a form it can't be trusted and will need to be validated / escaped.'

void setCastedField ( $fieldName,  $val)
  • $fieldName
  • $val
write (line 46)

Write the current object back to the database. It should know whether this is a new object, in which case this would

be an insert command, or if this is an existing object queried from the database, in which case thes would be

void write ()
__get (line 58)

Get the named field.

This function is sometimes called explicitly by the form system, so you need to define it, even if you use the default field system.

void __get ( $fieldName)
  • $fieldName
blog comments powered by Disqus

Documentation generated on Sun, 19 Oct 2008 06:39:57 +1300 by phpDocumentor 1.3.2