Methods summary
public
string
|
#
getFormsTableName( )
Get the name of the forms table with the WP prefix added
Get the name of the forms table with the WP prefix added
Returns
string
|
public
string
|
#
getEntriesTableName( )
Get the name of the entries table with the WP prefix added
Get the name of the entries table with the WP prefix added
Returns
string
|
public
string
|
#
getEntryDataTableName( )
Get the name of the entry data table with the WP prefix added
Get the name of the entry data table with the WP prefix added
Returns
string
|
public
string
|
#
getEntryLabelsTableName( )
Get the name of the entry labels table with the WP prefix added
Get the name of the entry labels table with the WP prefix added
Returns
string
|
public
string
|
#
getEntryEntryLabelsTableName( )
Get the name of the entry label mapping table with the WP prefix added
Get the name of the entry label mapping table with the WP prefix added
Returns
string
|
public
array
|
#
all( boolean|null $active = null, string $orderBy = 'id', string $order = 'ASC' )
Get all form rows
Parameters
- $active
- Select all (null), only active (true) or inactive (false) forms
- $orderBy
- Order by this column
- $order
- Order 'ASC' or 'DESC'
Returns
array
|
public
array
|
#
getFormsForListTable( array $args = array() )
Get form rows, including counts of read and unread entries
Get form rows, including counts of read and unread entries
Deprecated
2.1.0
Parameters
Returns
array
|
public
array
|
#
getForms( array $args = array() )
Get form rows, including counts of read and unread entries
Get form rows, including counts of read and unread entries
Parameters
Returns
array
|
public
array
|
#
allForms( boolean|null $active = null )
Get all form configs
Parameters
- $active
- Select all (null), only active (true) or inactive (false) forms
Returns
array
|
public
array
|
#
getFormsById( array $ids )
Get the array of form configs with the given IDs
Get the array of form configs with the given IDs
Parameters
Returns
array
|
public
int[]
|
#
getTrashedFormIds( )
Get the array of form IDs that are trashed
Get the array of form IDs that are trashed
Returns
int[]
|
public
array
|
#
formsToSelectArray( boolean|null $active = null, string $orderBy = 'updated_at', string $order = 'DESC' )
Get the forms list in array format to be easily used by an HTML <select>
Get the forms list in array format to be easily used by an HTML <select>
Parameters
- $active
- Select all (null), only active (true) or inactive (false) forms
- $orderBy
- Order by this column
- $order
- Order 'ASC' or 'DESC'
Returns
array
|
public
integer
|
#
count( boolean|null $active = null, boolean $trashed = false )
Get the count of forms
Parameters
- $active
- Select all (null), only active (true) or inactive (false) forms
- $trashed
- Select trashed forms
Returns
integer
|
public
boolean
|
#
exists( integer $id )
Does the form exist with the given ID?
Does the form exist with the given ID?
Parameters
Returns
boolean
|
public
boolean
|
#
entryExists( integer $id )
Does the entry exist with the given ID?
Does the entry exist with the given ID?
Parameters
Returns
boolean
|
public
array|null
|
#
find( integer $id )
Find a form by ID
Parameters
Returns
array|null
|
public
array|null
|
#
first( )
Get the first non-trashed form row
Get the first non-trashed form row
Returns
array|null
|
public
array|null
|
#
getConfig( integer $id )
Get the config array for the form with the given ID
Get the config array for the form with the given ID
Parameters
Returns
array|null The config array or null if the form doesn't exist
|
public
array|null
|
#
firstConfig( )
Get the config array for the first form in the database
Get the config array for the first form in the database
Returns
array|null The config array or null if the form doesn't exist
|
public
|
#
activate( )
On plugin activation - create the database tables
On plugin activation - create the database tables
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
public
|
#
getDbVersion( )
Get the database version from the wpdb object
Get the database version from the wpdb object
|
public
array|boolean
|
#
add( array $config )
Add the form with the given config
Add the form with the given config
Parameters
- $config
- The form config to add
Returns
array|boolean The new form config with new auto-generated ID or false on failure
|
public
array
|
#
save( array $config )
Save the form with the given config and return the config
Save the form with the given config and return the config
If the 'id' is present in the config array it will update the form
otherwise a new one will be created
Parameters
Returns
array The updated config array
|
public
array
|
#
saveEntry( array $config, integer|null $entryId = null )
Save the entry with the given configuration
Save the entry with the given configuration
Parameters
- $config
- The entry config
- $entryId
- The entry ID if we are updating a saved entry, null for new entries
Returns
array The entry config with new ID if we are adding a new entry
|
public
|
#
saveEntryData( integer $entryId, array $data )
Save the given data to the entry with the given ID
Save the given data to the entry with the given ID
Parameters
|
public
integer
|
#
activateForms( array $ids )
Activate forms with the given IDs
Activate forms with the given IDs
Parameters
- $ids
- The array of form IDs
Returns
integer The number of affected rows
|
public
integer
|
#
deactivateForms( array $ids )
Deactivate forms with the given IDs
Deactivate forms with the given IDs
Parameters
- $ids
- The array of form IDs
Returns
integer The number of affected rows
|
public
integer
|
#
trashForms( array $ids )
Trash forms with the given IDs
Trash forms with the given IDs
Parameters
- $ids
- The array of form IDs
Returns
integer The number of affected rows
|
public
integer
|
#
untrashForms( array $ids )
Untrash forms with the given IDs
Untrash forms with the given IDs
Parameters
- $ids
- The array of form IDs
Returns
integer The number of affected rows
|
public
integer
|
#
deleteForms( array $ids )
Delete the forms with the IDs in the given array
Delete the forms with the IDs in the given array
Parameters
- $ids
- The array of form IDs
Returns
integer The number of deleted rows
|
public
array
|
#
duplicateForms( array $ids )
Duplicate the forms with the IDs in the given array
Duplicate the forms with the IDs in the given array
Parameters
Returns
array The array of new form IDs
|
protected
string
|
#
joinIds( array $ids )
Escape and join an array of IDs for use in an IN clause
Escape and join an array of IDs for use in an IN clause
Parameters
Returns
string The sanitized string for the IN clause
|
protected
string
|
#
prepareIds( array $ids )
Prepare an array of IDs for use in an IN clause
Prepare an array of IDs for use in an IN clause
Parameters
Returns
string The sanitized string for the IN clause
|
protected
array
|
#
sanitizeIds( array $ids )
Sanitize the array of IDs ensuring they are all integers
Sanitize the array of IDs ensuring they are all integers
Parameters
Returns
array The array of sanitized IDs
|
protected
array
|
#
sanitiseIds( array $ids )
Sanitize the array of IDs ensuring they are all integers
Sanitize the array of IDs ensuring they are all integers
Deprecated
2.4.0
Parameters
Returns
array The array of sanitized IDs
|
public
array|null
|
#
getEntries( Quform_Form $form, array $args = array() )
Get the entries for a specific form
Get the entries for a specific form
No longer used internally, but used by custom code examples on Gist.
Parameters
- $form
- The form instance
- $args
- The query args
Returns
array|null
|
public
array|null
|
#
listEntries( Quform_Form $form, array $columns, array $args = array() )
Get the entries for a specific form for the list view
Get the entries for a specific form for the list view
Parameters
- $form
- The form instance
- $columns
- Limit the query to select only these columns
- $args
- The query args
Returns
array|null
|
public
integer
|
#
getFoundRows( )
Get the number of found rows from the last query
Get the number of found rows from the last query
Returns
integer
|
public
integer
|
#
getEntryCount( integer $formId, boolean|null $unread = null, string $status = 'normal' )
Get the count of entries for the given form ID
Get the count of entries for the given form ID
Parameters
- $formId
- $unread
- Get the count of all (null), unread (true) or read (false) entries
- $status
- Filter the result by status
Returns
integer
|
public
int[]
|
#
getEntryIdsByStatus( integer $formId, string $status )
Get the IDs of all entries with the given status for the given form
Get the IDs of all entries with the given status for the given form
Parameters
- $formId
- The ID of the form
- $status
- Filter the result by status
Returns
int[]
|
public
array
|
#
getEntryLabels( integer $entryId )
Get the entry label data from the given label IDs
Get the entry label data from the given label IDs
Parameters
Returns
array
|
public
array
|
#
getFormEntryLabels( integer $formId )
Get the entry labels for the given form
Get the entry labels for the given form
Parameters
Returns
array
|
public
|
#
setFormEntryLabels( integer $formId, array $labels )
Set the entry labels for the given form
Set the entry labels for the given form
Parameters
|
public
|
#
deleteFormEntryLabels( integer $formId )
Delete all entry labels for the given form ID
Delete all entry labels for the given form ID
Deprecated
2.2.0
Parameters
|
public
|
#
addEntryEntryLabel( integer $entryId, integer $entryLabelId )
Add the given entry label to the given entry
Add the given entry label to the given entry
Parameters
|
public
|
#
deleteEntryEntryLabel( integer $entryId, integer $entryLabelId )
Delete the given entry label from the given entry
Delete the given entry label from the given entry
Parameters
|
public
integer
|
#
getFormIdFromEntryId( integer $entryId )
Get the form ID from the entry ID
Get the form ID from the entry ID
Parameters
Returns
integer
|
public
array|null
|
#
findEntry( integer $entryId )
Get the entry with the given ID
Get the entry with the given ID
Parameters
Returns
array|null
|
public
boolean
|
#
hasDuplicateEntry( Quform_Element_Field $element )
Is there an existing entry with the same value as the given element
Is there an existing entry with the same value as the given element
Parameters
Returns
boolean
|
public
integer
|
#
readEntries( array $ids )
Mark the entries with the IDs in the given array as read
Mark the entries with the IDs in the given array as read
Parameters
- $ids
- The array of entry IDs
Returns
integer The number of affected rows
|
public
integer
|
#
unreadEntries( array $ids )
Mark the entries with the IDs in the given array as unread
Mark the entries with the IDs in the given array as unread
Parameters
- $ids
- The array of entry IDs
Returns
integer The number of affected rows
|
public
integer
|
#
trashEntries( array $ids )
Trash the entries with the IDs in the given array
Trash the entries with the IDs in the given array
Parameters
- $ids
- The array of entry IDs
Returns
integer The number of deleted rows
|
public
integer
|
#
untrashEntries( array $ids )
Untrash the entries with the IDs in the given array
Untrash the entries with the IDs in the given array
Parameters
- $ids
- The array of entry IDs
Returns
integer The number of deleted rows
|
public
integer
|
#
deleteEntries( array $ids )
Delete the entries with the IDs in the given array
Delete the entries with the IDs in the given array
Parameters
- $ids
- The array of entry IDs
Returns
integer The number of deleted rows
|
public
integer
|
|
public
mixed
|
|
public
array
|
#
getRecentEntries( integer|null $count = null )
Get the most recent entries
Get the most recent entries
Parameters
- $count
- Limit to this number of entries
Returns
array
|
protected
array
|
|
public
array|null
|
|
public
array|null
|
#
getFormsByUpdatedAt( )
Get the forms ordered by last updated
Get the forms ordered by last updated
Returns
array|null
|
public
boolean
|
#
entryExistsByFormIdAndCreatedBy( integer $formId, integer $createdBy )
Does an entry exist for the given form and user?
Does an entry exist for the given form and user?
Parameters
- $formId
- The form ID
- $createdBy
- The user ID
Returns
boolean
|
public
boolean
|
#
entryExistsByFormIdAndIpAddress( integer $formId, string $ipAddress )
Does an entry exist for the given form and IP address?
Does an entry exist for the given form and IP address?
Parameters
- $formId
- The form ID
- $ipAddress
- The IP address
Returns
boolean
|
public
|
#
uninstall( )
Called when the plugin is uninstalled from the Tools page
Called when the plugin is uninstalled from the Tools page
|
protected
array
|
#
getTables( )
Get the list of database tables
Get the list of database tables
Returns
array
|
public
array
|
#
dropTablesOnSiteDeletion( array $tables )
Drop the database tables when a site is deleted
Drop the database tables when a site is deleted
Parameters
Returns
array
|