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
;
15 * Merge operation between two catalogues.
17 * @author Jean-François Simon <contact@jfsimon.fr>
19 class MergeOperation
extends AbstractOperation
24 protected function processDomain($domain)
26 $this->messages
[$domain] = array(
29 'obsolete' => array(),
32 foreach ($this->source
->all($domain) as $id => $message) {
33 $this->messages
[$domain]['all'][$id] = $message;
34 $this->result
->add(array($id => $message), $domain);
37 foreach ($this->target
->all($domain) as $id => $message) {
38 if (!$this->source
->has($id, $domain)) {
39 $this->messages
[$domain]['all'][$id] = $message;
40 $this->messages
[$domain]['new'][$id] = $message;
41 $this->result
->add(array($id => $message), $domain);