Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /*
|
Chris@0
|
4 * This file is part of the Symfony package.
|
Chris@0
|
5 *
|
Chris@0
|
6 * (c) Fabien Potencier <fabien@symfony.com>
|
Chris@0
|
7 *
|
Chris@0
|
8 * For the full copyright and license information, please view the LICENSE
|
Chris@0
|
9 * file that was distributed with this source code.
|
Chris@0
|
10 */
|
Chris@0
|
11
|
Chris@0
|
12 namespace Symfony\Component\Translation\Catalogue;
|
Chris@0
|
13
|
Chris@0
|
14 use Symfony\Component\Translation\MessageCatalogueInterface;
|
Chris@0
|
15
|
Chris@0
|
16 /**
|
Chris@0
|
17 * Represents an operation on catalogue(s).
|
Chris@0
|
18 *
|
Chris@0
|
19 * An instance of this interface performs an operation on one or more catalogues and
|
Chris@0
|
20 * stores intermediate and final results of the operation.
|
Chris@0
|
21 *
|
Chris@0
|
22 * The first catalogue in its argument(s) is called the 'source catalogue' or 'source' and
|
Chris@0
|
23 * the following results are stored:
|
Chris@0
|
24 *
|
Chris@0
|
25 * Messages: also called 'all', are valid messages for the given domain after the operation is performed.
|
Chris@0
|
26 *
|
Chris@0
|
27 * New Messages: also called 'new' (new = all ∖ source = {x: x ∈ all ∧ x ∉ source}).
|
Chris@0
|
28 *
|
Chris@0
|
29 * Obsolete Messages: also called 'obsolete' (obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ all}).
|
Chris@0
|
30 *
|
Chris@0
|
31 * Result: also called 'result', is the resulting catalogue for the given domain that holds the same messages as 'all'.
|
Chris@0
|
32 *
|
Chris@0
|
33 * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
|
Chris@0
|
34 */
|
Chris@0
|
35 interface OperationInterface
|
Chris@0
|
36 {
|
Chris@0
|
37 /**
|
Chris@0
|
38 * Returns domains affected by operation.
|
Chris@0
|
39 *
|
Chris@0
|
40 * @return array
|
Chris@0
|
41 */
|
Chris@0
|
42 public function getDomains();
|
Chris@0
|
43
|
Chris@0
|
44 /**
|
Chris@0
|
45 * Returns all valid messages ('all') after operation.
|
Chris@0
|
46 *
|
Chris@0
|
47 * @param string $domain
|
Chris@0
|
48 *
|
Chris@0
|
49 * @return array
|
Chris@0
|
50 */
|
Chris@0
|
51 public function getMessages($domain);
|
Chris@0
|
52
|
Chris@0
|
53 /**
|
Chris@0
|
54 * Returns new messages ('new') after operation.
|
Chris@0
|
55 *
|
Chris@0
|
56 * @param string $domain
|
Chris@0
|
57 *
|
Chris@0
|
58 * @return array
|
Chris@0
|
59 */
|
Chris@0
|
60 public function getNewMessages($domain);
|
Chris@0
|
61
|
Chris@0
|
62 /**
|
Chris@0
|
63 * Returns obsolete messages ('obsolete') after operation.
|
Chris@0
|
64 *
|
Chris@0
|
65 * @param string $domain
|
Chris@0
|
66 *
|
Chris@0
|
67 * @return array
|
Chris@0
|
68 */
|
Chris@0
|
69 public function getObsoleteMessages($domain);
|
Chris@0
|
70
|
Chris@0
|
71 /**
|
Chris@0
|
72 * Returns resulting catalogue ('result').
|
Chris@0
|
73 *
|
Chris@0
|
74 * @return MessageCatalogueInterface
|
Chris@0
|
75 */
|
Chris@0
|
76 public function getResult();
|
Chris@0
|
77 }
|