Imports the classes to be used in CSS.

@internal

@param array|object $data
558866
public function import_classes( $data ) {
		if ( is_array($data) ) {
			$data = (object) $data;
		}
		$this->classes = array_merge($this->classes, $data->classes);
		$this->classes = array_unique($this->classes);
		$this->classes = apply_filters('nav_menu_css_class', $this->classes, $this, array(), 0);
		$this->class = trim(implode(' ', $this->classes));
	}
46849
public function importData($data)
    {
        foreach ($data as $key => $row) {
            if ($row) {
                try {
                    $success = $this->importOne($row);
                    $errorMessage = '';
                } catch (Exception $e) {
                    $success = false;
                    $errorMessage = $e->getMessage();
                }

                $this->statistics[$key] = ['r' => $success, 'm' => $errorMessage];
            }
        }

        $this->afterImport($data);
    }
600724
private function load($data)
    {
        if (empty($data)) {
            throw new DataSift_Exception_InvalidData('No data found');
        }

        //Assign the instance variables
        foreach ($data as $key => $value) {
            $this->{'_' . $key} = $value;
        }
    }
233387
public function import(array $data)
    {
        $this->clearErrors();
        $result = true;

        foreach ($data as $section) {
            if ($this->importItem($section) === false) {
                $result = false;
            }
        }

        return $result;
    }
405892
public function unserialize($data)
    {
        $injector = \Injector::inst();

        $extraData = null;

        if (empty(self::$objectConstructorReflectionMethods[__CLASS__])) {
            self::$objectConstructorReflectionMethods[__CLASS__] = new \ReflectionMethod(__CLASS__, '__construct');
        }

        if (empty(self::$classConfigs[__CLASS__])) {
            self::$classConfigs[__CLASS__] = $injector->getConfigLocator()->locateConfigFor(__CLASS__);
        }

        if ($this instanceof ExtraDataInterface) {
            $unserialized = \Heystack\Core\unserialize($data);

            self::$objectConstructorReflectionMethods[__CLASS__]->invoke(
                $this,
                $unserialized[0]
            );

            $extraData = $unserialized[1];
        } else {
            self::$objectConstructorReflectionMethods[__CLASS__]->invoke(
                $this,
                \Heystack\Core\unserialize($data)
            );
        }

        // Ensure that the spec is loaded for the class
        if (self::$classConfigs[__CLASS__]) {
            $injector->load([__CLASS__ => self::$classConfigs[__CLASS__]]);
        }
        
        $injector->inject($this, __CLASS__);
        
        if ($extraData) {
            $this->setExtraData($extraData);
        }
    }
98831
protected function extractClassData($data)
    {
        $classData = array();
        if (isset($data['class'])) {
            foreach ($data['class'] as $key => $value) {
                $classData['class_'.$key] = $value;
            }
        }
        return $classData;
    }
39230
public static function fromArray(array $data)
    {
        return new PhpCsFixerLevels(
            new Level($data['psr0']),
            new Level($data['psr1']),
            new Level($data['psr2']),
            new Level($data['symfony'])
        );
    }
259906
static public function fromData(string $data)
    {
        $yaml = yaml_parse($data);
        YamlException::importFromData($yaml);
        return $yaml;
    }
378536
private function setData(array $data)
    {
        $_documentClass = $this->_documentClass;
        $_edgeClass = $this->_edgeClass;

        if (isset($this->_options[self::ENTRY_FLAT]) && $this->_options[self::ENTRY_FLAT]) {
            $this->_result = $data;
        } else {
            $this->_result = [];

            if ($this->_options[self::ENTRY_TYPE] === Collection::TYPE_EDGE) {
                foreach ($data as $row) {
                    $this->_result[] = $_edgeClass::createFromArray($row, $this->_options);
                }
            } else {
                foreach ($data as $row) {
                    $this->_result[] = $_documentClass::createFromArray($row, $this->_options);
                }
            }
        }
    }
370239
protected function init($data)
    {
        $i = 0;

        foreach ($data as $header => $value) {
            $column = self::formatColumnName($i);
            $this->setHeader($column, $header);
            ++$i;
        }
        $this->setBoldLabels();
    }
980422
private function addCommonPropertiesFromArray(array $data)
    {
        $k                 = array_keys($data);
        $k                 = $k[0];
        $this->_result[$k] = [];
        foreach ($data[$k] as $c) {
            $id = $c['_id'];
            unset($c['_id']);
            $this->_result[$k][$id] = $c;
        }
    }
