eZ\Publish\Core\REST\Client\Input\Parser\Relation::convertRelationType PHP Method

convertRelationType() protected method

Converts the string representation of the relation type to its constant.
protected convertRelationType ( string $stringType ) : integer
$stringType string
return integer
    protected function convertRelationType($stringType)
    {
        switch (strtoupper($stringType)) {
            case 'COMMON':
                return Values\Content\Relation::COMMON;
            case 'EMBED':
                return Values\Content\Relation::EMBED;
            case 'LINK':
                return Values\Content\Relation::LINK;
            case 'FIELD':
                return Values\Content\Relation::FIELD;
        }
        throw new \RuntimeException(sprintf('Unknown Relation type: "%s"', $stringType));
    }