Module CustomFields Dev: Difference between revisions

Jump to navigation Jump to search
Line 313: Line 313:
<source lang="php">
<source lang="php">
$rtncode = $customfields->delete($id); // where $id is = to fk_moduleid column, NOT rowid
$rtncode = $customfields->delete($id); // where $id is = to fk_moduleid column, NOT rowid
</source>
=== Fetching a custom field's record ===
Just use the fetch() method:
<source lang="php">
$records = $customfields->fetch($id=null);
</source>
Where $id can either be = fk_moduleid (NOT rowid), or null to fetch all the records at once.
This method will either return null, a single record object, or an array of records objects.
=== Fetching all custom fields' records ===
Use the fetchAll() method, which is an alias for fetch():
<source lang="php">
$records = $customfields->fetchAll();
</source>
</source>


439

edits

Navigation menu