Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3 * Jingga
4 *
5 * PHP Version 8.1
6 *
7 * @package   phpOMS\Config
8 * @copyright Dennis Eichhorn
9 * @license   OMS License 2.0
10 * @version   1.0.0
11 * @link      https://jingga.app
12 */
13declare(strict_types=1);
14
15namespace phpOMS\Config;
16
17/**
18 * Options class.
19 *
20 * @package phpOMS\Config
21 * @license OMS License 2.0
22 * @link    https://jingga.app
23 * @since   1.0.0
24 */
25interface SettingsInterface extends OptionsInterface
26{
27    /**
28     * Get option.
29     *
30     * Possible usage:
31     *      - Use column key
32     *      - Use combination of module, group, account and name without column key
33     *
34     * @param null|int|int[]|string|string[] $ids     Ids
35     * @param null|string|string[]           $names   Setting name
36     * @param null|int                       $unit    Unit
37     * @param null|int                       $app     Application
38     * @param null|string                    $module  Module name
39     * @param null|int                       $group   Group id
40     * @param null|int                       $account Account id
41     *
42     * @return mixed Option value
43     *
44     * @since 1.0.0
45     */
46    public function get(
47        mixed $ids = null,
48        string | array $names = null,
49        int $unit = null,
50        int $app = null,
51        string $module = null,
52        int $group = null,
53        int $account = null
54    ) : mixed;
55
56    /**
57     * Set option by key.
58     *
59     * @param array<int, array{id?:?int, name?:?string, content:string, module?:?string, group?:?int, account?:?int}> $options Column values for filtering
60     * @param bool                                                                                                    $store   Save this Setting immediately to database
61     *
62     * @return void
63     *
64     * @since 1.0.0
65     */
66    public function set(array $options, bool $store = false) : void;
67
68    /**
69     * Save options.
70     *
71     * @param array<int, array{id?:?int, name?:?string, content:string, module?:?string, group?:?int, account?:?int}> $options Options to save
72     *
73     * @return void
74     *
75     * @since 1.0.0
76     */
77    public function save(array $options = []) : void;
78
79    /**
80     * Create option.
81     *
82     * @param array $options Options to save
83     *
84     * @return void
85     *
86     * @since 1.0.0
87     */
88    public function create(array $options = []) : void;
89}