fix

mail@pastecode.io avatar
unknown
php
2 years ago
406 B
1
Indexable
Never
        $method = 'get'.ucfirst($el);
        $methodFr = 'get'.ucfirst($el).'Fr';

        if ($this->getCurrentLocale() === 'fr' && method_exists($object, $methodFr)) {
            if (!empty($object->$methodFr())) {
                return $object->$methodFr();
            }
        }

        if (method_exists($object, $method)) {
            return $object->$method();
        }

        return null;