1255266
public function view($data)
    {
        if (array_key_exists('current', $data)) {
            $this->current = $data['current'];
        }
        if (array_key_exists('title_formatter', $data)) {
            $tf = $data['title_formatter'];
        }
        if (array_key_exists('descr_formatter', $data)) {
            $df = $data['descr_formatter'];
        }
        $i = 1;
        foreach ($this->steps as $step) {
            $sdiv = new Element('div');
            $sstyle = $this->getStyle('step');
            if ($i == $this->current) {
                $sdiv->addClass($this->getClass('current'));
                $sstyle .= $this->getStyle('current');
            } elseif ($i < $this->current) {
                $sdiv->addClass($this->getClass('completed'));
                $sstyle .= $this->getStyle('completed');
            }
            $sdiv->addClass($this->getClass('step'))->setAttribute('style', $sstyle);
            $title = array_key_exists('title', $step) ? $step['title'] : '';
            $descr = array_key_exists('descr', $step) ? $step['descr'] : '';
            if (isset($tf) && is_callable($tf)) {
                $title = $tf($title);
            }
            if (isset($df) && is_callable($df)) {
                $descr = $df($descr);
            }
            $contdiv = new Element('div');
            $contdiv->addClass($this->getClass('content'))->setAttribute('style', $this->getStyle('content'));
            $tdiv = new Element('div', new Text($title));
            $tdiv->addClass($this->getClass('title'))->setAttribute('style', $this->getStyle('title'));
            $ddiv = new Element('div', new Text($descr));
            $ddiv->addClass($this->getClass('descr'))->setAttribute('style', $this->getStyle('descr'));
            $contdiv->appendChild($tdiv)->appendChild($ddiv);
            $sdiv->appendChild($contdiv);
            $this->appendChild($sdiv);
            $i++;
        }
        return $this->render();
    }
214442
protected function createObject(array $data = [])
    {
        if ($this->withDefaults && empty($data) && \is_callable($this->callable)) {
            $blueprints = $this->callable;
            $data = $blueprints()->getDefaults();
        }

        $this->object = new Config($data, $this->callable);
    }
409544
public function importItem(Array $data)
    {
        $existing = Craft::$app->volumes->getVolumeByHandle($data['handle']);
        if ($existing) {
            $this->mergeUpdates($data, $existing);
        }

        $volume = $this->createModel($data);
        $event = $this->onBeforeImport($volume, $data);
        if ($event->isValid) {
            $result = Craft::$app->volumes->saveVolume($event->element);
            if ($result){
                $this->onAfterImport($event->element, $data);
            } else {
                $this->addError('error', 'Failed to save asset volume.');
                $errors = $event->element->getErrors();
                foreach($errors as $error) {
                    $this->addError('error', $error);
                }
                return false;
            }
        } else {
            $this->addError('error', 'Error importing ' . $data['handle'] . ' asset volume.');
            $this->addError('error', $event->error);
            return false;
        }

        $result = true;

        return $result;
    }
635581
public function import(array $classes)
    {
        foreach ($classes as $class => $alias) {
            if (is_integer($class)) {
                $class = $alias;
                $alias = ClassHelper::getSimpleName($class);
            }
            if (isset($this->imports[$alias])) {
                throw new \RuntimeException("Alias $alias for $class exists, previous is "
                                            . $this->imports[$alias]);
            }
            $this->imports[$alias] = $class;
        }
        return $this;
    }
1371932
public function setData(array $data)
    {
        if (!array_key_exists('css', $data)) {
            throw new MissingOptionsException('Missing required loader_data option: "css"');
        }

        $this->cssPath = trim($data['css'], '/');
        $pathInfo = pathinfo($this->cssPath);

        if ($pathInfo['extension'] !== 'css') {
            throw new InvalidOptionsException(sprintf('The loader data requires a valid css file. "%s" given', $pathInfo['extension']));
        }

        $cssPath = $this->rootPath . '/web/' . $this->cssPath;
        if (!file_exists($cssPath)) {
            throw new InvalidOptionsException(sprintf('Could not find the css file with this path "%s"', $cssPath));
        }
    }
314026
private function addPathsFromArray(array $data)
    {
        $_documentClass = $this->_documentClass;
        $_edgeClass = $this->_edgeClass;

        $entry = [
            'vertices'    => [],
            'edges'       => [],
            'source'      => $_documentClass::createFromArray($data['source'], $this->_options),
            'destination' => $_documentClass::createFromArray($data['destination'], $this->_options),
        ];
        foreach ($data['vertices'] as $v) {
            $entry['vertices'][] = $_documentClass::createFromArray($v, $this->_options);
        }
        foreach ($data['edges'] as $v) {
            $entry['edges'][] = $_edgeClass::createFromArray($v, $this->_options);
        }
        $this->_result[] = $entry;
    }