I wanted to use this plugin with y setup of CakePHP 3.8 but I am unable to run the save data query.
This is my save method in the controller:
`$admin = $this->Admins->newEntity();
if ($this->request->is('post')) {
$admin = $this->Admins->patchEntity($admin, $this->request->getData());
if ($this->Admins->save($admin)) {
$this->Flash->success(__('The admin has been saved.'));
$response = array('success' => true, 'msg' => "success");
} else {
$this->Flash->error(__('The page could not be saved. Please, try again.'));
$response = array('success' => false, 'msg' =>"error");
}
echo json_encode($response);
die;
}`
Commenting this line in the save function mentioned in the "hayko\mongodb\src\ORM\Table.php"
$entity->isNew() ? RulesChecker::CREATE : RulesChecker::UPDATE
Did make it work but I am not sure if it's the right way.
The error I get is "Call to a member function select() on array".
Please help me with it ASAP.
I wanted to use this plugin with y setup of CakePHP 3.8 but I am unable to run the save data query.
This is my save method in the controller: `$admin = $this->Admins->newEntity();
Commenting this line in the save function mentioned in the "hayko\mongodb\src\ORM\Table.php"
$entity->isNew() ? RulesChecker::CREATE : RulesChecker::UPDATE
Did make it work but I am not sure if it's the right way.The error I get is "Call to a member function select() on array". Please help me with it ASAP.