src/Server/Resource/DoctrineResource.php
/**
     * Respond to the PATCH method (partial update of existing entity) on
     * a collection, i.e. update multiple entities in a collection.
     *
     * @param array $data
     * @return array
     */
Respond to the PATCH method (partial update of existing entity) on
a collection, i.e. update multiple entities in a collection.

@param array $data
@return array
Respond to the PATCH method ( partial update of existing entity ) on a collection i . e . update multiple entities in a collection . @param array $data @return array
public function patchList($data)
    {
        $return = new ArrayCollection();
        $results = $this->triggerDoctrineEvent(DoctrineResourceEvent::EVENT_PATCH_LIST_PRE, $data, $data);
        if ($results->last() instanceof ApiProblem) {
            return $results->last();
        }
        if (! $this->getObjectManager() instanceof EntityManagerInterface) {
            throw new InvalidArgumentException('Invalid Object Manager, must implement EntityManagerInterface');
        }
        $this->getObjectManager()->getConnection()->beginTransaction();
        foreach ($data as $row) {
            $result = $this->patch($row[$this->getEntityIdentifierName()], $row);
            if ($result instanceof ApiProblem) {
                $this->getObjectManager()->getConnection()->rollback();
                return $result;
            }
            $return->add($result);
        }
        $this->getObjectManager()->getConnection()->commit();
        $results = $this->triggerDoctrineEvent(DoctrineResourceEvent::EVENT_PATCH_LIST_POST, $return, $data);
        if ($results->last() instanceof ApiProblem) {
            return $results->last();
        }
        return $return;
    }
public function patchList ( $ data ) { $ return = new ArrayCollection ( ) ; $ results = $ this -> triggerDoctrineEvent ( DoctrineResourceEvent :: EVENT_PATCH_LIST_PRE , $ data , $ data ) ; if ( $ results -> last ( ) instanceof ApiProblem ) { return $ results -> last ( ) ; } if ( ! $ this -> getObjectManager ( ) instanceof EntityManagerInterface ) { throw new InvalidArgumentException ( 'Invalid Object Manager, must implement EntityManagerInterface' ) ; } $ this -> getObjectManager ( ) -> getConnection ( ) -> beginTransaction ( ) ; foreach ( $ data as $ row ) { $ result = $ this -> patch ( $ row [ $ this -> getEntityIdentifierName ( ) ] , $ row ) ; if ( $ result instanceof ApiProblem ) { $ this -> getObjectManager ( ) -> getConnection ( ) -> rollback ( ) ; return $ result ; } $ return -> add ( $ result ) ; } $ this -> getObjectManager ( ) -> getConnection ( ) -> commit ( ) ; $ results = $ this -> triggerDoctrineEvent ( DoctrineResourceEvent :: EVENT_PATCH_LIST_POST , $ return , $ data ) ; if ( $ results -> last ( ) instanceof ApiProblem ) { return $ results -> last ( ) ; } return $ return ; }
Respond to the PATCH method (partial update of existing entity) on
 a collection, i.e.
Respond to the PATCH method ( partial update of existing entity ) on a collection i . e .