Class constructor from consumer.

@param ToolConsumer $consumer Consumer object
@param string $ltiResourceLinkId Resource link ID value
@param string $tempId Temporary Resource link ID value (optional, default is null)
@return ResourceLink
515348
public static function fromConsumer($consumer, $ltiResourceLinkId, $tempId = null)
    {

        $resourceLink = new ResourceLink();
        $resourceLink->consumer = $consumer;
        $resourceLink->dataConnector = $consumer->getDataConnector();
        $resourceLink->ltiResourceLinkId = $ltiResourceLinkId;
        if (!empty($ltiResourceLinkId)) {
            $resourceLink->load();
            if (is_null($resourceLink->id) && !empty($tempId)) {
                $resourceLink->ltiResourceLinkId = $tempId;
                $resourceLink->load();
                $resourceLink->ltiResourceLinkId = $ltiResourceLinkId;
            }
        }

        return $resourceLink;

    }
765948
@Nonnull
	public static <T> LTieLongFunctionBuilder<T> tieLongFunction(Consumer<LTieLongFunction<T>> consumer) {
		return new LTieLongFunctionBuilder(consumer);
	}
1216546
@Nonnull
	public static <T, R> LFunctionBuilder<T, R> function(Consumer<LFunction<T, R>> consumer) {
		return new LFunctionBuilder(consumer);
	}
215509
@Nonnull
	public static <T> LTieSrtConsumerBuilder<T> tieSrtConsumer(Consumer<LTieSrtConsumer<T>> consumer) {
		return new LTieSrtConsumerBuilder(consumer);
	}
26117
@Nonnull
	public static <T> LConsumerBuilder<T> consumer(Consumer<LConsumer<T>> consumer) {
		return new LConsumerBuilder(consumer);
	}
850520
public function getConsumer()
    {

        if (is_null($this->consumer)) {
            $this->consumer = ToolConsumer::fromRecordId($this->consumerId, $this->getDataConnector());
        }

        return $this->consumer;

    }
1182008
@Nonnull
	public static <T1, T2, T3, R> LTriFunctionBuilder<T1, T2, T3, R> triFunction(Consumer<LTriFunction<T1, T2, T3, R>> consumer) {
		return new LTriFunctionBuilder(consumer);
	}
350784
@Nonnull
	public static <T> LTieSrtConsumer<T> tieSrtConsumerFrom(Consumer<LTieSrtConsumerBuilder<T>> buildingFunction) {
		LTieSrtConsumerBuilder builder = new LTieSrtConsumerBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
177416
@Nonnull
	public static <T> LTieLongConsumerBuilder<T> tieLongConsumer(Consumer<LTieLongConsumer<T>> consumer) {
		return new LTieLongConsumerBuilder(consumer);
	}
1296601
protected function build_tool_consumer_object($record, ToolConsumer $consumer) {
        $consumer->setRecordId($record->id);
        $consumer->name = $record->name;
        $key = empty($record->consumerkey) ? $record->consumerkey256 : $record->consumerkey;
        $consumer->setKey($key);
        $consumer->secret = $record->secret;
        $consumer->ltiVersion = $record->ltiversion;
        $consumer->consumerName = $record->consumername;
        $consumer->consumerVersion = $record->consumerversion;
        $consumer->consumerGuid = $record->consumerguid;
        $consumer->profile = json_decode($record->profile);
        $consumer->toolProxy = $record->toolproxy;
        $settings = unserialize($record->settings);
        if (!is_array($settings)) {
            $settings = array();
        }
        $consumer->setSettings($settings);
        $consumer->protected = $record->protected == 1;
        $consumer->enabled = $record->enabled == 1;
        $consumer->enableFrom = null;
        if (!is_null($record->enablefrom)) {
            $consumer->enableFrom = $record->enablefrom;
        }
        $consumer->enableUntil = null;
        if (!is_null($record->enableuntil)) {
            $consumer->enableUntil = $record->enableuntil;
        }
        $consumer->lastAccess = null;
        if (!is_null($record->lastaccess)) {
            $consumer->lastAccess = $record->lastaccess;
        }
        $consumer->created = $record->created;
        $consumer->updated = $record->updated;
    }
1220320
public function createConsumer(Destination $destination): Consumer
    {
        $destination instanceof Topic
            ? InvalidDestinationException::assertDestinationInstanceOf($destination, InteropAmqpTopic::class)
            : InvalidDestinationException::assertDestinationInstanceOf($destination, InteropAmqpQueue::class)
        ;

        if ($destination instanceof AmqpTopic) {
            $queue = $this->createTemporaryQueue();
            $this->bind(new AmqpBind($destination, $queue, $queue->getQueueName()));

            return new AmqpConsumer($this, $queue);
        }

        return new AmqpConsumer($this, $destination);
    }
692186
@Nonnull
	public static <T> LToFltFunctionBuilder<T> toFltFunction(Consumer<LToFltFunction<T>> consumer) {
		return new LToFltFunctionBuilder(consumer);
	}
1182126
@Nonnull
	public static <T1, T2> LBiObjFltConsumerBuilder<T1, T2> biObjFltConsumer(Consumer<LBiObjFltConsumer<T1, T2>> consumer) {
		return new LBiObjFltConsumerBuilder(consumer);
	}
1190637
@Nonnull
	public static <T> LTieIntFunctionBuilder<T> tieIntFunction(Consumer<LTieIntFunction<T>> consumer) {
		return new LTieIntFunctionBuilder(consumer);
	}
706221
@Nonnull
	public static <T1, T2> LToSrtBiFunctionBuilder<T1, T2> toSrtBiFunction(Consumer<LToSrtBiFunction<T1, T2>> consumer) {
		return new LToSrtBiFunctionBuilder(consumer);
	}
41161
@Nonnull
	public static <T> LTieIntConsumer<T> tieIntConsumerFrom(Consumer<LTieIntConsumerBuilder<T>> buildingFunction) {
		LTieIntConsumerBuilder builder = new LTieIntConsumerBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
669418
@Nonnull
	public static <T> LTieByteConsumerBuilder<T> tieByteConsumer(Consumer<LTieByteConsumer<T>> consumer) {
		return new LTieByteConsumerBuilder(consumer);
	}