Skip to content

Commit

Permalink
Merged branch '7.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Jan 24, 2020
2 parents 8ba4f1a + b9514e7 commit 32a73c2
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ protected function insertKeywords(array $keywordsToInsert, $contentTypeId)
foreach (array_keys($keywordsToInsert) as $keyword) {
$insertQuery->setParameter(':keyword', $keyword);
$insertQuery->execute();
$keywordIdMap[$keyword] = $this->connection->lastInsertId(
$keywordIdMap[$keyword] = (int)$this->connection->lastInsertId(
$this->getSequenceName(self::KEYWORD_TABLE, 'id')
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function insertUrl($url)

$query->execute();

return $this->connection->lastInsertId(
return (int)$this->connection->lastInsertId(
$this->getSequenceName(self::URL_TABLE, 'id')
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function insertContentObject(CreateStruct $struct, $currentVersionNo = 1)

$q->prepare()->execute();

return $this->dbHandler->lastInsertId(
return (int)$this->dbHandler->lastInsertId(
$this->dbHandler->getSequenceName('ezcontentobject', 'id')
);
}
Expand Down Expand Up @@ -275,7 +275,7 @@ public function insertVersion(VersionInfo $versionInfo, array $fields)

$q->prepare()->execute();

return $this->dbHandler->lastInsertId(
return (int)$this->dbHandler->lastInsertId(
$this->dbHandler->getSequenceName('ezcontentobject_version', 'id')
);
}
Expand Down Expand Up @@ -673,7 +673,7 @@ public function insertNewField(Content $content, Field $field, StorageFieldValue

$q->prepare()->execute();

return $this->dbHandler->lastInsertId(
return (int)$this->dbHandler->lastInsertId(
$this->dbHandler->getSequenceName('ezcontentobject_attribute', 'id')
);
}
Expand Down Expand Up @@ -742,7 +742,7 @@ protected function setInsertFieldValues(InsertQuery $q, Content $content, Field
$q->bindValue($value->sortKeyInt, null, \PDO::PARAM_INT)
)->set(
$this->dbHandler->quoteColumn('sort_key_string'),
$q->bindValue(mb_substr($value->sortKeyString, 0, 255))
$q->bindValue(mb_substr((string)$value->sortKeyString, 0, 255))
)->set(
$this->dbHandler->quoteColumn('language_id'),
$q->bindValue(
Expand Down Expand Up @@ -823,7 +823,7 @@ protected function setFieldUpdateValues(UpdateQuery $q, StorageFieldValue $value
$q->bindValue($value->sortKeyInt, null, \PDO::PARAM_INT)
)->set(
$this->dbHandler->quoteColumn('sort_key_string'),
$q->bindValue(mb_substr($value->sortKeyString, 0, 255))
$q->bindValue(mb_substr((string)$value->sortKeyString, 0, 255))
);
}

Expand Down Expand Up @@ -1310,7 +1310,7 @@ public function listVersionNumbers($contentId)
$statement = $query->prepare();
$statement->execute();

return $statement->fetchAll(\PDO::FETCH_COLUMN);
return array_map('intval', $statement->fetchAll(\PDO::FETCH_COLUMN));
}

/**
Expand Down Expand Up @@ -2097,7 +2097,7 @@ public function insertRelation(RelationCreateStruct $createStruct)

$q->prepare()->execute();

return $this->dbHandler->lastInsertId(
return (int)$this->dbHandler->lastInsertId(
$this->dbHandler->getSequenceName('ezcontentobject_link', 'id')
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ public function create(CreateStruct $createStruct, array $parentNode)
);
$query->prepare()->execute();

$location->id = $this->handler->lastInsertId($this->handler->getSequenceName('ezcontentobject_tree', 'node_id'));
$location->id = (int)$this->handler->lastInsertId($this->handler->getSequenceName('ezcontentobject_tree', 'node_id'));

$mainLocationId = $createStruct->mainLocationId === true ? $location->id : $createStruct->mainLocationId;
$location->pathString = $parentNode['path_string'] . $location->id . '/';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ public function copySubtree($sourceId, $destinationParentId, $newOwnerId = null)
// Copy content
if (!isset($contentMap[$child['contentobject_id']])) {
$content = $this->contentHandler->copy(
$child['contentobject_id'],
$child['contentobject_version'],
(int)$child['contentobject_id'],
(int)$child['contentobject_version'],
$newOwnerId
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ public function insertType(Type $type, $typeId = null)

$this->insertTypeNameData($typeId, $type->status, $type->name);

return $typeId;
// $typeId passed as the argument could still be non-int
return (int)$typeId;
}

/**
Expand Down Expand Up @@ -615,9 +616,9 @@ public function insertFieldDefinition(

$q->prepare()->execute();

$fieldDefinitionId = $fieldDefinition->id ?? $this->dbHandler->lastInsertId(
$fieldDefinitionId = (int)($fieldDefinition->id ?? $this->dbHandler->lastInsertId(
$this->dbHandler->getSequenceName('ezcontentclass_attribute', 'id')
);
));

foreach ($storageFieldDef->multilingualData as $multilingualData) {
$this->insertFieldDefinitionMultilingualData($fieldDefinitionId, $multilingualData, $status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ public function getNextId()
}
$query->prepare()->execute();

return $this->dbHandler->lastInsertId($sequence);
return (int)$this->dbHandler->lastInsertId($sequence);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function insertUrlWildcard(UrlWildcard $urlWildcard)

$query->prepare()->execute();

return $this->dbHandler->lastInsertId(
return (int)$this->dbHandler->lastInsertId(
$this->dbHandler->getSequenceName('ezurlwildcard', 'id')
);
}
Expand Down

0 comments on commit 32a73c2

Please sign in to comment.