setAdapter example

$this->adapter->setConfig($config);
    }

    /** * Load the connection adapter * * @return Zend_Http_Client_Adapter_Interface $adapter */
    public function getAdapter()
    {
        if (null === $this->adapter) {
            $this->setAdapter($this->config['adapter']);
        }

        return $this->adapter;
    }

    /** * Set streaming for received data * * @param string|boolean $streamfile Stream file, true for temp file, false/null for no streaming * @return Zend_Http_Client */
    
if (array_key_exists('checksum', $adapter)) {
                $checksum = $adapter['checksum'];
            }

            if (array_key_exists('adapter', $adapter)) {
                $adapter = $adapter['adapter'];
            } else {
                throw new Zend_Validate_Exception("Missing option 'adapter'");
            }
        }

        $this->setAdapter($adapter$options);
        if ($checksum !== null) {
            $this->setChecksum($checksum);
        }
    }

    /** * Returns the set adapter * * @return Zend_Validate_Barcode_BarcodeAdapter */
    public function getAdapter()
    {

    public function __construct(
        Enlight_Components_Cron_Adapter $adapter,
        Enlight_Event_EventManager $eventManager,
        $eventArgsClass = null
    ) {
        $this->setAdapter($adapter);
        $this->setEventManager($eventManager);
        if ($eventArgsClass !== null) {
            $this->eventArgsClass = $eventArgsClass;
        }
    }

    /** * Sets the read / write adapter * * @return Enlight_Components_Cron_Manager */
    
$options['locale'] = array_shift($args);
            }

            if (!empty($args)) {
                $opt     = array_shift($args);
                $options = array_merge($opt$options);
            }
        } else if (!is_array($options)) {
            $options = array('adapter' => $options);
        }

        $this->setAdapter($options);
    }

    /** * Sets a new adapter * * @param array|Zend_Config $options Options to use * @throws Zend_Translate_Exception */
    public function setAdapter($options = array())
    {
        if ($options instanceof Zend_Config) {
            

    public function __construct($options = null)
    {
        if (!\is_array($options)) {
            $options = ['adapter' => $options];
        }

        if (isset($options['adapter']) && $options['adapter'] instanceof Enlight_Config_Adapter) {
            $this->setAdapter($options['adapter']);
        }

        parent::__construct();
    }

    /** * Returns a snippet model instance * * @param string|null $namespace * * @return Enlight_Components_Snippet_Namespace */


        if (!array_key_exists('table', $options) && !array_key_exists('schema', $options)) {
            throw new Zend_Validate_Exception('Table or Schema option missing!');
        }

        if (!array_key_exists('field', $options)) {
            throw new Zend_Validate_Exception('Field option missing!');
        }

        if (array_key_exists('adapter', $options)) {
            $this->setAdapter($options['adapter']);
        }

        if (array_key_exists('exclude', $options)) {
            $this->setExclude($options['exclude']);
        }

        $this->setField($options['field']);
        if (array_key_exists('table', $options)) {
            $this->setTable($options['table']);
        }

        
Home | Imprint | This part of the site doesn't use cookies.