Code Monkey home page Code Monkey logo

Comments (8)

 avatar commented on June 11, 2024

Semi-Offtopic:
What I would really love to see regarding the Seeder would the possibility of specifying a parent during creation.
Currently I create all the Entities and then move them to their corresponding position within the tree. That's no fun at all :(

from closuretable.

franzose avatar franzose commented on June 11, 2024

@thedancingbard, explain in more details, please. As I can guess, some things might should be implemented in the Entity itself.

from closuretable.

kapooostin avatar kapooostin commented on June 11, 2024

I guess I was going to ask the same question. Is there a way to parse a tree from an array, representing its structure.

Something like this:

Entity->parseTree(
  [
    [ 'id' => 0 ],
    [ 'id' => 1 ],
    [ 'id' => 2,
      'children' => [
        [ 'id' => 3 ],
        [ 'id' => 4,
          'children' => [
            [ 'id' => 5 ],
          ],
        ],
      ],
    ],
  ]
);

from closuretable.

franzose avatar franzose commented on June 11, 2024

@kapooostin, nope at the moment. You can only get a whole tree with the tree() method or filtered one by some condition with filteredTree(). When saving, you have to build the tree manually.

If you're interested you could create another issue for that and offer your implementation of such a thing :)

from closuretable.

vjandrea avatar vjandrea commented on June 11, 2024

@kapooostin if you create an issue for your request we can start discussing it in a separate thread, i am building a recursive function that works as you asked but we have to clarify some points.

from closuretable.

franzose avatar franzose commented on June 11, 2024

@vjandrea, @thedancingbard already have created one.

from closuretable.

franzose avatar franzose commented on June 11, 2024

@vjandrea, see #34, please.

from closuretable.

franzose avatar franzose commented on June 11, 2024

I close this issue because we aren't talking about the seeder but about the automatic creation from prepared array or something.

from closuretable.

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.