public function getAttribute($key)
    {
        if (isset($this->repositories[$key])) {
            $className = str_replace('\\', '', $this->repositories[$key]);

            if ($repository = $this->cache->get("repositories.{$className}.{$this->id}.{$key}")) {
                return $repository;
            }

            $class = $this->repositories[$key];

            return $this->cache->set(
                "repositories.{$className}.{$this->id}.{$key}",
                new $class(
                    $this->http,
                    $this->cache,
                    $this->factory,
                    $this->getRepositoryAttributes()
                )
            );
        }

        if ($str = $this->checkForMutator($key, 'get')) {
            $result = $this->{$str}();

            return $result;
        }

        if (! isset($this->attributes[$key])) {
            return;
        }

        return $this->attributes[$key];
    }
public function getAttribute($key)
    {
        if (isset($this->repositories[$key])) {
            $className = str_replace('\\', '', $this->repositories[$key]);

            if ($repository = $this->cache->get("repositories.{$className}.{$this->id}.{$key}")) {
                return $repository;
            }

            $class = $this->repositories[$key];

            return $this->cache->set(
                "repositories.{$className}.{$this->id}.{$key}",
                new $class(
                    $this->http,
                    $this->cache,
                    $this->factory,
                    $this->getRepositoryAttributes()
                )
            );
        }

        if ($str = $this->checkForMutator($key, 'get')) {
            $result = $this->{$str}();

            return $result;
        }

        if (! isset($this->attributes[$key])) {
            return;
        }

        return $this->attributes[$key];
    }
public function getAttribute ( $ key ) { if ( isset ( $ this -> repositories [ $ key ] ) ) { $ className = str_replace ( '\\' , '' , $ this -> repositories [ $ key ] ) ; if ( $ repository = $ this -> cache -> get ( "repositories.{$className}.{$this->id}.{$key}" ) ) { return $ repository ; } $ class = $ this -> repositories [ $ key ] ; return $ this -> cache -> set ( "repositories.{$className}.{$this->id}.{$key}" , new $ class ( $ this -> http , $ this -> cache , $ this -> factory , $ this -> getRepositoryAttributes ( ) ) ) ; } if ( $ str = $ this -> checkForMutator ( $ key , 'get' ) ) { $ result = $ this -> { $ str } ( ) ; return $ result ; } if ( ! isset ( $ this -> attributes [ $ key ] ) ) { return ; } return $ this -> attributes [ $ key ] ; }
Gets an attribute on the part.

@param string $key The key to the attribute.

@return mixed Either the attribute if it exists or void.
Gets an attribute on the part .