src/MongolidModel.php
public function save(bool $force = false)
    {
        if ($this->localMockHasExpectationsFor('save')) {
            return $this->getLocalMock()->save();
        }

        if ($force || $this->isValid()) {
            $this->hashAttributes();

            return parent::save();
        }

        return false;
    }
public function save(bool $force = false)
    {
        if ($this->localMockHasExpectationsFor('save')) {
            return $this->getLocalMock()->save();
        }

        if ($force || $this->isValid()) {
            $this->hashAttributes();

            return parent::save();
        }

        return false;
    }
public function save ( bool $ force = false ) { if ( $ this -> localMockHasExpectationsFor ( 'save' ) ) { return $ this -> getLocalMock ( ) -> save ( ) ; } if ( $ force || $ this -> isValid ( ) ) { $ this -> hashAttributes ( ) ; return parent :: save ( ) ; } return false ; }
Save the model to the database if it's valid. This method also
checks for the presence of the localMock in order to call the save
method into the existing Mock in order not to touch the database.

@param bool $force force save even if the object is invalid

@return bool
Save the model to the database if it s valid . This method also checks for the presence of the localMock in order to call the save method into the existing Mock in order not to touch the database .