public function getAttributeValue($key)
    {
        $value = $this->getAttributeFromArray($key);
        // check if it's a enum
        if (isset($this->enums[$key]) && is_scalar($value)) {
            $enumClass = $this->enums[$key];
            return new $enumClass($value);
        }
        return parent::getAttributeValue($key);
    }
public function getAttributeValue($key)
    {
        $value = $this->getAttributeFromArray($key);
        // check if it's a enum
        if (isset($this->enums[$key]) && is_scalar($value)) {
            $enumClass = $this->enums[$key];
            return new $enumClass($value);
        }
        return parent::getAttributeValue($key);
    }
public function getAttributeValue ( $ key ) { $ value = $ this -> getAttributeFromArray ( $ key ) ; // check if it's a enum if ( isset ( $ this -> enums [ $ key ] ) && is_scalar ( $ value ) ) { $ enumClass = $ this -> enums [ $ key ] ; return new $ enumClass ( $ value ) ; } return parent :: getAttributeValue ( $ key ) ; }
Gets the value of attribute,
taking enums typecast into consideration

@param string $key Name of attribute
@return mixed
Gets the value of attribute taking enums typecast into consideration