Skip to content

Commit 0b300ad

Browse files
author
gluafamichl
committed
Mod: refactor: change function name getManyToOneRelationViaIntermediate to getManyToManyRelation
1 parent 47363a8 commit 0b300ad

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

src/inc/apiv2/common/AbstractModelAPI.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ final protected static function getManyToOneRelation(
118118

119119

120120
/**
121-
* Retrieve ManyToOne relalation for $objects ('parents') of type $targetFactory via 'intermidate'
121+
* Retrieve ManyToMany relation for $objects ('parents') of type $targetFactory via 'intermediate'
122122
* of $intermediateFactory joining on $joinField (between 'intermediate' and 'target'). Filtered by
123123
* $filterField at $intermediateFactory.
124124
*
@@ -131,7 +131,7 @@ final protected static function getManyToOneRelation(
131131
132132
* @return array
133133
*/
134-
final protected static function getManyToOneRelationViaIntermediate(
134+
final protected static function getManyToManyRelation(
135135
array $objects,
136136
string $objectField,
137137
object $intermediateFactory,

src/inc/apiv2/model/accessgroups.routes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
3030
/* Expand requested section */
3131
switch($expand) {
3232
case 'userMembers':
33-
return $this->getManyToOneRelationViaIntermediate(
33+
return $this->getManyToManyRelation(
3434
$objects,
3535
AccessGroup::ACCESS_GROUP_ID,
3636
Factory::getAccessGroupUserFactory(),
@@ -39,7 +39,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
3939
User::USER_ID
4040
);
4141
case 'agentMembers':
42-
return $this->getManyToOneRelationViaIntermediate(
42+
return $this->getManyToManyRelation(
4343
$objects,
4444
AccessGroup::ACCESS_GROUP_ID,
4545
Factory::getAccessGroupAgentFactory(),

src/inc/apiv2/model/agents.routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
3333
/* Expand requested section */
3434
switch($expand) {
3535
case 'accessGroups':
36-
return $this->getManyToOneRelationViaIntermediate(
36+
return $this->getManyToManyRelation(
3737
$objects,
3838
Agent::AGENT_ID,
3939
Factory::getAccessGroupAgentFactory(),

src/inc/apiv2/model/hashlists.routes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
5858
);
5959
case 'hashlists':
6060
/* PARENT_HASHLIST_ID in use in intermediate table */
61-
return $this->getManyToOneRelationViaIntermediate(
61+
return $this->getManyToManyRelation(
6262
$objects,
6363
Hashlist::HASHLIST_ID,
6464
Factory::getHashlistHashlistFactory(),
@@ -67,7 +67,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
6767
Hashlist::HASHLIST_ID,
6868
);
6969
case 'tasks':
70-
return $this->getManyToOneRelationViaIntermediate(
70+
return $this->getManyToManyRelation(
7171
$objects,
7272
Hashlist::HASHLIST_ID,
7373
Factory::getTaskWrapperFactory(),

src/inc/apiv2/model/pretasks.routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
3131
/* Expand requested section */
3232
switch($expand) {
3333
case 'pretaskFiles':
34-
return $this->getManyToOneRelationViaIntermediate(
34+
return $this->getManyToManyRelation(
3535
$objects,
3636
Pretask::PRETASK_ID,
3737
Factory::getFilePretaskFactory(),

src/inc/apiv2/model/supertasks.routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
3030
/* Expand requested section */
3131
switch($expand) {
3232
case 'pretasks':
33-
return $this->getManyToOneRelationViaIntermediate(
33+
return $this->getManyToManyRelation(
3434
$objects,
3535
Supertask::SUPERTASK_ID,
3636
Factory::getSupertaskPretaskFactory(),

src/inc/apiv2/model/tasks.routes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
3434
/* Expand requested section */
3535
switch($expand) {
3636
case 'assignedAgents':
37-
return $this->getManyToOneRelationViaIntermediate(
37+
return $this->getManyToManyRelation(
3838
$objects,
3939
Task::TASK_ID,
4040
Factory::getAssignmentFactory(),
@@ -57,7 +57,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
5757
CrackerBinaryType::CRACKER_BINARY_TYPE_ID
5858
);
5959
case 'hashlist':
60-
return $this->getManyToOneRelationViaIntermediate(
60+
return $this->getManyToManyRelation(
6161
$objects,
6262
Task::TASK_WRAPPER_ID,
6363
Factory::getTaskWrapperFactory(),
@@ -73,7 +73,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
7373
Speed::TASK_ID
7474
);
7575
case 'files':
76-
return $this->getManyToOneRelationViaIntermediate(
76+
return $this->getManyToManyRelation(
7777
$objects,
7878
Task::TASK_ID,
7979
Factory::getFileTaskFactory(),

src/inc/apiv2/model/users.routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
3131
/* Expand requested section */
3232
switch($expand) {
3333
case 'accessGroups':
34-
return $this->getManyToOneRelationViaIntermediate(
34+
return $this->getManyToManyRelation(
3535
$objects,
3636
User::USER_ID,
3737
Factory::getAccessGroupUserFactory(),

0 commit comments

Comments
 (0)