Pimcore\Model\Object\Classificationstore\KeyGroupRelation::getByGroupAndKeyId PHP Method

getByGroupAndKeyId() public static method

public static getByGroupAndKeyId ( $groupId, $keyId ) : KeyGroupRelation
$groupId
$keyId
return KeyGroupRelation
    public static function getByGroupAndKeyId($groupId, $keyId)
    {
        $relation = new KeyGroupRelation\Listing();
        $relation->setCondition("groupId = " . $relation->quote($groupId) . " and keyId = " . $relation->quote($keyId));
        $relation->setLimit(1);
        $relation = $relation->load();
        if ($relation) {
            return $relation[0];
        }
    }