Worker $relatedCollection
This commit is contained in:
parent
5fc3f5bc3a
commit
f5f51c4fc9
2 changed files with 3 additions and 3 deletions
|
@ -99,7 +99,6 @@ function createAttribute(string $databaseId, string $collectionId, Document $att
|
|||
|
||||
if ($type === Database::VAR_RELATIONSHIP) {
|
||||
$relatedCollection = $dbForProject->getDocument('database_' . $db->getInternalId(), $options['relatedCollectionId']);
|
||||
$options['relatedCollectionInternalId'] = $relatedCollection->getInternalId();
|
||||
if ($relatedCollection->isEmpty()) {
|
||||
throw new Exception(Exception::COLLECTION_NOT_FOUND);
|
||||
}
|
||||
|
|
|
@ -95,10 +95,11 @@ class DatabaseV1 extends Worker
|
|||
|
||||
try {
|
||||
if ($type === Database::VAR_RELATIONSHIP) {
|
||||
$relatedCollection = $dbForProject->getDocument('database_' . $database->getInternalId(), $options['relatedCollectionId']);
|
||||
if (
|
||||
!$dbForProject->createRelationship(
|
||||
collection: 'make',
|
||||
relatedCollection: 'model',
|
||||
collection: 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(),
|
||||
relatedCollection: 'database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId(),
|
||||
type: $options['type'],
|
||||
twoWay: $options['twoWay'],
|
||||
id: $options['id'],
|
||||
|
|
Loading…
Reference in a new issue