protected function resolveAttributeName($attribute)
{
$result = preg_grep("/^{$attribute}\$/i", array_keys($this->attributes));
if (empty($result)) {
throw new InvalidArgumentException(sprintf('Unable to resolve attribute "%s".', $attribute));
}
return reset($result);
}