39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Hura8\Interfaces;
|
||
|
|
|
||
|
|
interface iEntityLanguageModel
|
||
|
|
{
|
||
|
|
// create a necessary language table to hold the translated data for the language
|
||
|
|
public function createTableLang(): AppResponse;
|
||
|
|
|
||
|
|
public function setLanguage(string $language): bool;
|
||
|
|
|
||
|
|
// any fields to have language: title, summary, description, price, etc...
|
||
|
|
public function setLanguageFields(array $language_fields);
|
||
|
|
|
||
|
|
public function getLanguageFields() : array ;
|
||
|
|
|
||
|
|
public function getEntityType() : string ;
|
||
|
|
|
||
|
|
public function update($id, array $new_input_info, $search_keyword = "") : AppResponse;
|
||
|
|
|
||
|
|
public function deleteAll($id): AppResponse;
|
||
|
|
|
||
|
|
public function delete($id): AppResponse;
|
||
|
|
|
||
|
|
public function getListByIds(array $list_id): array;
|
||
|
|
|
||
|
|
// get list of ids which are in the language table. This is to filter which records have been translated and which not in the main table
|
||
|
|
// this is limited to 50k items. Which means for item_type having more than 50k records, this checking method is not suitable
|
||
|
|
public function getTranslatedIds() : array;
|
||
|
|
|
||
|
|
public function getInfo($id): ?array;
|
||
|
|
|
||
|
|
public function getTotal(array $condition): int;
|
||
|
|
|
||
|
|
// get empty/default item for form
|
||
|
|
public function getEmptyInfo(): array;
|
||
|
|
|
||
|
|
}
|