protected function setCipher($cipher)
    {
        if (false === in_array($cipher, $this->getCipherAvailable())) {
            throw new Doozr_Crypt_Service_Exception(
                sprintf(
                    'Cipher "%s" not supported. Choose from: "%s".',
                    $cipher,
                    var_export($this->getCipherAvailable(), true)
                )
            );
        }

        // Init once or on change
        if ($cipher !== $this->getCipher()) {
            // Create a new instance of cipher's container
            $this
                ->container($this->containerFactory($cipher))
                ->cipher;

            self::setRealObject(
                $this->getContainer()
            );
        }
    }
protected function setCipher($cipher)
    {
        if (false === in_array($cipher, $this->getCipherAvailable())) {
            throw new Doozr_Crypt_Service_Exception(
                sprintf(
                    'Cipher "%s" not supported. Choose from: "%s".',
                    $cipher,
                    var_export($this->getCipherAvailable(), true)
                )
            );
        }

        // Init once or on change
        if ($cipher !== $this->getCipher()) {
            // Create a new instance of cipher's container
            $this
                ->container($this->containerFactory($cipher))
                ->cipher;

            self::setRealObject(
                $this->getContainer()
            );
        }
    }
protected function setCipher ( $ cipher ) { if ( false === in_array ( $ cipher , $ this -> getCipherAvailable ( ) ) ) { throw new Doozr_Crypt_Service_Exception ( sprintf ( 'Cipher "%s" not supported. Choose from: "%s".' , $ cipher , var_export ( $ this -> getCipherAvailable ( ) , true ) ) ) ; } // Init once or on change if ( $ cipher !== $ this -> getCipher ( ) ) { // Create a new instance of cipher's container $ this -> container ( $ this -> containerFactory ( $ cipher ) ) -> cipher ; self :: setRealObject ( $ this -> getContainer ( ) ) ; } }
Setter for cipher.

@param string $cipher Cipher to set.

@author Benjamin Carl <opensource@clickalicious.de>
Setter for cipher .