1 | <?php namespace Nord\Lumen\Doctrine\ORM; |
||
5 | class NamingStrategy implements NamingStrategyContract |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * @inheritdoc |
||
10 | */ |
||
11 | public function classToTableName($className) |
||
15 | |||
16 | |||
17 | /** |
||
18 | * @inheritdoc |
||
19 | */ |
||
20 | public function propertyToColumnName($propertyName, $className = null) |
||
24 | |||
25 | |||
26 | /** |
||
27 | * @inheritdoc |
||
28 | */ |
||
29 | public function embeddedFieldToColumnName($propertyName, $embeddedColumnName, $className = null, $embeddedClassName = null) |
||
33 | |||
34 | |||
35 | /** |
||
36 | * @inheritdoc |
||
37 | */ |
||
38 | public function referenceColumnName() |
||
42 | |||
43 | |||
44 | /** |
||
45 | * @inheritdoc |
||
46 | */ |
||
47 | public function joinColumnName($propertyName) |
||
51 | |||
52 | |||
53 | /** |
||
54 | * @inheritdoc |
||
55 | */ |
||
56 | public function joinTableName($sourceEntity, $targetEntity, $propertyName = null) |
||
60 | |||
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | */ |
||
65 | public function joinKeyColumnName($entityName, $referencedColumnName = null) |
||
66 | { |
||
67 | return $this->normalizeClassName($entityName) . '_' . ($referencedColumnName ?: $this->referenceColumnName()); |
||
68 | } |
||
69 | |||
70 | |||
71 | /** |
||
72 | * @param string $className |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | private function normalizeClassName($className) |
||
80 | } |
||
81 |