PHP code example of hypejunction / hypegroups

1. Go to this page and download the library: Download hypejunction/hypegroups library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hypejunction / hypegroups example snippets



		$svc = elgg()->groups;
		/* @var $svc \hypeJunction\Groups\GroupsService */

		$svc->registerSubtype('classroom', [
			'labels' => [
				'en' => [
					'item' => 'Classroom',
					'collection' => 'Classrooms',
				],
			],
			'root' => true,
			'identifier' => 'classrooms',
			'class' => \CustomPlugin\Classroom::class,
			'collections' => [
				'all' => \CustomPlugin\DefaultClassroomCollection::class,
				'owner' => \CustomPlugin\OwnedClassroomCollection::class,
				'member' => \CustomPlugin\JoinedClassroomCollection::class,
			],
		]);

		$svc->registerSubtype('group', [
			'site_menu' => false,
			'labels' => [
				'en' => [
					'item' => 'Group',
					'collection' => 'Groups',
				],
			],
			'root' => false,
			'parents' => ['classroom'],
			'identifier' => 'groups',
		]);