public function getValue(AttributeInterface $attribute, array $context = null)
    {
        $values = $this->getValues($attribute, $context);

        return 0 === \count($values) ? null : $values->first();
    }
public function getValue(AttributeInterface $attribute, array $context = null)
    {
        $values = $this->getValues($attribute, $context);

        return 0 === \count($values) ? null : $values->first();
    }
public function getValue ( AttributeInterface $ attribute , array $ context = null ) { $ values = $ this -> getValues ( $ attribute , $ context ) ; return 0 === \ count ( $ values ) ? null : $ values -> first ( ) ; }
Return first value found for attribute code in value collection

@param AttributeInterface $attribute
@param array|null         $context

@throws InvalidValueDataException
@throws MissingAttributeException
@throws ContextException

@return null|ValueInterface
Return first value found for attribute code in value collection