List existing organisations
This commit is contained in:
44
src/ServicesProvider/ServicesProvider.php
Normal file
44
src/ServicesProvider/ServicesProvider.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* AVSDev UF Organisations (https://avsdev.uk)
|
||||
*
|
||||
* @link https://git.avsdev.uk/avsdev/sprinkle-organisations
|
||||
* @license https://git.avsdev.uk/avsdev/sprinkle-organisations/blob/master/LICENSE.md (LGPL-3.0 License)
|
||||
*/
|
||||
|
||||
namespace UserFrosting\Sprinkle\Organisations\ServicesProvider;
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
/**
|
||||
* Registers services for the organisation sprinkle.
|
||||
*
|
||||
* @author Craig Williams (https://avsdev.uk)
|
||||
*/
|
||||
class ServicesProvider
|
||||
{
|
||||
/**
|
||||
* Register UserFrosting's organisation services.
|
||||
*
|
||||
* @param ContainerInterface $container A DI container implementing ArrayAccess and psr-container.
|
||||
*/
|
||||
public function register(ContainerInterface $container)
|
||||
{
|
||||
/*
|
||||
* Extend the 'classMapper' service to register sprunje and model classes.
|
||||
*
|
||||
* Mappings added: 'organisation', 'organisation_sprunje'
|
||||
*
|
||||
* @return \UserFrosting\Sprinkle\Core\Util\ClassMapper
|
||||
*/
|
||||
$container->extend('classMapper', function ($classMapper, $c) {
|
||||
$classMapper->setClassMapping('organisation', 'UserFrosting\Sprinkle\Organisations\Database\Models\Organisation');
|
||||
$classMapper->setClassMapping('organisation_sprunje', 'UserFrosting\Sprinkle\Organisations\Sprunje\OrganisationSprunje');
|
||||
|
||||
return $classMapper;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user