Retrieve an object by ID

@param string $resource The resource - e.g. ''IXP''
@param int    $id       ID of the object
@return ApiResouce
@throws Error\NotFound If the requested object does not exist
503449
public static function retrieve( $resource, $id )
    {
        $instance = self::resolveClass( $resource, $id );
        $instance->refresh( $resource );
        return $instance;
    }
761353
public function get($id)
    {
        if ($this->has($id) == false) {
            throw new ServiceNotFoundException($id); 
        } 

        if (\is_object($this->services[$id]) == false || method_exists($this->services[$id], '__invoke') == false) {
            return $this->services[$id];
        }
        $this->services[$id] = $this->services[$id]($this); 
    
        return $this->services[$id];
    }
633345
public function getForResource($resource)
    {
        $resourceName = $this->resourceName($resource);

        if (isset($this->resourceFactories[$resourceName])) {
            return $this->resourceFactories[$resourceName];
        }

        throw new HandlerNotFoundException("No handler found for resource '$resourceName'");

    }
1079106
protected function byIdOrFail($id)
    {
        $model = $this->byId($id);
        if (empty($model)) {
            throw new ResourceNotFoundException();
        }

        return $model;
    }
1300997
public function get($resource = null, $data = array())
    {
        return $this->call($resource, AnHttpRequest::GET, $data);
    }
1142911
public function get($id) {
		if (! $this->connectionCheckStatus) {
			$this->addServer();
		}
		
		$result = $this->getClient()->get($this->prepareId($id));
		
		return $result === false ? null : $result;
	}
469541
public function get($id)
    {
        if (!is_string($id)) {
            throw new ContainerException('$id must be a string');
        }

        if (!isset($this->definitions[$id])) {
            throw new NotFoundException("Unresolvable ".$id);
        }

        return $this->definitions[$id];
    }
1264713
public function get($id)
    {
        if (isset($this->keys[$id])) {
            $this->requested[$id] = true;
            if (isset($this->callables[$id])) {
                $this->values[$id] = $this->callables[$id]();
                unset($this->callables[$id]);
            }
            return $this->values[$id];
        }
        throw new ContainerNotFoundException('Container identifier[' . $id . '] not found.');
    }
1332805
public function getResource(string $id = null): array
    {
        if ($id) {
            if (is_numeric($id)) {
                $filter = array_filter($this->resource, function ($row) use ($id) { return $row['id'] == $id; });
                return (array) array_pop($filter);
            }
            return (array) ($this->resource[$id] ?? []);
        }
        return $this->resource;
    }
196033
public function get(string $id)
    {
        if ($this->can('get')) {
            $this->flow->getLogger()->debug("Retrieving Resource: $this->id => $id");
            return $this->make(
                $this->performGet($this->id, $id)
            );
        }
        throw new \BadMethodCallException('Method '.__FUNCTION__.' does not exist');
    }
545173
protected function execute(ApiResourceInterface $resource)
    {
        $client = $resource->getHttpClient();

        if (is_null($options = $this->requestOptions())) {
            return $client->request($this->requestMethod(), $this->requestUrl($resource));
        }

        return $client->request($this->requestMethod(), $this->requestUrl($resource), $options);
    }
1368406
public function getById($id)
    {
        return new SPList(
            $this->getContext(),
            new ResourcePathServiceOperation($this->getContext(),$this->getResourcePath(),"getById",array($id))
        );
    }
14937
public function getById($id)
    {
        return new View(
            $this->getContext(),
            new ResourcePathServiceOperation($this->getContext(),$this->getResourcePath(),"getById",array($id))
        );
    }
1127626
private function load($id = null)
    {

        $this->initialize();
        $this->id = $id;

        return $this->getDataConnector()->loadResourceLink($this);

    }
30106
public function get($id)
    {
        if (!$this->has($id)) {
            throw new Exception\NotFoundException;
        }
        if (!$this->isReady($id)) {
            $this->instantiate($id);
        }
        return $this->instances[$id];
    }
169760
public function resource($name, $resource = null)
    {
        if ($resource) {
            $this->addResource($name, $resource);
        } else {
            return $this->getResource($name);
        }
    }
590329
public function findByIntOrFail(int $id): Model
    {
        $model = $this->findByInt($id);
        if (empty($model)) {
            throw new ResourceNotFoundException();
        }

        return $model;
    }