lithium\data\Model::create PHP Method

create() public static method

$post = Posts::create(array('title' => 'New post')); echo $post->title; // echoes 'New post' $success = $post->save(); Note that while this method creates a new object, there is no effect on the database until the save() method is called. In addition, this method can be used to simulate loading a pre-existing object from the database, without actually querying the database: $post = Posts::create(array('id' => $id, 'moreData' => 'foo'), array('exists' => true)); $post->title = 'New title'; $success = $post->save(); This will create an update query against the object with an ID matching $id. Also note that only the title field will be updated.
public static create ( array $data = [], array $options = [] ) : object
$data array Any data that this object should be populated with initially.
$options array Options to be passed to item.
return object Returns a new, _un-saved_ record or document object. In addition to the values passed to `$data`, the object will also contain any values assigned to the `'default'` key of each field defined in `$_schema`.
    public static function create(array $data = array(), array $options = array())
    {
        $defaults = array('defaults' => true, 'class' => 'entity');
        $options += $defaults;
        return static::_filter(__FUNCTION__, compact('data', 'options'), function ($self, $params) {
            $class = $params['options']['class'];
            unset($params['options']['class']);
            if ($class === 'entity' && $params['options']['defaults']) {
                $data = Set::merge(Set::expand($self::schema()->defaults()), $params['data']);
            } else {
                $data = $params['data'];
            }
            $options = array('model' => $self, 'data' => $data) + $params['options'];
            return $self::invokeMethod('_instance', array($class, $options));
        });
    }