public function getResource() { $collection = $this->getCollection(); if ($collection instanceof ApiResource) { return $collection; } return null; }