protected function _putData($key, $data)
    {
        $bool = $this->_validateDataKey($key, $data);
        if (!$bool) {
            return $this;
        }

        $hasData = $this->has($key);
        if ($this->_setPreparationOn) {
            $data = $this->_dataPreparation(
                $key,
                $data,
                $this->_dataPreparationCallbacks
            );
        }

        if (!$hasData
            || ($hasData && $this->_comparator($this->_DATA[$key], $data, '!=='))
        ) {
            $this->_changeData($key, $data, $hasData);
        }

        return $this;
    }
protected function _putData($key, $data)
    {
        $bool = $this->_validateDataKey($key, $data);
        if (!$bool) {
            return $this;
        }

        $hasData = $this->has($key);
        if ($this->_setPreparationOn) {
            $data = $this->_dataPreparation(
                $key,
                $data,
                $this->_dataPreparationCallbacks
            );
        }

        if (!$hasData
            || ($hasData && $this->_comparator($this->_DATA[$key], $data, '!=='))
        ) {
            $this->_changeData($key, $data, $hasData);
        }

        return $this;
    }
protected function _putData ( $ key , $ data ) { $ bool = $ this -> _validateDataKey ( $ key , $ data ) ; if ( ! $ bool ) { return $ this ; } $ hasData = $ this -> has ( $ key ) ; if ( $ this -> _setPreparationOn ) { $ data = $ this -> _dataPreparation ( $ key , $ data , $ this -> _dataPreparationCallbacks ) ; } if ( ! $ hasData || ( $ hasData && $ this -> _comparator ( $ this -> _DATA [ $ key ] , $ data , '!==' ) ) ) { $ this -> _changeData ( $ key , $ data , $ hasData ) ; } return $ this ; }
check that given data for key is valid and set in object if don't exist or is different

@param string $key
@param mixed $data
@return $this
check that given data for key is valid and set in object if don t exist or is different