Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New feature] DatabaseSeeder #26

Closed
vjandrea opened this issue Oct 1, 2013 · 8 comments
Closed

[New feature] DatabaseSeeder #26

vjandrea opened this issue Oct 1, 2013 · 8 comments
Labels

Comments

@vjandrea
Copy link
Contributor

vjandrea commented Oct 1, 2013

We can discuss here how to implement a DatabaseSeeder for ClosureTable.
In particular, how to implement a scan of an array of nodes.

@ghost
Copy link

ghost commented Oct 1, 2013

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 :(

@franzose
Copy link
Owner

franzose commented Oct 1, 2013

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

@kapooostin
Copy link

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 ],
          ],
        ],
      ],
    ],
  ]
);

@franzose
Copy link
Owner

franzose commented Oct 2, 2013

@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 :)

@vjandrea
Copy link
Contributor Author

vjandrea commented Oct 4, 2013

@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.

@franzose
Copy link
Owner

franzose commented Oct 4, 2013

@vjandrea, @thedancingbard already have created one.

@franzose
Copy link
Owner

franzose commented Oct 4, 2013

@vjandrea, see #34, please.

@franzose
Copy link
Owner

franzose commented Oct 4, 2013

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

@franzose franzose closed this as completed Oct 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants