Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Carriers/EntitiesCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ public function countEntities (\obo\Interfaces\IQuerySpecification $specificatio
return $ownedEntityManagerName::countRecords($ownedEntityManagerName::queryCarrier()->addSpecification($this->getSpecification()->addSpecification($specification)));
}

public function setEntities($entities) {
$variables = &parent::variables([]);
foreach ($entities as $entity) {
$variables[$entity->primaryPropertyValue()] = $entity;
}
$this->entitiesAreLoaded = true;
}

/**
* @param array $entityKeys
* @return void
Expand Down
15 changes: 15 additions & 0 deletions src/Relationships/EntitiesCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ public function getEntitiesClassName() {
return $this->relationShip->entityClassNameToBeConnected;
}

/**
* @return bool
*/
public function getEntitiesAreLoaded() {
return $this->entitiesAreLoaded;
}

/**
* @internal
* @param array $requiredItems
Expand Down Expand Up @@ -309,6 +316,14 @@ public function getSubset(\obo\Interfaces\IPaginator $paginator, \obo\Interfaces
return $this->find($specification);
}

public function setEntities($entities) {
$variables = &parent::variables([]);
foreach ($entities as $entity) {
$variables[$entity->primaryPropertyValue()] = $entity;
}
$this->entitiesAreLoaded = true;
}

/**
* @return void
*/
Expand Down