LMongo\Eloquent\Relations\HasOneOrMany::getRelationValue PHP Method

getRelationValue() protected method

Get the value of a relationship by one or many type.
protected getRelationValue ( array $dictionary, string $key, string $type )
$dictionary array
$key string
$type string
    protected function getRelationValue(array $dictionary, $key, $type)
    {
        $value = $dictionary[$key];
        return $type == 'one' ? reset($value) : $this->related->newCollection($value);
    }