/** * * @param string $name * @param scalar $default * * @return scalar The attribute value if set, of $default if not */ public function getAttribute($name, $default = null) { return $this->cache->has($name) ? $this->cache->fetch($name) : $default; }