* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 */ namespace PrestaShop\Module\PsAccounts\Api\Controller; use PrestaShop\Module\PsAccounts\Exception\Http\NotFoundException; use Shop; class AbstractShopRestController extends AbstractRestController { /** * @var string */ public $resourceId = 'shop_id'; /** * @param mixed $id * * @return Shop */ protected function buildResource($id) { $shop = new Shop($id); if (!$shop->id) { throw new NotFoundException('Shop not found [' . $id . ']'); } return $shop; } }