initial commit of laravel!
This commit is contained in:
26
system/db/eloquent/factory.php
Normal file
26
system/db/eloquent/factory.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php namespace System\DB\Eloquent;
|
||||
|
||||
class Factory {
|
||||
|
||||
/**
|
||||
* Factory for creating new model instances.
|
||||
*
|
||||
* @param string $class
|
||||
* @return object
|
||||
*/
|
||||
public static function make($class)
|
||||
{
|
||||
// -----------------------------------------------------
|
||||
// Create a new model instance.
|
||||
// -----------------------------------------------------
|
||||
$model = new $class;
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Set the active query instance on the model.
|
||||
// -----------------------------------------------------
|
||||
$model->query = \System\DB\Query::table(Meta::table($class));
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user