Cactiverecord Strange Behaviour

Yii 1.1.14

I created a table named search

I used gii to create a model named Search

Search validate but don’t save on db

I tried to do save(false) but it doesn’t save nothing on db

(parameters where ok for rules and ok also for db, manual INSERT worked fine)

I changed model class name (and file name) to Search2 and it saves normally.

Explainations?

I think the problem is the default generated "search" method in the activerecord:




class Search extends CActiveRecord {

   ...

   public function search() {

      ...

      return new CActiveDataProvider($this, array(

        'criteria'=>$criteria,

      ));

   }

   ...

}



In the php4 the constructor name is same as the class name: http://www.php.net/manual/en/oop4.constructor.php and it is override the default parent (CActiveRecord) constructor… use an another table/class name, or delete/rename the search() method.

Thanks :D