Gets the converter for handling attribute values in queries.

@param   Store               $store
@param   AttributeMetadata   $attrMeta
@return  Closure
170985
private function getQueryAttrConverter(Store $store, AttributeMetadata $attrMeta)
    {
        return function ($value) use ($store, $attrMeta) {
            if (in_array($attrMeta->dataType, ['object', 'array'])) {
                // Leave the value as is.
                return $value;
            }
            $value = $store->convertAttributeValue($attrMeta->dataType, $value);
            return $this->getAttributeDbValue($attrMeta, $value);
        };

    }
806138
function (store, type, fixture) {
    var now = (new Date()).toISOString(), attributes = slice.call(arguments, 3);
    this._parseModelOrType(store, type).eachAttribute(function (name, meta) {
      if (attributes.indexOf(name) !== -1 && (!meta.type || meta.type === 'date')) {
        fixture[name] = now;
      }
    });
  }
786736
public static function get_Hstore( &$store )
    {
        if( $store instanceof Hstore ) {
            return $store;
        }
        return !is_null($store)
            ? new Hstore($store)
            : null
            ;
    }
465940
public static function get($name)
    {
        if (!isset(self::$converterMap[$name])) {
            throw new InvalidArgumentException(sprintf('Attribute converter "%s" is not valid.', $name));
        }

        return self::getInstanceOfConverter($name);
    }
488807
public function getM2MAttr(ForeignObjectRel $relation, $attr)
    {
        $cache_attr = sprintf('_m2m_%s_cache', $attr);
        if ($this->hasProperty($cache_attr)) {
            return $this->{$cache_attr};
        }

        $linkName = null;
        if ($this->relation->throughFields) {
            $linkName = $this->relation->throughFields[0];
        }

        $fromModel = $relation->getFromModel()->getMeta()->getNSModelName();
        /** @var $field RelatedField */
        foreach ($this->relation->through->getMeta()->getFields() as $field) {
            if ($field->isRelation && (is_null($linkName) || $linkName == $field->getName()) &&
                $field->relation->toModel->getMeta()->getNSModelName() == $fromModel) {
                $this->{$cache_attr} = ('name' == $attr) ? call_user_func([$field, 'getName']) : $field->{$attr};

                return $this->{$cache_attr};
            }
        }
    }
405745
public function getTranslation($item, $langcode, $store = null)
    {
        $config = $this->getConfig(null, $store);

        if (!empty($config['translation'][$langcode][$item])) {
            return $config['translation'][$langcode][$item];
        }

        if (isset($config[$item])) {
            return $config[$item];
        }

        return '';
    }
239995
private function _resolveCollection($attr, $values)
    {
        $cls = get_called_class();

        if (!array_key_exists($cls, self::$_has_many_maps)) {
            return null;
        }

        $maps = array_values(self::$_has_many_maps[$cls]);
        if (!in_array($attr, $maps)) {
            return null;
        }

        if (!$values || !is_array($values) || sizeof($values)<1 || !is_object($values[0])) {
            return null;
        }

        $this->_has_many_ids = array();

        foreach ($values as $value) {
            $klass = get_class($value);
            $this->push($value);
            $id = $value->get($klass::getPK());
            if ($id) {
                array_push($this->_has_many_ids, $id);
            }
        }
        return $this->_has_many_ids;
    }
343919
private function _resolveBelongsTo($attr, $values)
    {
        $cls = get_called_class();
        if (!array_key_exists($cls, self::$_belongs_to)
            || !array_key_exists($attr, self::$_belongs_to[$cls])
        ) {
            return null;
        }

        $configs       = self::$_belongs_to[$cls][$attr];
        $belongs_cls   = is_array($configs) && array_key_exists("class_name",  $configs) ? $configs["class_name"]  : ucfirst($attr);
        $belongs_key   = is_array($configs) && array_key_exists("foreign_key", $configs) ? $configs["foreign_key"] : strtolower($belongs_cls)."_id";
        $primary_key   = is_array($configs) && array_key_exists("primary_key", $configs) ? $configs["primary_key"] : "id";
        $value         = $values[$belongs_key];

        if (array_key_exists($attr, $this->_belongs_cache) && $this->_belongs_cache[$attr] && $this->_belongs_cache[$attr]->$primary_key == $value) {
            return $this->_belongs_cache[$attr];
        }

        $obj = $belongs_cls::first(array($primary_key => $value));

        if ($obj) {
            $this->_belongs_cache[$attr] = $obj;
        }
        return $obj;
    }
39653
public function getResetShippingCalculation($store = null)
    {
        return $this->getScopeConfig()->isSetFlag(
            self::XML_PATH_RESET_SHIPPING_CALCULATION,
            ScopeInterface::SCOPE_STORE,
            $store
        );
    }
211948
public function getM2MReverseAttr(ForeignObjectRel $relation, $attr)
    {
        $cache_attr = sprintf('_m2m_reverse_%s_cache', $attr);
        if ($this->hasProperty($cache_attr)) {
            return $this->{$cache_attr};
        }

        $linkName = null;
        if ($this->relation->throughFields) {
            $linkName = $this->relation->throughFields[1];
        }

        $tomodel = $relation->toModel->getMeta()->getNSModelName();
        /** @var $field RelatedField */
        foreach ($this->relation->through->getMeta()->getFields(true) as $field) {
            if ($field->isRelation && (is_null($linkName) || $linkName == $field->getName()) &&
                $field->relation->toModel->getMeta()->getNSModelName() == $tomodel
            ) {
                $this->{$cache_attr} = ('name' == $attr) ? call_user_func([$field, 'getName']) : $field->{$attr};

                return $this->{$cache_attr};
            }
        }
    }
768602
function attributeData(node) {
    var store = {}
    $.each(node.attributes || emptyArray, function(i, attr){
      if (attr.name.indexOf('data-') == 0)
        store[camelize(attr.name.replace('data-', ''))] =
          $.zepto.deserializeValue(attr.value)
    })
    return store
  }
328525
protected function updateData(array $data, $attribute, $attributeValue)
    {
        if ($this->nameConverter) {
            $attribute = $this->nameConverter->normalize($attribute);
        }

        $data[$attribute] = $attributeValue;

        return $data;
    }
60622
@SuppressWarnings("unchecked")
    public <T> T getAttribute( String attrName, Class<T> adaptee ) {
        if (attrName == null) {
            return null;
        }
        if (adaptee == null) {
            adaptee = (Class<T>) String.class;
        }

        Object attribute = feature.getAttribute(attrName);
        if (attribute == null) {
            return null;
        }
        if (attribute instanceof Number) {
            Number num = (Number) attribute;
            if (adaptee.isAssignableFrom(Double.class)) {
                return adaptee.cast(num.doubleValue());
            } else if (adaptee.isAssignableFrom(Float.class)) {
                return adaptee.cast(num.floatValue());
            } else if (adaptee.isAssignableFrom(Integer.class)) {
                return adaptee.cast(num.intValue());
            } else if (adaptee.isAssignableFrom(Long.class)) {
                return adaptee.cast(num.longValue());
            } else if (adaptee.isAssignableFrom(String.class)) {
                return adaptee.cast(num.toString());
            } else {
                throw new IllegalArgumentException();
            }
        } else if (attribute instanceof String) {
            if (adaptee.isAssignableFrom(Double.class)) {
                try {
                    Double parsed = Double.parseDouble((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(Float.class)) {
                try {
                    Float parsed = Float.parseFloat((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(Integer.class)) {
                try {
                    Integer parsed = Integer.parseInt((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(String.class)) {
                return adaptee.cast(attribute);
            } else {
                throw new IllegalArgumentException();
            }
        } else if (attribute instanceof Geometry) {
            return null;
        } else {
            throw new IllegalArgumentException("Can't adapt attribute of type: " + attribute.getClass().getCanonicalName());
        }
    }
801208
public function getAttributeDbValue(AttributeMetadata $attrMeta, $value)
    {
        // Handle data type conversion, if needed.
        if ('date' === $attrMeta->dataType && $value instanceof \DateTime) {
            return new \MongoDate($value->getTimestamp(), $value->format('u'));
        }
        if ('array' === $attrMeta->dataType && empty($value)) {
            return;
        }
        if ('object' === $attrMeta->dataType) {
            $array = (array) $value;
            return empty($array) ? null : $value;
        }
        return $value;
    }
485071
private function convertDataForConfig(SchemaSetupInterface $setup, $connection)
    {
        $configTable = $setup->getTable('core_config_data');
        //customer and order custom attributes from config
        $select = $connection->select()->from(
            $configTable
        )->where(
            'path IN (?)',
            [
                'connector_automation/order_status_automation/program',
                'connector_data_mapping/customer_data/custom_attributes'
            ]
        );
        $rows = $setup->getConnection()->fetchAssoc($select);

        $serializedRows = array_filter($rows, function ($row) {
            return $this->isSerialized($row['value']);
        });

        foreach ($serializedRows as $id => $serializedRow) {
            $convertedValue = $this->json->serialize($this->unserialize($serializedRow['value']));
            $bind = ['value' => $convertedValue];
            $where = [$connection->quoteIdentifier('config_id') . '=?' => $id];
            $connection->update($configTable, $bind, $where);
        }
    }
833460
public function getLocaleCode($store)
    {
        $configPath = self::LOCALE_CODE_CONFIG_XML_PATH;
        $scopeType  = ScopeInterface::SCOPE_STORES;
        $store      = $this->getStore($store);

        return $this->scopeConfig->getValue($configPath, $scopeType, $store);
    }
802033
function list(store, attrs) {
      // Process store data filters and lists
      StoreMemory.processData(store, attrs);
      // Trigger onSourceChanged event
      vcomet.triggerCallback("onSourceChanged", store);
      return store.data;
    }