

    /**
     * validateMeta() -- public method
     *
     * This method requires one input parameter:
     *
     * $_meta -- a key-value paired array containing the current meta data payload
     *
     * first we validate the input parameter to ensure we're working with valid data object.  If not, we're going to
     * immediately return a false value and set the gacMetrics property (stopProcessing) to true.  This allows us
     * to signal the gacFactory class that a processing error had occurred.
     *
     * Otherwise, spin through the meta data that was passed to the method and compare each key in the array to the
     * list of "authorized" keys defined for the current class.  If a key does not exist in the authoritative index,
     * then remove that key from the input-meta data and record the event in the log file and in the gacFactory
     * class eventMessages property.
     *
     * Method returns a boolean value that indicates if meta data was validated.
     *
     * Since the meta data array is passed as a call-by-reference variable, dropped fields will propagate back to the
     * calling client.  A list of dropped fields, if any, will be stored in the eventMessages container.
     *
     *
     * @author  mike@givingassistant.org
     * @version 1.0
     *
     * @param array $_meta
     * @return bool
     *
     * HISTORY:
     * ========
     * 06-21-17     mks     original coding
     * 10-05-17     mks     CORE-584: added validation for META_SKIP and META_LIMIT
     *
     */
    public function validateMeta(array &$_meta):bool
    {
        if (!is_array($_meta) or empty($_meta)) {
            $this->logger->error(ERROR_DATA_META_REQUIRED);
            $this->eventMessages[] = ERROR_DATA_META_REQUIRED;
            return(false);
        }
        foreach ($_meta as $key => $value) {
            if (!array_key_exists($key, $this->fields)) {
                unset($_meta[$key]);
                $msg = sprintf(NOTICE_META_DISCARD, $key);
                $this->eventMessages[] = $msg;
                if ($this->debug) $this->logger->debug($msg);
            } else  {
                switch ($key) {
                    case META_SKIP  :
                    case META_LIMIT :
                        if (!is_numeric($value)) {
                            $msg = ERROR_DATA_FIELD_DROPPED . $key;
                            $this->eventMessages[] = $msg;
                            if ($this->debug) $this->logger->debug($msg);
                            $msg = sprintf(ERROR_DATA_TYPE_MISMATCH_DETAILS, $key, DATA_TYPE_INTEGER, gettype($value));
                            $this->eventMessages[] = $msg;
                            if ($this->debug) $this->logger->debug($msg);
                            unset($_meta[$key]);
                        }
                    break;
                }
            }
        }
        return(true);
    }
