public static function getField($owningEntity, $key)
    {
        $entity = $owningEntity->getNonemptyCustomFields()->get($key);

        if (!$entity) {
            self::checkCustomFieldExists($owningEntity, $key);
        }

        return $entity;
    }