Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: How use ModelObject->save($entityObject) well?
Post: RE: How use ModelObject->save($entityObject) well...

In BaseModel ,This function is not a good idea. for resolved insert and update.  PHP Code: -- protected function doProtectFields(array $data): array     {         if (! $this->protectFields) {   ...
595 Views
4 Replies
07-26-2022, 12:56 AM
cwwjsyc
  Tongue Thread: How use ModelObject->save($entityObject) well?
Post: RE: How use ModelObject->save($entityObject) well...

CodeIgniter\Database\Exceptions\DataException There is no primary key defined when trying to make insert. It can not work. must put primaryKey in $allowedFields.
595 Views
4 Replies
07-26-2022, 12:24 AM
cwwjsyc
    Thread: How Cancel The Delete in ‘’$useSoftDeletes = true‘’
Post: How Cancel The Delete in ‘’$useSoftDeletes = true‘...

in Models set: protected $useSoftDeletes = true; when some items was deleted  like : itemModel->delete([1,2,3]); Then , we need cancle this. has any function like unDelete() ....
557 Views
4 Replies
07-26-2022, 12:19 AM
cwwjsyc
    Thread: How use ModelObject->save($entityObject) well?
Post: How use ModelObject->save($entityObject) well?

Model has a snowflakeId as primaryKey.   in ver 4.2.1  can not allow primaryKey in $allowedFields array. How can use Entity and Model correctly ? PHP Code: -- $userArray = [     'key' => snow...
595 Views
4 Replies
07-19-2022, 04:21 AM
cwwjsyc
    Thread: How define trampoline function in Controller Class
Post: How define trampoline function in Controller Class

I defined a trampoline function to like this PHP Code: -- class Test extends BaseController {     public function runLoop(int $num)     {         $sum = 0;         function loopId($num, $su...
987 Views
0 Replies
04-22-2022, 11:20 PM
cwwjsyc

Theme © iAndrew 2016 - Forum software by © MyBB