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;
    }
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;
    }
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 ; }
Gets a Messaging Factory instance for a Messaging instance. If Factory instance already exists then returns it.
@param CNabuMessaging $nb_messaging Messaging instance that owns the Factory required.
@return CNabuMessagingFactory|false Returns the Factory if $nb_messaging is owned by the Customer passed in the
constructor, or false if not.
Gets a Messaging Factory instance for a Messaging instance . If Factory instance already exists then returns it .