Closed rbruhn closed 10 years ago
I'm going to assume that you are implementing your own repository, if that the case, what you have to do is create a class that implement the RepositoryInterface, this way you can keep using the GridEncoder which is the one in charge to sent the data to the grid in the correct format.
Yes, I have my own repository. It looks like this:
class ExpeditionRepository extends Repository implements ExpeditionInterface {}
Technically, I guess I could add RepositoryInterface as well, right?
class ExpeditionRepository extends Repository implements ExpeditionInterface, RepositoryInterface {}
Then add a binding for RepositoryInterface to my ExpeditionRespository?
Or, as you say.... make a completely new Repo specifically for this?
Yes, PHP allows you to implement more than one interface so if do that it should work fine.
The only issue is that implementing the RepositoryInterface is a lot of work, that why I included the EloquentRepositoryAbstract class in the package so you can extend it because it will be make your life easier if you are using Query Builder or Eloquent ORM.
If you are using Query Builder or Eloquent ORM you can also copy and paste the code of the EloquentRepositoryAbstract to your existing class (the one implementing the RepositoryInterface) and it should work too.
How can you integrate this if you are already extending your own custom repositories and interfaces? $this->GridEncoder->encodeRequestedData expects Mgallegos\LaravelJqgrid\Repositories\RepositoryInterface