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
2declare(strict_types=1);
3/**
4 * Pop PHP Framework (https://www.popphp.org/)
5 *
6 * @link       https://github.com/popphp/popphp-framework
7 * @author     Nick Sagona, III <nick@popphp.org>
8 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
9 * @license    https://www.popphp.org/license     New BSD License
10 */
11
12/**
13 * @namespace
14 */
15namespace Pop\Db\Record\Relationships;
16
17/**
18 * Relationship class for "has one" relationships
19 *
20 * @category   Pop
21 * @package    Pop\Db
22 * @author     Nick Sagona, III <nick@popphp.org>
23 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
24 * @license    https://www.popphp.org/license     New BSD License
25 * @version    7.0.0
26 */
27interface RelationshipInterface
28{
29
30    /**
31     * Get foreign table
32     *
33     * @return string|null
34     */
35    public function getForeignTable(): string|null;
36
37    /**
38     * Get foreign key
39     *
40     * @return string|array|null
41     */
42    public function getForeignKey(): string|array|null;
43
44    /**
45     * Get options
46     *
47     * @return array|null
48     */
49    public function getOptions(): array|null;
50
51    /**
52     * Get eager relationships
53     *
54     * @param  array $ids
55     * @throws Exception
56     * @return array
57     */
58    public function getEagerRelationships(array $ids): array;
59
60    /**
61     * Get the value to use when no eager-loaded result exists for a given leaf record
62     *
63     * @return mixed
64     */
65    public function getEmptyRelationshipValue(): mixed;
66
67}