forked from ezsystems/ezpublish-spi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Handler.php
97 lines (87 loc) · 2.68 KB
/
Handler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/**
* File containing the Language Handler interface.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace eZ\Publish\SPI\Persistence\Content\Language;
use eZ\Publish\SPI\Persistence\Content\Language;
/**
* Language Handler interface.
*/
interface Handler
{
/**
* Create a new language.
*
* @param \eZ\Publish\SPI\Persistence\Content\Language\CreateStruct $struct
*
* @return \eZ\Publish\SPI\Persistence\Content\Language
*/
public function create(CreateStruct $struct);
/**
* Update language.
*
* @param \eZ\Publish\SPI\Persistence\Content\Language $struct
*/
public function update(Language $struct);
/**
* Get language by id.
*
* @param mixed $id
*
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If language could not be found by $id
*
* @return \eZ\Publish\SPI\Persistence\Content\Language
*/
public function load($id);
/**
* Get list of languages by id.
*
* Missing items (NotFound) will be missing from the returned iterable and not cause an exception, it's up
* to calling logic to determine if this should cause exception or not.
*
* @param array $ids
*
* @return \eZ\Publish\SPI\Persistence\Content\Language[]|iterable
*/
public function loadList(array $ids): iterable;
/**
* Get language by Language Code (eg: eng-GB).
*
* @param string $languageCode
*
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If language could not be found by $languageCode
*
* @return \eZ\Publish\SPI\Persistence\Content\Language
*/
public function loadByLanguageCode($languageCode);
/**
* Get list of languages by Language Code (eg: eng-GB).
*
* Missing items (NotFound) will be missing from the returned iterable and not cause an exception, it's up
* to calling logic to determine if this should cause exception or not.
*
* @param string[] $languageCodes
*
* @return \eZ\Publish\SPI\Persistence\Content\Language[]|iterable
*/
public function loadListByLanguageCodes(array $languageCodes): iterable;
/**
* Get all languages.
*
* Return list of languages where key of hash is language code.
*
* @return \eZ\Publish\SPI\Persistence\Content\Language[]
*/
public function loadAll();
/**
* Delete a language.
*
* @throws \LogicException If language could not be deleted
*
* @param mixed $id
*/
public function delete($id);
}