4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Translation\Catalogue;
14 use Symfony\Component\Translation\MessageCatalogueInterface;
17 * Represents an operation on catalogue(s).
19 * An instance of this interface performs an operation on one or more catalogues and
20 * stores intermediate and final results of the operation.
22 * The first catalogue in its argument(s) is called the 'source catalogue' or 'source' and
23 * the following results are stored:
25 * Messages: also called 'all', are valid messages for the given domain after the operation is performed.
27 * New Messages: also called 'new' (new = all ∖ source = {x: x ∈ all ∧ x ∉ source}).
29 * Obsolete Messages: also called 'obsolete' (obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ all}).
31 * Result: also called 'result', is the resulting catalogue for the given domain that holds the same messages as 'all'.
33 * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
35 interface OperationInterface
38 * Returns domains affected by operation.
42 public function getDomains();
45 * Returns all valid messages ('all') after operation.
47 * @param string $domain
51 public function getMessages($domain);
54 * Returns new messages ('new') after operation.
56 * @param string $domain
60 public function getNewMessages($domain);
63 * Returns obsolete messages ('obsolete') after operation.
65 * @param string $domain
69 public function getObsoleteMessages($domain);
72 * Returns resulting catalogue ('result').
74 * @return MessageCatalogueInterface
76 public function getResult();