Skip to content

Instantly share code, notes, and snippets.

@niko-afv
Created July 21, 2017 17:11
Show Gist options
  • Select an option

  • Save niko-afv/608b18bd45687e1e8e77af627a434fa5 to your computer and use it in GitHub Desktop.

Select an option

Save niko-afv/608b18bd45687e1e8e77af627a434fa5 to your computer and use it in GitHub Desktop.
public function register()
{
$this->app->bind(
'App\Interfaces\ICore',
'App\Classes\PlutusCore'
);
$this->app->bind(
'App\Interfaces\IMapper',
'App\Classes\AccountMapper'
);
$this->app->bind(
'App\Interfaces\IProxy',
'App\Classes\ProxyConnector'
);
$this->app->bind(
'App\Interfaces\IConnectorFrom',
'App\Services\SalesForceConnector'
);
}
//Controller
class AccountController extends Controller
{
public function sync_test(ICore $plutus)
{
$plutus->sync();
}
}
@JulioGutierrez
Copy link
Copy Markdown

interface IAccountMapper implements IMapper{}
interface IBillsMapper implements IMapper{}

$this->app->bind(
'App\Interfaces\IAccountMapper',
'App\Classes\AccountMapper'
);
$this->app->bind(
'App\Interfaces\IBillsMapper',
'App\Classes\BillsMapper' --> si este objeto ya no sirviera y se tuviera que crear otro, tendria que implementar IBIllsMapper
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment