Merge pull request #13068 from alifrumin/formLink
[civicrm-core.git] / CRM / Grant / Form / Search.php
index bfd64b9de697e0b15e0ab3cd92a50059f92837b7..5981f0d2134f380c3db1d8b7593117d5be5815be 100644 (file)
@@ -62,7 +62,19 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search {
    */
   protected $_prefix = "grant_";
 
-  protected $entity = 'grant';
+  /**
+   * Metadata of all fields to include on the form.
+   *
+   * @var array
+   */
+  protected $searchFieldMetadata = [];
+
+  /**
+   * @return string
+   */
+  public function getDefaultEntity() {
+    return 'Grant';
+  }
 
   /**
    * Processing needed for buildForm and later.
@@ -77,7 +89,6 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search {
     $this->_actionButtonName = $this->getButtonName('next', 'action');
 
     $this->_done = FALSE;
-    $this->defaults = array();
 
     $this->loadStandardSearchOptionsFromUrl();
     $this->loadFormValues();
@@ -286,4 +297,13 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search {
     return ts('Find Grants');
   }
 
+  /**
+   * Get metadata for fields being assigned by metadata.
+   *
+   * @return array
+   */
+  protected function getEntityMetadata() {
+    return CRM_Grant_BAO_Query::getSearchFieldMetadata();
+  }
+
 }