Ingo_Storage::_store PHP Method

_store() protected method

Store a rule.
protected _store ( integer $action, Ingo_Rule $rule = null )
$action integer Storage action.
$rule Ingo_Rule Rule the action affects.
    protected function _store($action, $rule = null)
    {
        global $session;
        $this->_storeBackend($action, $rule);
        switch ($action) {
            case self::STORE_UPDATE:
                if ($rule instanceof Ingo_Rule_System_Blacklist) {
                    $tmp = $this->getSystemRule('Ingo_Rule_System_Whitelist');
                } elseif ($rule instanceof Ingo_Rule_System_Whitelist) {
                    $tmp = $this->getSystemRule('Ingo_Rule_System_Blacklist');
                } else {
                    $tmp = null;
                }
                if (!is_null($tmp)) {
                    /* Filter out the rule's addresses in the opposite filter. */
                    $ob = new Horde_Mail_Rfc822_List($tmp->addresses);
                    $ob->setIteratorFilter(0, $rule->addresses);
                    $tmp->addresses = $ob->bare_addresses;
                    $this->_storeBackend($action, $tmp);
                }
                break;
        }
        $session->set('ingo', 'change', time());
    }