Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Somewhere we forgot this. re-adding. * $model->set('blah') will set value to title field. * save() can now combine set/save() by taking argument * off-load insert() functionality to set() * insert will return "id" instead of full model. Because cloned models are not very reliable now. * counter is part of dsql. * Applied fixes from StyleCI * fix some tests * typo * more tests * style * Add is_numeric * More field validations * Add more numeric field check * style * Implement hasOne() relationship ID binding. * Applied fixes from StyleCI * Implements intelligent model reloading after save() * No need to complicate things. * Add documentation * Applied fixes from StyleCI * Added afterUpdateQuery / afterInsertQuery * Implement and document how to prevent default operations on active record * remove outdated test (since it's no longer on readme) * Added some really nice advanced topics. * allow hasOne()->addField('foo'); (instead of saying foo twice) * Applied fixes from StyleCI * allow hasOne()->addField('foo'); (instead of saying foo twice) * Applied fixes from StyleCI * Improve exception catching in Persistence_SQL * Use single-table update and single-table delete with where id=X $m->save() invokes update with a fixed ID. Also it updates joined tables separately. Because the record has been loaded successfully before and will be reloaded after updates (in some cases) at a risk of failed transaction, we don't have to invoke action here. Action is more suited for all-set update and if you use joins with SQLite you're on your own, as it does not support join with update. Same goes for deletion. * Remove commented out code. * Expanded documentation. * merge feature/allow-updating-id * Revert "merge feature/allow-updating-id" This reverts commit 77733ae. * First we need ability to avoid field persistence If model is saving field and join is saving on top, we get problem. * Remove misleading test. No manual tweaking of related values (until we can figure out how to do it safely, through join) * avoid clash between join and field save. * Refactor SQL persistence to use save_buffer() * implement afterUnload hook. * make use of afterUnload correctly. * still call update() on persistence if joins are dirty. * do everything except actual query if no fields are changed. * adjust test to verify unloading and changing only joined field. * Fix problem introduced in pr #70 #70 (comment) * rename internal method * implement isDirty() * clean syntax. * fix bug in docs. * allow addFields(['foo','bar']) without associations. * Validation improvement. * addCondition('foo', ['a','b']); shouldn't touch default. * style. * Add support for array in $this->model * add support for array/model definition. * implement hasOne('foo_bar', ['class', 'default'=>123]); * if table has alias, prepend it to sub-select aliases. * ref('has_one_id') will no longer add weird condition if it's not loaded. * Update test-scripts * Style. * style.
- Loading branch information