oat-sa / lib-lti1p3-core

PHP library for LTI 1.3 Core implementations as platforms and / or as tools.
GNU General Public License v2.0
33 stars 18 forks source link

[Question] How to embed this library in my Tool ( based on PHP codeigniter) ? #157

Open anubhabmondalDirac opened 1 year ago

anubhabmondalDirac commented 1 year ago

Hi everyone , I am new in LTI 1.3 - tao ,so for me this a bit hard to understand how to embed this library into my tool. For LMS , I am using Moodle . If is there any example code availble for this library use by a Tool based on PHP , If available for demo purpose Can someone please share me? I just confued about the workflow . That example code maybe help me to understand the complete architecture.

Thanks in Advance ! @Cicatrice

anubhabmondalDirac commented 1 year ago

How can I implement find registration? what will be my code structure any one help ? @weaverryan @emgolubev @hectoras

use OAT\Library\Lti1p3Core\Registration\RegistrationInterface; use OAT\Library\Lti1p3Core\Registration\RegistrationRepositoryInterface;

$registrationRepository = new class implements RegistrationRepositoryInterface { public function find(string $identifier): ?RegistrationInterface { // TODO: Implement find() method to find a registration by identifier, or null if not found. }

public function findAll(): array { // TODO: Implement findAll() method to find all available registrations. }

public function findByClientId(string $clientId) : ?RegistrationInterface { // TODO: Implement findByClientId() method to find a registration by client id, or null if not found. }

public function findByPlatformIssuer(string $issuer, string $clientId = null): ?RegistrationInterface { // TODO: Implement findByPlatformIssuer() method to find a registration by platform issuer, and client id if provided. }

public function findByToolIssuer(string $issuer, string $clientId = null): ?RegistrationInterface { // TODO: Implement findByToolIssuer() method to find a registration by tool issuer, and client id if provided. } };

any demo example code available ? Thanks in advance !