Announcement

Collapse
No announcement yet.

massUpdate idsUpdated not return sometime.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • massUpdate idsUpdated not return sometime.

    Hi. Look at this Code.

    if (array_key_exists('where', $params)) {
    $where = $params['where'];
    $p = array();
    $p['where'] = $where;
    $selectParams = $this->getSelectParams($p, true);

    $collection = $repository->find($selectParams);

    foreach ($collection as $entity) {
    if ($this->getAcl()->check($entity, 'edit')) {
    $entity->set(get_object_vars($attributes));
    if ($repository->save($entity)) {
    $idsUpdated[] = $id;
    $count++;
    }
    }
    }

    return array(
    'count' => $count
    );

    }

    It should be return isUpdated as the follow code did. If you don't want return idsUpdated? So why add new: $idsUpdated[] = $id;

    return array(
    'count' => $count,
    'ids' => $idsUpdated
    );
Working...
X