-
Notifications
You must be signed in to change notification settings - Fork 22
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
Idea: allow syntax -- new Article ( $initial_data ) #19
Comments
My guess is this means the Row classes will have to be customized for each table, with the table columns names being populated into the custom classes somehow. Otherwise the Row has no way of knowing what its column names are. (I am not opposed to that.) So if you want to send a PR to that effect, probably including a PR to Atlas.Cli, I'd be happy to review it. |
I am not sure I get what you mean by Row Classes will have to be customized for each table, I am currently under impression that row doesn't need to be touched for this change I notice the class/file naming are very predictable in Datasource folder |
My understanding changed: |
@pmjones @harikt
Is it possible to have the following syntax:
Sure, it can be done like:
But the former would be a lot easier to read.
This idea is conflicting with current Record API
`Record :: __constructor(mapperClassName, $row, $related)
But we can probably achieve this via a small change:
Record :: __constructor($row_or_data, array $related = [], $mappeClassName = NULL);
-- if $row_or_data is not instance of ROW, new row($data)
-- we can generate the mapperClassName when provided NULL
-- this has only impact on "newRecord()" case, because existing record is acquired via "fetchRecord"
The text was updated successfully, but these errors were encountered: