Used to get values in a simple way

@param string     $attributeCode
@param array|null $context

@throws InvalidValueDataException
@throws MissingAttributeException
@throws ContextException

@return mixed
323464
public function get($attributeCode, array $context = null)
    {
        $attribute = $this->getAttribute($attributeCode);

        $getter = 'get'.ucfirst($attributeCode);
        if (method_exists($this, $getter)) {
            return $this->$getter($context);
        }

        if ($attribute->isCollection()) {
            return $this->getValuesData($attribute, $context);
        }

        return $this->getValueData($attribute, $context);
    }
1034398
private function getAttributeValueAlias($attributeCode, $storeId = null)
    {
        $returnValue = $attributeCode;
        if ($storeId !== null) {
            $returnValue .= '_' . $storeId;
        }
        return $returnValue;
    }
752033
public function getValueData(AttributeInterface $attribute, array $context = null)
    {
        $valuesData = $this->getValuesData($attribute, $context);

        return 0 === \count($valuesData) ? null : $valuesData->first();
    }
638754
public function getAttribute($attributeKey)
    {
        $hasReservedPrefix = strpos($attributeKey, self::RESERVED_ATTRIBUTE_PREFIX) === 0;

        if (isset($this->_attributeKeyMap[$attributeKey])) {
            if ($hasReservedPrefix) {
                $this->_logger->log(
                    Logger::WARNING,
                    sprintf('Attribute %s unexpectedly has reserved prefix %s; using attribute ID instead of reserved attribute name.', $attributeKey, self::RESERVED_ATTRIBUTE_PREFIX)
                );
            }

            return $this->_attributeKeyMap[$attributeKey];
        }

        if ($hasReservedPrefix) {
            return new Attribute($attributeKey, $attributeKey);
        }

        $this->_logger->log(Logger::ERROR, sprintf('Attribute key "%s" is not in datafile.', $attributeKey));
        $this->_errorHandler->handleError(new InvalidAttributeException('Provided attribute is not in datafile.'));
        
        return null;
    }
169852
public function remove($attributeCode, $value, array $context = null)
    {
        $attribute = $this->getAttribute($attributeCode);

        $method = 'remove'.ucfirst($attributeCode);
        if (method_exists($this, $method)) {
            return $this->$method($value, $context);
        }

        return $this->removeValueData($attribute, $value, $context);
    }
858783
public function validate( string $attributeName, $attributeValue ) : ValidationResult
   {

      $result = new ValidationResult();

      if ( false === $this->has( $attributeName ) )
      {
         // Unknown argument name
         return $result
            ->setErrorMessage( 'Unknown Driver attribute name "' . $attributeName . '"!' );
      }

      if ( $this->_attributes[ $attributeName ]->validateValue( $attributeValue ) )
      {
         // The value is valid we are done here
         return $result
            ->setIsKnown( true )
            ->setIsValidValue( true )
            ->setValue( $attributeValue );
      }

      if ( $this->_attributes[ $attributeName ]->hasDefaultValue() )
      {
         // The defined value is not valid, but a default value is defined, that is used now
         return $result
            ->setIsKnown( true )
            ->setValue( $this->_attributes[ $attributeName ]->getDefaultValue() );
      }

      return $result
         ->setIsKnown( true )
         ->setErrorMessage( 'Unknown Driver argument "' . $attributeName . '" value "' . $attributeValue . '"!' );

   }
594271
protected function setHttpCode($httpCode = null)
    {
        if ($httpCode !== null) {
            $this->httpCode = (int) $httpCode;

            if (!HttpCode::exists($this->httpCode)) {
                throw new \DomainException('Http Code does not exist! (code: ' . $this->httpCode . ')');
            }
        }

        return $this;
    }
774054
public function getProductLinkAttributeByLinkTypeCodeAndAttributeCode($linkTypeCode, $attributeCode)
    {

        // map the link type code => ID
        $linkTypeId = $this->mapLinkTypeCodeToLinkTypeId($linkTypeCode);

        // try to load the link attribute with the passed link type ID and attribute code
        foreach ($this->linkAttributes as $linkAttribute) {
            if ($linkAttribute[MemberNames::LINK_TYPE_ID] === $linkTypeId &&
                $linkAttribute[MemberNames::PRODUCT_LINK_ATTRIBUTE_CODE] === $attributeCode
            ) {
                // return the matching link attribute
                return $linkAttribute;
            }
        }
    }
