Question: I have this function in CakePHP's AppModel (This is used to install initial data in CakePHP) However, I can't seem to get it to save my data, and I get no errors.

Here is my function inside App/Model/AppModel.php:

```
public function importData() {
$initialOptionData = array(
array( 'Option' => array( 'name' => 'version', 'value' => '1.0.0', )),
array( 'Option' => array( 'name' => 'site-name', 'value' => 'Site Title', )),
    );
$this->create();
$this->saveMany($initialOptionData);
}

```

Answer: 
From you posted code it seems you're trying to save you data to `options` table, and to do that you need to use `Option` model. 

But you're code is within `AppModel`, so first import `Option` model and then execute your save statements.

***Your code should look like:***

```
public function importData() {

  $initialOptionData = array(
       array( 'Option' => array( 'name' => 'version', 'value' => '1.0.0', )),
       array( 'Option' => array( 'name' => 'site-name', 'value' => 'Site Title', )),
    );

   App::import('model','Option');  // Import the Option Model
   $Option = new Option();  // create instance of Option class

   // save statements

   $Option->create();
   $Option->saveMany($initialOptionData);

}

```

### Note

Code you're trying will work if you write that within `app/model/Option.php` file.
I suppose it would be enough to store the values as model property. No need to call `$this->save...`

```
public $initialOptionData = array(
  array( 'Option' => array( 'name' => 'version', 'value' => '1.0.0', )),
  array( 'Option' => array( 'name' => 'site-name', 'value' => 'Site Title', )),
);

```

all models will inherit initialOptionData...