* @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\Controller; use PrestaShop\Module\PsAccounts\Exception\Http\NotFoundException; use Shop; class AbstractShopRestController extends AbstractRestController { /** * @var string */ public $resourceId = 'shop_id'; /** * @param int $id * * @return Shop * * @throws \Exception */ public function bindResource($id) { $shop = new Shop($id); if (!$shop->id) { throw new NotFoundException('Shop not found [' . $id . ']'); } return $shop; } }