/** * Returns the resource associated with the given type or null. * * @param Type $type * * @return ResourceInterface|null */ public function getResourceFromType(Type $type) { if ('object' === $type->getType() && ($class = $type->getClass()) && ($resource = $this->resourceCollection->getResourceForEntity($class))) { return $resource; } }