1<?php
2/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4namespace ILIAS\Refinery\Logical;
5
6use ILIAS\Data\Factory;
7use ILIAS\Refinery\Constraint;
8use ILIAS\Refinery\Logical\LogicalOr;
9use ILIAS\Refinery\Logical\Not;
10use ILIAS\Refinery\Logical\Parallel;
11use ILIAS\Refinery\Logical\Sequential;
12
13/**
14 * @author  Niels Theen <ntheen@databay.de>
15 */
16class Group
17{
18    /**
19     * @var Factory
20     */
21    private $dataFactory;
22
23    /**
24     * @var \ilLanguage
25     */
26    private $language;
27
28    public function __construct(Factory $dataFactory, \ilLanguage $language)
29    {
30        $this->dataFactory = $dataFactory;
31        $this->language = $language;
32    }
33
34    /**
35     * @param array $other
36     * @return LogicalOr
37     */
38    public function logicalOr(array $other) : LogicalOr
39    {
40        return new LogicalOr($other, $this->dataFactory, $this->language);
41    }
42
43    /**
44     * @param Constraint $constraint
45     * @return Not
46     */
47    public function not(Constraint $constraint) : Not
48    {
49        return new Not($constraint, $this->dataFactory, $this->language);
50    }
51
52    /**
53     * @param array $constraints
54     * @return Parallel
55     */
56    public function parallel(array $constraints) : Parallel
57    {
58        return new Parallel($constraints, $this->dataFactory, $this->language);
59    }
60
61    /**
62     * @param array $constraints
63     * @return Sequential
64     */
65    public function sequential(array $constraints) : Sequential
66    {
67        return new Sequential($constraints, $this->dataFactory, $this->language);
68    }
69}
70