src/Repository.php
public function update(Entity $entity, $primaryValue)
    {
        if (!$entity->getValidator()->validate()) {
            throw new Exception\ValidatorException($entity->getValidator());
        }

        try {

            if (!$this->query()->updateOne($primaryValue, $entity->getData())->run($this->connection)) {
                throw new Exception\RepositoryException("Entity was not successfully updated!");
            }
        } catch (Exception\QueryException $e) {
            throw new Exception\RepositoryException($e->getMessage());
        }

        $this->_saveAssociated($primaryValue, $entity);
    }
public function update(Entity $entity, $primaryValue)
    {
        if (!$entity->getValidator()->validate()) {
            throw new Exception\ValidatorException($entity->getValidator());
        }

        try {

            if (!$this->query()->updateOne($primaryValue, $entity->getData())->run($this->connection)) {
                throw new Exception\RepositoryException("Entity was not successfully updated!");
            }
        } catch (Exception\QueryException $e) {
            throw new Exception\RepositoryException($e->getMessage());
        }

        $this->_saveAssociated($primaryValue, $entity);
    }
public function update ( Entity $ entity , $ primaryValue ) { if ( ! $ entity -> getValidator ( ) -> validate ( ) ) { throw new Exception \ ValidatorException ( $ entity -> getValidator ( ) ) ; } try { if ( ! $ this -> query ( ) -> updateOne ( $ primaryValue , $ entity -> getData ( ) ) -> run ( $ this -> connection ) ) { throw new Exception \ RepositoryException ( "Entity was not successfully updated!" ) ; } } catch ( Exception \ QueryException $ e ) { throw new Exception \ RepositoryException ( $ e -> getMessage ( ) ) ; } $ this -> _saveAssociated ( $ primaryValue , $ entity ) ; }
Update single record

@param Entity $entity
@param mixed  $primaryValue

@throws Exception\ValidatorException
@throws Exception\RepositoryException
Update single record