Comments (3)
This also becomes in handy with $_POST:
$user = new ModelUser();
$user->import($_POST);
$user->save();
In my opinion, it should override any data that preexists, but keep the data that doesn't exist in the imported data untouched. This way, you can simply do the following to update a record:
$user = new ModelUser($this->request->id);
$user->import($_POST);
$user->save();
from scaffold.
We could have both? ->import()
that clears existing data, and ->update()
, that doesn't?
from scaffold.
Let's do that.
from scaffold.
Related Issues (20)
- Ability to use models as controllers
- Constructer Fields in models HOT 1
- Can't do a random pick in the database class HOT 1
- Are HEAD requests supported? HOT 6
- What is Controller::resource for? HOT 2
- Lots of things need renaming.
- Should schema types be respected at the driver level? HOT 5
- Relationship columns HOT 16
- Support for middlewares on the Router. HOT 6
- Should be able to delete group models.
- Should be able to filter models based on virtual fields.
- Authentication Middlewares: Basic and otherwise.
- URL Test for Validator HOT 1
- key_implode should be able to *just* implode pairs, and return an array. HOT 1
- Should keep a log of all queries and their result.
- Move request method logic to controller to add overridable "all" method.
- Can't use underscores in parameter names on routes.
- Lets get it ready for release HOT 2
- Set exception aliases without passing them in manually.
- $count_models should only affect anything once level has been reached.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scaffold.