Locker\Repository\Lrs\EloquentRepository::destroy PHP Method

destroy() public method

Destroys the model with the given ID and options.
public destroy ( String $lrs_id, array $opts ) : boolean
$lrs_id String ID to match.
$opts array
return boolean
    public function destroy($lrs_id, array $opts)
    {
        // Delete related documents from client and oauth_clients collections.
        $clients = ClientModel::where('lrs_id', $lrs_id)->get();
        foreach ($clients as $client) {
            $client->delete();
        }
        StatementModel::where('lrs_id', $lrs_id)->delete();
        return parent::destroy($lrs_id, $opts);
    }