| @@ 253-272 (lines=20) @@ | ||
| 250 | * |
|
| 251 | * @return string[] |
|
| 252 | */ |
|
| 253 | protected function readBelongsToManyRelationshipIdentifiers( |
|
| 254 | $identifier, |
|
| 255 | string $intTableName, |
|
| 256 | string $intPrimaryKeyName, |
|
| 257 | string $intForeignKeyName |
|
| 258 | ): array { |
|
| 259 | $connection = $this->getConnection(); |
|
| 260 | $query = $connection->createQueryBuilder(); |
|
| 261 | ||
| 262 | $query |
|
| 263 | ->select($intForeignKeyName) |
|
| 264 | ->from($intTableName) |
|
| 265 | ->where($intPrimaryKeyName . '=' . $this->createTypedParameter($query, $identifier)); |
|
| 266 | ||
| 267 | $statement = $query->execute(); |
|
| 268 | $statement->setFetchMode(PDO::FETCH_NUM); |
|
| 269 | $result = array_column($statement->fetchAll(), 0); |
|
| 270 | ||
| 271 | return $result; |
|
| 272 | } |
|
| 273 | ||
| 274 | /** |
|
| 275 | * @param string|int $identifier |
|
| @@ 282-301 (lines=20) @@ | ||
| 279 | * |
|
| 280 | * @return string[] |
|
| 281 | */ |
|
| 282 | protected function readHasManyRelationshipColumn( |
|
| 283 | $identifier, |
|
| 284 | string $hasManyTableName, |
|
| 285 | string $hasManyColumn, |
|
| 286 | string $hasManyFkName |
|
| 287 | ): array { |
|
| 288 | $connection = $this->getConnection(); |
|
| 289 | $query = $connection->createQueryBuilder(); |
|
| 290 | ||
| 291 | $query |
|
| 292 | ->select($hasManyColumn) |
|
| 293 | ->from($hasManyTableName) |
|
| 294 | ->where($hasManyFkName . '=' . $this->createTypedParameter($query, $identifier)); |
|
| 295 | ||
| 296 | $statement = $query->execute(); |
|
| 297 | $statement->setFetchMode(PDO::FETCH_NUM); |
|
| 298 | $result = array_column($statement->fetchAll(), 0); |
|
| 299 | ||
| 300 | return $result; |
|
| 301 | } |
|
| 302 | ||
| 303 | /** |
|
| 304 | * @param string $intTableName |
|