src/AbstractMapper.php
public function update($entity)
    {
        if (!$entity instanceof $this->entityClass) {
            throw new \InvalidArgumentException(
                "The entity to be updated must be an instance of {$this->entityClass}."
            );
        }

        $entityId = $entity->id;
        $data = $entity->toArray();
        unset($data['id']);

        return $this->adapter->update($this->entityTable, $data, "id = $entityId");
    }
public function update($entity)
    {
        if (!$entity instanceof $this->entityClass) {
            throw new \InvalidArgumentException(
                "The entity to be updated must be an instance of {$this->entityClass}."
            );
        }

        $entityId = $entity->id;
        $data = $entity->toArray();
        unset($data['id']);

        return $this->adapter->update($this->entityTable, $data, "id = $entityId");
    }
public function update ( $ entity ) { if ( ! $ entity instanceof $ this -> entityClass ) { throw new \ InvalidArgumentException ( "The entity to be updated must be an instance of {$this->entityClass}." ) ; } $ entityId = $ entity -> id ; $ data = $ entity -> toArray ( ) ; unset ( $ data [ 'id' ] ) ; return $ this -> adapter -> update ( $ this -> entityTable , $ data , "id = $entityId" ) ; }
Update an existing entity in the storage
@param AbstractEntity $entity
@return mixed
Update an existing entity in the storage