Created
December 19, 2013 18:08
-
-
Save sorora/8043610 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace MyApp\Models\Repositories; | |
abstract class EloquentBaseRepository { | |
protected $model; | |
public function __construct() | |
{ | |
$model = explode('\\', get_class($this)); | |
$this->model = $model[count($model)-2]; | |
} | |
public function example() | |
{ | |
return call_user_func_array(array($this->model, 'example'), func_get_args()); | |
} | |
public function example2() | |
{ | |
return call_user_func_array(array($this->model, 'example2'), func_get_args()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment