Example #1
0
 protected function delete_self()
 {
     // If soft deleting has been disabled then just call the parent's delete
     if ($this->_disable_soft_delete) {
         return parent::delete_self();
     }
     $deleted_column = static::soft_delete_property('deleted_field', static::$_default_field_name);
     $mysql_timestamp = static::soft_delete_property('mysql_timestamp', static::$_default_mysql_timestamp);
     // Generate the correct timestamp and save it
     $this->{$deleted_column} = $mysql_timestamp ? \Date::forge()->format('mysql') : \Date::forge()->get_timestamp();
     $result = $this->save(false);
     return $result;
 }