Giter Club home page Giter Club logo

Comments (4)

gazsp avatar gazsp commented on August 24, 2024

@bmitch Could you try this?

use Baum\SetBuilder;

// ...
$node->setConnection('foobar');
$builder = new SetBuilder($node);
$builder->rebuild();

Unfortunately fixing this for you would require an API change (as Node::rebuild is static), so I'd rather work around it for the time being.

from baum.

bmitch avatar bmitch commented on August 24, 2024

Thanks @gazsp I will try that. I managed to get around it in my situation (for now) by changing the default DB connection just before I call rebuild() and then setting the default DB connection again just after the call to rebuild().

from baum.

bmitch avatar bmitch commented on August 24, 2024

@gazsp I tried your suggestion above but it still fails. I think because of isValidNestedSet() in Node.php where it creates a new SetValidator:

  public static function isValidNestedSet() {
    $validator = new SetValidator(new static);

    return $validator->passes();
  }

It's creating a new static here which is probably the reason the connection is not retained.

from baum.

poing avatar poing commented on August 24, 2024

Under New Management

Focusing support for later Laravel versions.

Cleaning up and closing some of the really old issues. Things that might still be a problem will be transfered to a consolidated issue.

from baum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.