public static function create(array $attributes = array())
{
$instance = static::newInstance($attributes);
if ($instance->isValid()) {
$instance->insert();
return $instance;
}
throw new ValidationException("Validation has failed for object: " . $instance->inspect(), $instance->getErrors());
}