File: D:/HostingSpaces/SBogers10/vangogh.komma.pro/app/Komma/Shop/Catalog/Kms/CatalogServiceInterface.php
<?php
/**
* Created by PhpStorm.
* User: julesgraus
* Date: 27/02/2018
* Time: 14:11
*/
namespace App\Komma\Shop\Catalog\Kms;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
/**
* Builds the product catalog for the frontend
*
* Class CatalogService
* @package App\Komma\Shop\Catalog
*/
interface CatalogServiceInterface
{
/**
* Generate the model index that can be searched trough, paginated, sorted etc.
* It will use the attributes keys as attribute names on the models retrieved from all catalogableServiceInterface implementations.
* These attribute keys will be set with their values on the CatalogIndexModel that wil be saved to the database.
* If the catalog model does not have one of the attributes that are specified in the attributes value it will
*/
public function createIndex();
/**
* Clear the catalog.
*/
public function clearIndex();
/**
* Clean up old catalog index items that reference non existing models.
*/
public function doHouseKeeping();
/**
* Create the catalog table. You can use this in your migrations
*/
public function migrate();
/**
* Remove the catalog table. You can use this in your migrations
*/
public function rollback();
/**
* Returns CatalogIndexModels that are linked to a category that is specified by id.
* With the paginate option you can specify how much items should be visible per page/
*
* @param int $categoryID
* @param int|null $paginate
* @return \Illuminate\Database\Eloquent\Collection|LengthAwarePaginator
*/
public function getCatalogItemsByCategoryID(int $categoryID, int $paginate = null);
}