@@ 103-116 (lines=14) @@ | ||
100 | * |
|
101 | * @return string |
|
102 | */ |
|
103 | public static function getJoinRelationship(Join $join) : string |
|
104 | { |
|
105 | static $relationshipProperty = null; |
|
106 | static $initialized = false; |
|
107 | ||
108 | if (!$initialized && !method_exists(Join::class, 'getJoin')) { |
|
109 | $relationshipProperty = new \ReflectionProperty(Join::class, '_join'); |
|
110 | $relationshipProperty->setAccessible(true); |
|
111 | ||
112 | $initialized = true; |
|
113 | } |
|
114 | ||
115 | return (null === $relationshipProperty) ? $join->getJoin() : $relationshipProperty->getValue($join); |
|
116 | } |
|
117 | ||
118 | /** |
|
119 | * Gets the alias from a Join expression. |
|
@@ 125-138 (lines=14) @@ | ||
122 | * |
|
123 | * @return string |
|
124 | */ |
|
125 | public static function getJoinAlias(Join $join) : string |
|
126 | { |
|
127 | static $aliasProperty = null; |
|
128 | static $initialized = false; |
|
129 | ||
130 | if (!$initialized && !method_exists(Join::class, 'getAlias')) { |
|
131 | $aliasProperty = new \ReflectionProperty(Join::class, '_alias'); |
|
132 | $aliasProperty->setAccessible(true); |
|
133 | ||
134 | $initialized = true; |
|
135 | } |
|
136 | ||
137 | return (null === $aliasProperty) ? $join->getAlias() : $aliasProperty->getValue($join); |
|
138 | } |
|
139 | ||
140 | /** |
|
141 | * Gets the parts from an OrderBy expression. |
|
@@ 147-160 (lines=14) @@ | ||
144 | * |
|
145 | * @return string[] |
|
146 | */ |
|
147 | public static function getOrderByParts(OrderBy $orderBy) : array |
|
148 | { |
|
149 | static $partsProperty = null; |
|
150 | static $initialized = false; |
|
151 | ||
152 | if (!$initialized && !method_exists(OrderBy::class, 'getParts')) { |
|
153 | $partsProperty = new \ReflectionProperty(OrderBy::class, '_parts'); |
|
154 | $partsProperty->setAccessible(true); |
|
155 | ||
156 | $initialized = true; |
|
157 | } |
|
158 | ||
159 | return (null === $partsProperty) ? $orderBy->getParts() : $partsProperty->getValue($orderBy); |
|
160 | } |
|
161 | } |
|
162 |