codeigniter-base-model
codeigniter-base-model copied to clipboard
5 new methods: undelete, set_restriction, get_primary_value, join, without_callbacks and with inside with
undelete
: pretty self-explanatory, works only when soft deleting is enabled
set_restriction
: use-case: controller’s constructor loads a model, adds a restriction (eg. “user_id = 123”), subsequent calls to the model add the restriction to all the queries. Think of it as an easy built-in security which removes the need to add the same where clause again and again on all methods.
get_primary_value
: gets the current primary key value, useful in observers
join
: performs a direct ActiveRecord join
with
now accepts a second parameter which behaves like a with() inside the get()
without_callbacks
: temporarly disable callbacks
This pull request also fixes #87.
Hi Julien,
Thanks for your PR and email. I promise I'll take a look soon, I'm just manically busy at the moment – I'll get in touch when I've got enough time to sit down and take a proper look.
J
On 7 August 2014 12:28, Julien Tessier [email protected] wrote:
This pull request also fixes #87 https://github.com/jamierumbelow/codeigniter-base-model/issues/87.
— Reply to this email directly or view it on GitHub https://github.com/jamierumbelow/codeigniter-base-model/pull/180#issuecomment-51459823 .
Jamie Rumbelow [email protected]
I changed something in with_deleted(): contrary to the var name, it was not temporary and was maintained between calls. I'm not sure if it was on purpose or not, but this is changed: with_deleted() only works for the current call.