Frontend\Modules\Mailmotor\Form\SubscribeType::getInterests PHP Метод

getInterests() публичный Метод

public getInterests ( ) : array
Результат array
    public function getInterests()
    {
        $interests = array();
        try {
            $mailMotorInterests = $this->subscriber->getInterests();
            // Has interests
            if (!empty($mailMotorInterests)) {
                // Loop interests
                foreach ($mailMotorInterests as $categoryId => $categoryInterest) {
                    foreach ($categoryInterest['children'] as $categoryChildId => $categoryChildTitle) {
                        // Add interest value for checkbox
                        $interests[$categoryChildId] = $categoryChildTitle;
                    }
                }
            }
            // Fallback for when no mail-engine is chosen in the Backend
        } catch (NotImplementedException $e) {
        }
        return $interests;
    }