public function get($key, $default = null)
    {
        $key = $this->resolveAlias($key);

        $accessor = 'get' . $this->toCamelCase($key) . 'Value';

        $value = isset($this->data[$key]) ? $this->data[$key] : null;

        if (is_callable([$this, $accessor])) {
            return $this->$accessor($value);
        }

        if ($cast = $this->getCast($key)) {
            $value = $this->castValue($key, $value);
        }

        if ($value === null) {
            return $default;
        }

        return $value;
    }
public function get($key, $default = null)
    {
        $key = $this->resolveAlias($key);

        $accessor = 'get' . $this->toCamelCase($key) . 'Value';

        $value = isset($this->data[$key]) ? $this->data[$key] : null;

        if (is_callable([$this, $accessor])) {
            return $this->$accessor($value);
        }

        if ($cast = $this->getCast($key)) {
            $value = $this->castValue($key, $value);
        }

        if ($value === null) {
            return $default;
        }

        return $value;
    }
public function get ( $ key , $ default = null ) { $ key = $ this -> resolveAlias ( $ key ) ; $ accessor = 'get' . $ this -> toCamelCase ( $ key ) . 'Value' ; $ value = isset ( $ this -> data [ $ key ] ) ? $ this -> data [ $ key ] : null ; if ( is_callable ( [ $ this , $ accessor ] ) ) { return $ this -> $ accessor ( $ value ) ; } if ( $ cast = $ this -> getCast ( $ key ) ) { $ value = $ this -> castValue ( $ key , $ value ) ; } if ( $ value === null ) { return $ default ; } return $ value ; }
Magic getter to get a table field.

@param   string $key     The key name.
@param   null   $default The default value.

@return  mixed

@since   2.0
Magic getter to get a table field .