Skip to content

What kind of object is the first param of setInsertBatch() / setUpdateBatch() ? #5149

@kenjis

Description

@kenjis

public function setInsertBatch($key, string $value = '', ?bool $escape = null)
{
$key = $this->batchObjectToArray($key);

public function setUpdateBatch($key, string $index = '', ?bool $escape = null)
{
$key = $this->batchObjectToArray($key);

The the first param type is not set. So you can pass an object.
But what kind of object?

The answer is like this:

$insertData = (object) [
    'id' => [
        1,
        2,
    ],
    'name' => [
        'name1',
        'name2',
    ],
    'description' => [
        'description1',
        'description2',
    ],
];

That's how the current implementation works, but is that the intended specification?

Metadata

Metadata

Assignees

No one assigned

    Labels

    databaseIssues or pull requests that affect the database layerquestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions