Entry Management
OForms stores every form submission as an entry in the database.
Entry Database Schema
of_entries
| Column | Type | Notes |
|---|---|---|
id | BIGINT UNSIGNED PK | |
form_id | BIGINT UNSIGNED | References form |
user_id | BIGINT UNSIGNED | 0 if guest |
status | ENUM | active, spam, trash |
ip_address | VARCHAR(45) | |
user_agent | TEXT | |
created_at | DATETIME | Submission time |
of_entry_values
| Column | Type | Notes |
|---|---|---|
id | BIGINT UNSIGNED PK | |
entry_id | BIGINT UNSIGNED | |
field_name | VARCHAR(100) | Field name attribute |
value | LONGTEXT | Serialised for arrays |
PHP API
php// Get entries for a form
$entries = OForms\Entries\EntryQuery::get([
'form_id' => 5,
'status' => 'active',
'per_page' => 20,
'page' => 1,
'search' => 'john',
'orderby' => 'created_at',
'order' => 'DESC',
]);
// Get a single entry with all field values
$entry = OForms\Entries\Entry::get( $entry_id );
$values = $entry->get_values(); // array keyed by field name
// Get a specific field value from an entry
$email = $entry->get_value( 'email' );
// Mark entry as spam
OForms\Entries\Entry::update_status( $entry_id, 'spam' );