• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using AES_ENCRYPT in model

#3
The set() method you're trying to use is part of the Query Builder, not part of the model itself. The Model provides some magic that allows most of the commands to be intermingled, but you must realize there's still a difference.

In order to get a copy of the Query Builder, at some point you must call $this->builder(), which returns a copy set to the current table, or manually via [b]$this->db->table('x')[\b]. In the first version you're building it manually so it works. The second one the model class doesn't have the knowledge to do it correctly for you.

The best bet is to view the model as full of a bunch of convenience methods, which is what it is. Any query builder methods you use are modifiers to those convenience methods. The model isn't a replacement for the Query Builder.

Hope that helps.
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4
Reply


Messages In This Thread
Using AES_ENCRYPT in model - by tvdp - 10-04-2018, 01:07 PM
RE: Using AES_ENCRYPT in model - by Piotr - 10-04-2018, 05:30 PM
RE: Using AES_ENCRYPT in model - by kilishan - 10-04-2018, 07:51 PM
RE: Using AES_ENCRYPT in model - by tvdp - 10-04-2018, 11:05 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.