cakeWarning (2): недопустимый тип смещения [CORE \ Cake \ Model \ Model.php, строка 2978]

У меня есть вопрос, пожалуйста, помогите мне

Спасибо..

мой торт php 2.5.4 и я использую xampp ver 3.2.1, но я получаю эту ошибку.

Warning (2): Illegal offset type [CORE\Cake\Model\Model.php, line 2978]

Предупреждение (2): недопустимый тип смещения [CORE \ Cake \ Model \ Model.php, строка 2956]

Мой вид это:

public function edit($id=null) {
if(!$id) {
$this->Session->setFlash('not found this job');
$this->redirect(array('action'=>'index'),null,true);

}
if(empty($this->data)) {
$this->data=$this->Task->find(array('all',array('conditions'=>array('id'=>$id))));
} else {
if($this->Task->save($this->data)) {
$this->Session->setFlash('updated');

$this->redirect(array('action'=>'index'),null,true);
} else {
$this->Session->setFlash('this up date has problem !!! ');
}

}
}

и мой контроллер:

public function edit($id=null) {
if(!$id) {
$this->Session->setFlash('not found this job');
$this->redirect(array('action'=>'index'),null,true);

}
if(empty($this->data)) {
$this->data=$this->Task->find(array('all',array('conditions'=>array('id'=>$id))));
} else  {

if($this->Task->save($this->data)) {
$this->Session->setFlash('updated');
$this->redirect(array('action'=>'index'),null,true);

} else {
$this->Session->setFlash('this up date has problem !!! ');
}

}}

Помогите мне, пожалуйста

-5

Решение

Ты используешь Model::find() неправильно, то, что должно быть передано как отдельные аргументы, заключено в массив.

Должно быть

find('all', array('conditions' => /* ... */));

не

find(array('all', array('conditions' => /* ... */)));
2

Другие решения

Других решений пока нет …