protected function _storeCmd($options)
    {
        $cmds = array();
        $silent = empty($options['unchangedsince'])
             ? !($this->_debug->debug || $this->_initCache(true))
             : false;

        if (!empty($options['replace'])) {
            $cmds[] = array(
                'FLAGS' . ($silent ? '.SILENT' : ''),
                $options['replace']
            );
        } else {
            foreach (array('add' => '+', 'remove' => '-') as $k => $v) {
                if (!empty($options[$k])) {
                    $cmds[] = array(
                        $v . 'FLAGS' . ($silent ? '.SILENT' : ''),
                        $options[$k]
                    );
                }
            }
        }

        $pipeline = $this->_pipeline();
        $pipeline->data['store_silent'] = $silent;

        foreach ($cmds as $val) {
            $cmd = $this->_command(
                empty($options['sequence']) ? 'UID STORE' : 'STORE'
            )->add(strval($options['ids']));
            if (!empty($options['unchangedsince'])) {
                $cmd->add(new Horde_Imap_Client_Data_Format_List(array(
                    'UNCHANGEDSINCE',
                    new Horde_Imap_Client_Data_Format_Number(intval($options['unchangedsince']))
                )));
            }
            $cmd->add($val);

            $pipeline->add($cmd);
        }

        return $pipeline;
    }
protected function _storeCmd($options)
    {
        $cmds = array();
        $silent = empty($options['unchangedsince'])
             ? !($this->_debug->debug || $this->_initCache(true))
             : false;

        if (!empty($options['replace'])) {
            $cmds[] = array(
                'FLAGS' . ($silent ? '.SILENT' : ''),
                $options['replace']
            );
        } else {
            foreach (array('add' => '+', 'remove' => '-') as $k => $v) {
                if (!empty($options[$k])) {
                    $cmds[] = array(
                        $v . 'FLAGS' . ($silent ? '.SILENT' : ''),
                        $options[$k]
                    );
                }
            }
        }

        $pipeline = $this->_pipeline();
        $pipeline->data['store_silent'] = $silent;

        foreach ($cmds as $val) {
            $cmd = $this->_command(
                empty($options['sequence']) ? 'UID STORE' : 'STORE'
            )->add(strval($options['ids']));
            if (!empty($options['unchangedsince'])) {
                $cmd->add(new Horde_Imap_Client_Data_Format_List(array(
                    'UNCHANGEDSINCE',
                    new Horde_Imap_Client_Data_Format_Number(intval($options['unchangedsince']))
                )));
            }
            $cmd->add($val);

            $pipeline->add($cmd);
        }

        return $pipeline;
    }
protected function _storeCmd ( $ options ) { $ cmds = array ( ) ; $ silent = empty ( $ options [ 'unchangedsince' ] ) ? ! ( $ this -> _debug -> debug || $ this -> _initCache ( true ) ) : false ; if ( ! empty ( $ options [ 'replace' ] ) ) { $ cmds [ ] = array ( 'FLAGS' . ( $ silent ? '.SILENT' : '' ) , $ options [ 'replace' ] ) ; } else { foreach ( array ( 'add' => '+' , 'remove' => '-' ) as $ k => $ v ) { if ( ! empty ( $ options [ $ k ] ) ) { $ cmds [ ] = array ( $ v . 'FLAGS' . ( $ silent ? '.SILENT' : '' ) , $ options [ $ k ] ) ; } } } $ pipeline = $ this -> _pipeline ( ) ; $ pipeline -> data [ 'store_silent' ] = $ silent ; foreach ( $ cmds as $ val ) { $ cmd = $ this -> _command ( empty ( $ options [ 'sequence' ] ) ? 'UID STORE' : 'STORE' ) -> add ( strval ( $ options [ 'ids' ] ) ) ; if ( ! empty ( $ options [ 'unchangedsince' ] ) ) { $ cmd -> add ( new Horde_Imap_Client_Data_Format_List ( array ( 'UNCHANGEDSINCE' , new Horde_Imap_Client_Data_Format_Number ( intval ( $ options [ 'unchangedsince' ] ) ) ) ) ) ; } $ cmd -> add ( $ val ) ; $ pipeline -> add ( $ cmd ) ; } return $ pipeline ; }
Create a store command.

@param array $options  See Horde_Imap_Client_Base#_store().

@return Horde_Imap_Client_Interaction_Pipeline  Pipeline object.
Create a store command .