Skip to content

Commit

Permalink
Mod: refactor: change function name getManyToOneRelationViaIntermedia…
Browse files Browse the repository at this point in the history
…te to getManyToManyRelation
  • Loading branch information
gluafamichl committed Oct 25, 2024
1 parent 47363a8 commit 0b300ad
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/inc/apiv2/common/AbstractModelAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ final protected static function getManyToOneRelation(


/**
* Retrieve ManyToOne relalation for $objects ('parents') of type $targetFactory via 'intermidate'
* Retrieve ManyToMany relation for $objects ('parents') of type $targetFactory via 'intermediate'
* of $intermediateFactory joining on $joinField (between 'intermediate' and 'target'). Filtered by
* $filterField at $intermediateFactory.
*
Expand All @@ -131,7 +131,7 @@ final protected static function getManyToOneRelation(
* @return array
*/
final protected static function getManyToOneRelationViaIntermediate(
final protected static function getManyToManyRelation(
array $objects,
string $objectField,
object $intermediateFactory,
Expand Down
4 changes: 2 additions & 2 deletions src/inc/apiv2/model/accessgroups.routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
/* Expand requested section */
switch($expand) {
case 'userMembers':
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
AccessGroup::ACCESS_GROUP_ID,
Factory::getAccessGroupUserFactory(),
Expand All @@ -39,7 +39,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
User::USER_ID
);
case 'agentMembers':
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
AccessGroup::ACCESS_GROUP_ID,
Factory::getAccessGroupAgentFactory(),
Expand Down
2 changes: 1 addition & 1 deletion src/inc/apiv2/model/agents.routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
/* Expand requested section */
switch($expand) {
case 'accessGroups':
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
Agent::AGENT_ID,
Factory::getAccessGroupAgentFactory(),
Expand Down
4 changes: 2 additions & 2 deletions src/inc/apiv2/model/hashlists.routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
);
case 'hashlists':
/* PARENT_HASHLIST_ID in use in intermediate table */
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
Hashlist::HASHLIST_ID,
Factory::getHashlistHashlistFactory(),
Expand All @@ -67,7 +67,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
Hashlist::HASHLIST_ID,
);
case 'tasks':
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
Hashlist::HASHLIST_ID,
Factory::getTaskWrapperFactory(),
Expand Down
2 changes: 1 addition & 1 deletion src/inc/apiv2/model/pretasks.routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
/* Expand requested section */
switch($expand) {
case 'pretaskFiles':
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
Pretask::PRETASK_ID,
Factory::getFilePretaskFactory(),
Expand Down
2 changes: 1 addition & 1 deletion src/inc/apiv2/model/supertasks.routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
/* Expand requested section */
switch($expand) {
case 'pretasks':
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
Supertask::SUPERTASK_ID,
Factory::getSupertaskPretaskFactory(),
Expand Down
6 changes: 3 additions & 3 deletions src/inc/apiv2/model/tasks.routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
/* Expand requested section */
switch($expand) {
case 'assignedAgents':
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
Task::TASK_ID,
Factory::getAssignmentFactory(),
Expand All @@ -57,7 +57,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
CrackerBinaryType::CRACKER_BINARY_TYPE_ID
);
case 'hashlist':
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
Task::TASK_WRAPPER_ID,
Factory::getTaskWrapperFactory(),
Expand All @@ -73,7 +73,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
Speed::TASK_ID
);
case 'files':
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
Task::TASK_ID,
Factory::getFileTaskFactory(),
Expand Down
2 changes: 1 addition & 1 deletion src/inc/apiv2/model/users.routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function fetchExpandObjects(array $objects, string $expand): mixed {
/* Expand requested section */
switch($expand) {
case 'accessGroups':
return $this->getManyToOneRelationViaIntermediate(
return $this->getManyToManyRelation(
$objects,
User::USER_ID,
Factory::getAccessGroupUserFactory(),
Expand Down

0 comments on commit 0b300ad

Please sign in to comment.