. */ namespace SP\Repositories; use SP\DataModel\ItemSearchData; /** * Interface RepositoryItemInterface * * @package SP\Repositories */ interface RepositoryItemInterface { /** * Creates an item * * @param mixed $itemData * * @return mixed */ public function create($itemData); /** * Updates an item * * @param mixed $itemData * * @return mixed */ public function update($itemData); /** * Deletes an item * * @param $id */ public function delete($id); /** * Returns the item for given id * * @param int $id * * @return mixed */ public function getById($id); /** * Returns all the items * * @return array */ public function getAll(); /** * Returns all the items for given ids * * @param array $ids * * @return array */ public function getByIdBatch(array $ids); /** * Deletes all the items for given ids * * @param array $ids * * @return $this */ public function deleteByIdBatch(array $ids); /** * Checks whether the item is in use or not * * @param $id int * * @return bool */ public function checkInUse($id); /** * Checks whether the item is duplicated on updating * * @param mixed $itemData * * @return bool */ public function checkDuplicatedOnUpdate($itemData); /** * Checks whether the item is duplicated on adding * * @param mixed $itemData * * @return bool */ public function checkDuplicatedOnAdd($itemData); /** * Searches for items by a given filter * * @param ItemSearchData $SearchData * * @return mixed */ public function search(ItemSearchData $SearchData); }