public function updateDeliveryExecutionStatus(KVDeliveryExecution $deliveryExecution, $old, $new)
    {
        $this->update($deliveryExecution);
        $userId = $deliveryExecution->getUserIdentifier();
        if ($old != null) {
            $oldReferences = $this->getDeliveryExecutionsByStatus($userId, $old);
            foreach (array_keys($oldReferences) as $key) {
                if ($oldReferences[$key]->getIdentifier() == $deliveryExecution->getIdentifier()) {
                    unset($oldReferences[$key]);
                }
            }
            $this->setDeliveryExecutions($userId, $old, $oldReferences);
        }

        $newReferences = $this->getDeliveryExecutionsByStatus($userId, $new);
        $newReferences[$deliveryExecution->getIdentifier()] = $deliveryExecution;
        return $this->setDeliveryExecutions($userId, $new, $newReferences);
    }
public function updateDeliveryExecutionStatus(KVDeliveryExecution $deliveryExecution, $old, $new)
    {
        $this->update($deliveryExecution);
        $userId = $deliveryExecution->getUserIdentifier();
        if ($old != null) {
            $oldReferences = $this->getDeliveryExecutionsByStatus($userId, $old);
            foreach (array_keys($oldReferences) as $key) {
                if ($oldReferences[$key]->getIdentifier() == $deliveryExecution->getIdentifier()) {
                    unset($oldReferences[$key]);
                }
            }
            $this->setDeliveryExecutions($userId, $old, $oldReferences);
        }

        $newReferences = $this->getDeliveryExecutionsByStatus($userId, $new);
        $newReferences[$deliveryExecution->getIdentifier()] = $deliveryExecution;
        return $this->setDeliveryExecutions($userId, $new, $newReferences);
    }
public function updateDeliveryExecutionStatus ( KVDeliveryExecution $ deliveryExecution , $ old , $ new ) { $ this -> update ( $ deliveryExecution ) ; $ userId = $ deliveryExecution -> getUserIdentifier ( ) ; if ( $ old != null ) { $ oldReferences = $ this -> getDeliveryExecutionsByStatus ( $ userId , $ old ) ; foreach ( array_keys ( $ oldReferences ) as $ key ) { if ( $ oldReferences [ $ key ] -> getIdentifier ( ) == $ deliveryExecution -> getIdentifier ( ) ) { unset ( $ oldReferences [ $ key ] ) ; } } $ this -> setDeliveryExecutions ( $ userId , $ old , $ oldReferences ) ; } $ newReferences = $ this -> getDeliveryExecutionsByStatus ( $ userId , $ new ) ; $ newReferences [ $ deliveryExecution -> getIdentifier ( ) ] = $ deliveryExecution ; return $ this -> setDeliveryExecutions ( $ userId , $ new , $ newReferences ) ; }
Update the collection of deliveries

@param KVDeliveryExecution $deliveryExecution
@param string $old
@param string $new
@return mixed
Update the collection of deliveries