public function getFactory(CNabuMessaging $nb_messaging)
    {
        $retval = false;
        $nb_customer = $this->getCustomer();

        if ($nb_messaging->validateCustomer($nb_customer)) {
            if (is_numeric($nb_messaging_id = nb_getMixedValue($nb_messaging, NABU_MESSAGING_FIELD_ID))) {
                $retval = $this->nb_messaging_factory_list->getItem($nb_messaging_id);
            }
            if (!$retval) {
                $retval = $this->nb_messaging_factory_list->addItem(new CNabuMessagingFactory($nb_messaging));
            }
        } else {
            throw new ENabuCoreException(ENabuCoreException::ERROR_CUSTOMERS_DOES_NOT_MATCH);
        }

        return $retval;
    }