891022
public function getConfigurationEntityFromCode($code)
    {
        $dbConfiguration = IndexEngineIndexQuery::create()->findOneByCode($code);

        if (null === $dbConfiguration) {
            throw new InvalidArgumentException(sprintf("The index configuration code '%s' doesn't exist", $code));
        }

        return $this->getConfigurationEntityFromPropelEntity($dbConfiguration);
    }
631060
private function getMinimumShouldMatch($scopeCode)
    {
        $path = self::BASE_RELEVANCE_CONFIG_XML_PREFIX . "/" . self::MINIMUM_SHOULD_MATCH_CONFIG_XML_PATH;

        return $this->getConfigValue($path, $scopeCode);
    }
628845
public function getContextFile($context, $langcode)
    {
        if (empty($context)) {
            return '';
        }

        static $files = array();

        if (!isset($files["$context$langcode"])) {
            $filename = $this->getFilenameFromContext($context);
            $directory = $this->getCompiledDirectory($langcode);
            $files["$context$langcode"] = "$directory/$filename.csv";
        }

        return $files["$context$langcode"];
    }
515822
public function getValuesData(AttributeInterface $attribute, array $context = null)
    {
        $this->checkAttribute($attribute);
        $valuesData = new ArrayCollection();
        try {
            foreach ($this->getValues($attribute, $context) as $value) {
                $valuesData->add($value->getValueData());
            }
        } catch (ExceptionInterface $e) {
            throw new InvalidValueDataException("Unable to access data for attribute {$attribute->getCode()}", 0, $e);
        }


        return $valuesData;
    }
600418
public function getAttribute(AttributeType $attributeType): Attribute
    {
        $attribute = null;

        $this->attributes->filter(function ($attr) use ($attributeType, &$attribute) {
            if ($attr->getAttributeType() === $attributeType) {
                $attribute = $attr;
            }
        });

        if ($attribute === null) {
            throw new InvalidArgumentException(sprintf('Attribute with name « %s » not found for product « %s »', $attributeName, $this->getName()));
        }

        return $attribute;
    }
1207777
private function getContext($contextCode)
    {
        if (empty($contextCode)) {
            $contextCode = ContextInterface::DEFAULT_CONTEXT;
        }

        if ($contextCode instanceof ContextInterface) {
            return $contextCode;
        }

        $context = $this->contextManager->find($contextCode);

        if (!$context instanceof ContextInterface) {
            $context = $this->contextManager->create();

            $context->setId($contextCode);
            $context->setName($contextCode);
            $context->setEnabled(true);

            $this->contextManager->save($context);
        }

        return $context;
    }
977751
public function getRefererValues(
        FamilyInterface $family = null,
        AttributeInterface $attribute = null,
        array $context = null
    ) {
        if (null === $family && null === $attribute && null === $context) {
            return $this->refererValues;
        }
        $values = new ArrayCollection();
        if ($context) {
            $context = array_merge($this->getCurrentContext(), $context);
        }

        foreach ($this->refererValues as $refererValue) {
            if ($attribute && $attribute->getCode() !== $refererValue->getAttributeCode()) {
                continue;
            }
            if ($family && $family->getCode() !== $refererValue->getData()->getFamilyCode()) {
                continue;
            }
            if ($context && !$refererValue->getAttribute()->isContextMatching($refererValue, $context)) {
                continue;
            }
            $values[] = $refererValue;
        }

        return $values;
    }
102655
public static function valueOf($code = self::NONE)
    {
        if (self::isValidCode($code)) {
            $details = self::getDetails($code);
            $code = $details['code'];
            $isoStatus = $details['isoStatus'];
            $decimalDigits = $details['decimalDigits'];
            $name = $details['name'];

            return new Currency($code, $isoStatus, $decimalDigits, $name);
        } else {
            throw new \InvalidArgumentException('Unknown currency code \'' . $code . '\'.');
        }
    }
144945
public function getAttributeItem( $code )
	{
		$map = $this->_getAttributeMap();

		if( isset( $map[ $code ] ) ) {
			return $map[ $code ];
		}

		return null;
	}