is_new() public method

Check whether the model was the result of a call to create() or not
public is_new ( ) : boolean
return boolean
Example #1
0
 public function before_save(Model $obj)
 {
     if ($obj->is_new() or $obj->is_changed()) {
         $obj->{static::$property} = static::$mysql_timestamp ? \Date::time()->format('mysql') : \Date::time()->get_timestamp();
     }
 }