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
Let's say we have a model that has lots of properties
public function db_retrieve($model, array $row) { /* @var $model Model_Article */ $tbl = Au::db()->table($this); $model->set_id($row[$tbl . '.id']); $model->set_name($row[$tbl . '.name']); $model->set_label($row[$tbl . '.label']); $model->set_description($row[$tbl . '.description']); $model->set_designation($row[$tbl . '.designation']); $model->set_weight($row[$tbl . '.weight']); // Delegate retrieving the row to Aurora_Brand $model->set_brand( Au::factory('Brand') ->db_retrieve(Model::factory('Brand'), $row) ); }
Would it be nicer if we had a helper function to be used just for strait-forward mappings:
public function db_retrieve($model, array $row) { $this->map_retrieve( $model, $row, ['id', 'name', 'label', 'description', 'designation', 'weight'] ); // Delegate retrieving the row to Aurora_Brand $model->set_brand( Au::factory('Brand') ->db_retrieve(Model::factory('Brand'), $row) ); }
The text was updated successfully, but these errors were encountered:
Strait forward mapping helper function. Initial commit
b857b0c
ref #9
I am implementing this as a Trait. It should be used inside Aurora.
use
I find myself making Auroras extend their Models to reach protected properties.
If I implement this as an external class, I will not be able to reach protected properties.
This will be PHP 5.4+ feature.
Sorry, something went wrong.
Trait_Aurora_Data_Map: map_retrieve + map_persist
7d7577c
Trait_Aurora_Data_Map::map_retrieve uses in_array in strict mode
bfc9d08
still working on #9
Model_Event to use Trait_Aurora_Data_Map
790a506
enov/Aurora#9
No branches or pull requests
Let's say we have a model that has lots of properties
Would it be nicer if we had a helper function to be used just for strait-forward mappings:
The text was updated successfully, but these errors were encountered: