Mvc\Model::create

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
  ));
doc_Phalcon
2016-10-16 09:52:48
Comments
Leave a Comment

Please login to continue.