. */ namespace SP\Services; use SP\DataModel\ItemSearchData; /** * Interface ServiceItemInterface * * @package SP\Services */ interface ServiceItemInterface { /** * Creates an item * * @return mixed */ public function create(); /** * Updates an item * * @return mixed */ public function update($id); /** * 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 * * @return bool */ public function checkDuplicatedOnUpdate(); /** * Checks whether the item is duplicated on adding * * @return bool */ public function checkDuplicatedOnAdd(); /** * Searches for items by a given filter * * @param ItemSearchData $SearchData * @return mixed */ public function search(ItemSearchData $SearchData); }