Answers for "cakephp 2 savefield"

PHP
2

cakephp 2 savefield

$this->MemberLoginMethod->id = $id;
$this->MemberLoginMethod->saveField('enabled',  !$enabled);
Posted by: Guest on February-19-2021
0

cakephp 4 save multiple

$data = [
    [
        'title' => 'First post',
        'published' => 1
    ],
    [
        'title' => 'Second post',
        'published' => 1
    ],
];

$articles = $this->getTableLocator()->get('Articles');
$entities = $articles->newEntities($data);
$result = $articles->saveMany($entities);
Posted by: Guest on August-09-2021

Browse Popular Code Answers by Language