public create ([mixed $data], [mixed $whiteList])
Inserts a model instance. If the instance already exists in the persistence it will throw an exception Returning true on success or false otherwise.
//Creating a new robot $robot = new Robots(); $robot->type = 'mechanical'; $robot->name = 'Astro Boy'; $robot->year = 1952; $robot->create(); //Passing an array to create $robot = new Robots(); $robot->create(array( 'type' => 'mechanical', 'name' => 'Astro Boy', 'year' => 1952 ));
Please login to continue.