StorageMetadata::getKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace As3\Modlr\Persister\MongoDb;
4
5
use As3\Modlr\Metadata\Interfaces\MergeableInterface;
6
use As3\Modlr\Metadata\Interfaces\StorageLayerInterface;
7
8
/**
9
 * Defines the MongoDB storage metadata for an entity (e.g. a database object).
10
 * Should be loaded using the MetadataFactory, not instantiated directly.
11
 *
12
 * @author Jacob Bare <[email protected]>
13
 */
14
class StorageMetadata implements StorageLayerInterface
15
{
16
    /**
17
     * The database name.
18
     *
19
     * @var string
20
     */
21
    public $db;
22
23
    /**
24
     * The collection name.
25
     *
26
     * @var string
27
     */
28
    public $collection;
29
30
    /**
31
     * The ID strategy to use.
32
     * Currently object is the only valid choice.
33
     *
34
     * @todo Implement an auto-increment integer id strategy.
35
     * @var string
36
     */
37
    public $idStrategy = 'object';
38
39
    /**
40
     * Configured schemata for this entity
41
     *
42
     * @var array
43
     */
44
    public $schemata = [];
45
46
    /**
47
     * {@inheritDoc}
48
     */
49
    public function getKey()
50
    {
51
        return Persister::PERSISTER_KEY;
52
    }
53
54
    /**
55
     * {@inheritDoc}
56
     */
57
    public function merge(MergeableInterface $metadata)
58
    {
59
        return $this;
60
    }
61
}
62