public function setData(array $data)
    {
        foreach ($data as $d) {
            if (!$this->isValid($d)) {
                throw new \Exception('Data Provided invalid structure.');
            }
        }

        // set options {
        if ($this->getNoConflictMode()) {
            // add script for noConflict mode
            $scriptItem = array(
                'mode'       => 'script',
                'content'    => ($this->getNoConflictHandler())
                        ? 'var '.$this->getNoConflictHandler().' = '. 'jQuery.noConflict();'
                        : 'jQuery.noConflict();',
                'attributes' => array(
                    'type' => 'text/javascript',
                ),
            );

            # add to items
            array_unshift($data, $scriptItem);
        }
        // .........
        $baseLibrary = $this->getBaseLibrary();
        if ($baseLibrary) {
            // add base script library
            $scriptItem = array(
                'mode'       => 'file',
                'content'    => null,
                'attributes' => array(
                    'src'  => $baseLibrary,
                    'type' => 'text/javascript',
                ),
            );

            # add to items
            array_unshift($data, $scriptItem);
        }
        // ... }

        return parent::setData($data);
    }