We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi Tom,
I was thinking if there was a way to extend to Repository class so that I can use it as CRUD and pass the new schema from other models.
class bookmark extend repository { public function makeSchema() { return (new Schema('Color')) ->addDatetime('posted') ->addString('name', FALSE) ->addString('message', FALSE) ->addString('ip') ; } }
Thank you.
The text was updated successfully, but these errors were encountered:
I'm not 100% sure what you are getting at here.
I have done things like this on occasion:
class Factory { public function getBook() { return new Store((new Schema('Book'))->addString('title')); } public function getAuthor() { return new Store((new Schema('Author'))->addString('name')); } }
Is that what you are getting at?
Sorry, something went wrong.
What I want to make is a "Model" class with the "CRUD" methods that I can extent on my "sub models".
class Model { public function makeSchema() { return $this; } }
Then when I create a model for a kind call Bookmark I can just said:
class bookmark extend Model { public function makeSchema() { return (new Schema('Bookmark')) ->addDatetime('posted') ->addString('name', FALSE) ->addString('message', FALSE) ->addString('ip') ; } }
and since I am inheriting all other methods from "Model" I already have the update, post, delete operations for the new "kind".
No branches or pull requests
Hi Tom,
I was thinking if there was a way to extend to Repository class so that I can use it as CRUD and pass the new schema from other models.
Thank you.
The text was updated successfully, but these errors were encountered: