refactoring.

This commit is contained in:
Taylor Otwell
2011-09-27 21:10:32 -05:00
parent ed3e3e73cc
commit c6f9734603
15 changed files with 253 additions and 178 deletions

View File

@@ -147,7 +147,7 @@ abstract class Model {
// Since this method is only used for instantiating models for querying
// purposes, we will go ahead and set the Query instance on the model.
$model->query = IoC::resolve('laravel.database')->connection(static::$connection)->table(static::table($class));
$model->query = IoC::core('database')->connection(static::$connection)->table(static::table($class));
return $model;
}
@@ -361,7 +361,7 @@ abstract class Model {
// Since the model was instantiated using "new", a query instance has not been set.
// Only models being used for querying have their query instances set by default.
$this->query = IoC::resolve('laravel.database')->connection(static::$connection)->table(static::table($model));
$this->query = IoC::core('database')->connection(static::$connection)->table(static::table($model));
if (property_exists($model, 'timestamps') and $model::$timestamps)
{
@@ -410,7 +410,7 @@ abstract class Model {
// delete statement to the query instance.
if ( ! $this->exists) return $this->query->delete();
return IoC::resolve('laravel.database')->connection(static::$connection)->table(static::table(get_class($this)))->delete($this->id);
return IoC::core('database')->connection(static::$connection)->table(static::table(get_class($this)))->delete($this->id);
}
/**