Craft\AmForms_FormElementType::modifyElementsQuery PHP Method

modifyElementsQuery() public method

Modifies an element query targeting elements of this type.
public modifyElementsQuery ( craft\DbCommand $query, craft\ElementCriteriaModel $criteria ) : mixed
$query craft\DbCommand
$criteria craft\ElementCriteriaModel
return mixed
    public function modifyElementsQuery(DbCommand $query, ElementCriteriaModel $criteria)
    {
        $query->addSelect('forms.id,
                           forms.fieldLayoutId,
                           forms.redirectEntryId,
                           forms.name,
                           forms.handle,
                           forms.titleFormat,
                           forms.submitAction,
                           forms.submitButton,
                           forms.afterSubmit,
                           forms.afterSubmitText,
                           forms.submissionEnabled,
                           forms.displayTabTitles,
                           forms.redirectUrl,
                           forms.sendCopy,
                           forms.sendCopyTo,
                           forms.notificationEnabled,
                           forms.notificationFilesEnabled,
                           forms.notificationRecipients,
                           forms.notificationSubject,
                           forms.confirmationSubject,
                           forms.notificationSenderName,
                           forms.confirmationSenderName,
                           forms.notificationSenderEmail,
                           forms.confirmationSenderEmail,
                           forms.notificationReplyToEmail,
                           forms.formTemplate,
                           forms.tabTemplate,
                           forms.fieldTemplate,
                           forms.notificationTemplate,
                           forms.confirmationTemplate');
        $query->join('amforms_forms forms', 'forms.id = elements.id');
        if ($criteria->handle) {
            $query->andWhere(DbHelper::parseParam('forms.handle', $criteria->handle, $query->params));
        }
    }