Issues (265)

src/TableInterface.php (2 issues)

1
<?php
2
3
/**
4
 * This file is part of Cycle ORM package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\Database;
13
14
/**
15
 * Represent table schema with it's all columns, indexes and foreign keys.
16
 */
17
interface TableInterface
18
{
19
    /**
20
     * Check if table exists in database.
21
     *
22
     */
23
    public function exists(): bool;
24
25
    /**
26
     * Store specific table name (with included prefix and without schema).
27
     *
28
     * @return non-empty-string
0 ignored issues
show
Documentation Bug introduced by
The doc comment non-empty-string at position 0 could not be parsed: Unknown type name 'non-empty-string' at position 0 in non-empty-string.
Loading history...
29
     */
30
    public function getName(): string;
31
32
    /**
33
     * Store specific table name (with included prefix and schema).
34
     *
35
     */
36
    public function getFullName(): string;
37
38
    /**
39
     * Array of columns dedicated to primary index. Attention, this methods will ALWAYS return
40
     * array, even if there is only one primary key.
41
     *
42
     * @return list<non-empty-string>
0 ignored issues
show
The type Cycle\Database\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
43
     */
44
    public function getPrimaryKeys(): array;
45
46
    /**
47
     * Check if table have specified column.
48
     *
49
     * @param string $name Column name.
50
     *
51
     */
52
    public function hasColumn(string $name): bool;
53
54
    /**
55
     * Get all declared columns.
56
     *
57
     * @return ColumnInterface[]
58
     */
59
    public function getColumns(): array;
60
61
    /**
62
     * Check if table has index related to set of provided columns. Columns order does matter!
63
     *
64
     */
65
    public function hasIndex(array $columns = []): bool;
66
67
    /**
68
     * Get all table indexes.
69
     *
70
     * @return IndexInterface[]
71
     */
72
    public function getIndexes(): array;
73
74
    /**
75
     * Check if table has foreign key related to table column.
76
     *
77
     * @param array $columns Column names.
78
     *
79
     */
80
    public function hasForeignKey(array $columns): bool;
81
82
    /**
83
     * Get all table foreign keys.
84
     *
85
     * @return ForeignKeyInterface[]
86
     */
87
    public function getForeignKeys(): array;
88
89
    /**
90
     * Get list of table names current schema depends on, must include every table linked using
91
     * foreign key or other constraint. Table names MUST include prefixes.
92
     *
93
     */
94
    public function getDependencies(): array;
95
}
96