| @@ 16-32 (lines=17) @@ | ||
| 13 | /** |
|
| 14 | * @inheritdoc |
|
| 15 | */ |
|
| 16 | public function getLabelRelations(LabelName $labelName) |
|
| 17 | { |
|
| 18 | $aliases = $this->getAliases(); |
|
| 19 | $whereLabelName = SchemaConfigurator::LABEL_NAME . ' = ?'; |
|
| 20 | ||
| 21 | $queryBuilder = $this->createQueryBuilder()->select($aliases) |
|
| 22 | ->from($this->getTableName()->toNative()) |
|
| 23 | ->where($whereLabelName) |
|
| 24 | ->setParameters([$labelName->toNative()]); |
|
| 25 | ||
| 26 | $statement = $queryBuilder->execute(); |
|
| 27 | ||
| 28 | while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) { |
|
| 29 | $labelRelation = LabelRelation::fromRelationalData($row); |
|
| 30 | yield $labelRelation; |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @inheritdoc |
|
| @@ 37-59 (lines=23) @@ | ||
| 34 | /** |
|
| 35 | * @inheritdoc |
|
| 36 | */ |
|
| 37 | public function getLabelRelationsForItem(StringLiteral $relationId) |
|
| 38 | { |
|
| 39 | $aliases = $this->getAliases(); |
|
| 40 | $whereRelationId = SchemaConfigurator::RELATION_ID . ' = ?'; |
|
| 41 | ||
| 42 | $queryBuilder = $this->createQueryBuilder()->select($aliases) |
|
| 43 | ->from($this->getTableName()->toNative()) |
|
| 44 | ->where($whereRelationId) |
|
| 45 | ->setParameters( |
|
| 46 | [ |
|
| 47 | $relationId->toNative(), |
|
| 48 | ] |
|
| 49 | ); |
|
| 50 | ||
| 51 | $statement = $queryBuilder->execute(); |
|
| 52 | ||
| 53 | $labelRelations = []; |
|
| 54 | while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) { |
|
| 55 | $labelRelations[] = LabelRelation::fromRelationalData($row); |
|
| 56 | } |
|
| 57 | ||
| 58 | return $labelRelations; |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * @return array |
|