]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/criteria/dataset/class_DataSetCriteria.php
Continued:
[core.git] / framework / main / classes / criteria / dataset / class_DataSetCriteria.php
index b68b36f15927f1e8ac95fb1eaefb149e85f5f92c..0547f50135e4616e7b6e4da7c9daf789edc35b23 100644 (file)
@@ -4,6 +4,7 @@ namespace Org\Mxchange\CoreFramework\Criteria\DataSet;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Criteria\BaseCriteria;
+use Org\Mxchange\CoreFramework\Criteria\Local\LocalSearchCriteria;
 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
 use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 
@@ -48,7 +49,12 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
        /**
         * Primary keys
         */
-       private $primaryKeys = array();
+       private $primaryKeys = [];
+
+       /**
+        * Search criteria instance
+        */
+       private $searchInstance = NULL;
 
        /**
         * Protected constructor
@@ -66,7 +72,7 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
         * @param       $tableName                      Name of the table
         * @return      $criteriaInstance       An instance of this criteria
         */
-       public static final function createDataSetCriteria ($tableName) {
+       public static final function createDataSetCriteria (string $tableName) {
                // Get a new instance
                $criteriaInstance = new DataSetCriteria();
 
@@ -83,8 +89,8 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
         * @param       $tableName      Name of the table to set
         * @return      void
         */
-       public final function setTableName ($tableName) {
-               $this->tableName = (string) $tableName;
+       public final function setTableName (string $tableName) {
+               $this->tableName = $tableName;
        }
 
        /**
@@ -102,8 +108,8 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
         * @param       $uniqueKey      Column to use as unique key
         * @return      void
         */
-       public final function setUniqueKey ($uniqueKey) {
-               $this->uniqueKey = (string) $uniqueKey;
+       public final function setUniqueKey (string $uniqueKey) {
+               $this->uniqueKey = $uniqueKey;
        }
 
        /**
@@ -115,6 +121,55 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
                return $this->uniqueKey;
        }
 
+       /**
+        * Setter for primary key
+        *
+        * @param       $primaryKey             Primary key to set
+        * @return      void
+        */
+       public final function setPrimaryKey (string $primaryKey) {
+               $this->primaryKey = $primaryKey;
+       }
+
+       /**
+        * Setter for primary key array
+        *
+        * @param       $primaryKeys    Primary key array to set
+        * @return      void
+        */
+       public function setPrimaryKeyCombined (array $primaryKeys) {
+               $this->primaryKeys = $primaryKeys;
+       }
+
+       /**
+        * Getter for primary keys
+        *
+        * @return      $primaryKeys    Primary key array
+        */
+       public final function getPrimaryKeys () {
+               // Return it
+               return $this->primaryKeys;
+       }
+
+       /**
+        * Setter for search instance
+        *
+        * @param       $searchInstance         Searchable criteria instance
+        * @return      void
+        */
+       public final function setSearchInstance (LocalSearchCriteria $searchInstance) {
+               $this->searchInstance = $searchInstance;
+       }
+
+       /**
+        * Getter for search instance
+        *
+        * @return      $searchInstance         Searchable criteria instance
+        */
+       public final function getSearchInstance () {
+               return $this->searchInstance;
+       }
+
        /**
         * Getter for unique key value
         *
@@ -193,34 +248,4 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
                return $primaryKey;
        }
 
-       /**
-        * Setter for primary key
-        *
-        * @param       $primaryKey             Primary key to set
-        * @return      void
-        */
-       public final function setPrimaryKey ($primaryKey) {
-               $this->primaryKey = (string) $primaryKey;
-       }
-
-       /**
-        * Setter for primary key array
-        *
-        * @param       $primaryKeys    Primary key array to set
-        * @return      void
-        */
-       public function setPrimaryKeyCombined (array $primaryKeys) {
-               $this->primaryKeys = $primaryKeys;
-       }
-
-       /**
-        * Getter for primary keys
-        *
-        * @return      $primaryKeys    Primary key array
-        */
-       public final function getPrimaryKeys () {
-               // Return it
-               return $this->primaryKeys;
-       }
-
 }