@param string|\Closure $toClassName
@param string|\Closure $fromClassname

@return $this
482523
protected function useClass($toClassName, $fromClassname)
    {
        $this->toClassName   = $toClassName;
        $this->fromClassname = $fromClassname;
        return $this;
    }
1247255
public function toggleClass($class_name='')
    {
        $toggle_names = \is_array($class_name) ? $class_name : explode(' ', $class_name);

        foreach ($this as $node) {
            foreach ($toggle_names as $toggle_class) {
                if (!$node->hasClass($toggle_class)) {
                    $node->addClass($toggle_class);
                } else {
                    $node->removeClass($toggle_class);
                }
            }
        }

        return $this;
    }
58201
public function setFrom($from) {
        if (!is_array($from)) {
            $from = array($from, '');
        }
        $this->_params['from'] = $from;
        return $this;
    }
1088178
public function setFrom(Email $from)
    {
        $this->message->setFrom($from->email);
        $this->message->setFromName($from->name);

        return $this;
    }
152489
protected function map(
        $propertyName,
        $columnName = null,
        \Closure $fromArrayCallback = null,
        \Closure $toArrayCallback = null
    ) {
        if (!$columnName) {
            $columnName = $propertyName;
        }

        if ($columnName instanceof \Closure) {
            $fromArrayCallback = $columnName;
            $columnName        = null;
        }

        if ($columnName) {
            $this->columnsToProperties[$columnName] = $propertyName;
            $this->columns[]                        = $columnName;
        }
        $this->properties[] = $propertyName;

        if ($fromArrayCallback) {
            $this->propertiesFromArrayCallbacks[$propertyName] = $fromArrayCallback;
        }

        if ($toArrayCallback) {
            $this->propertiesToArrayCallbacks[$propertyName] = $toArrayCallback;
        }

        return $this;
    }
1022780
function(element, classToAdd) {
        if (!hasClass(element, classToAdd)) {
            element.className = element.className === '' ? classToAdd : element.className + ' ' + classToAdd;
        }
        return this;
    }
281267
protected function get_document_converter_classes($from, $to) {
        $classes = [];

        $converters = $this->get_enabled_plugins();
        foreach ($converters as $plugin => $classname) {
            if (!class_exists($classname)) {
                continue;
            }

            if (!$classname::are_requirements_met()) {
                continue;
            }

            if ($classname::supports($from, $to)) {
                $classes[] = $classname;
            }
        }

        return $classes;
    }
208681
protected function addClassName($to = 'class', $value = null)
    {
        $classes = explode(' ', (string) $this->getAttribute($to));

        $value = array_merge($classes, is_string($value) ? explode(' ', $value) : $value);

        return $this->set($to, implode(' ', array_unique($value)));
    }
1035396
public function send($subject, $content, $to, $fromName = '', $fromEmail = '')
    {
        $mail      = new CakeEmail();
        $fromName  = ($fromName !== '') ? $fromName : $this->_fromName;
        $fromEmail = ($fromEmail !== '') ? $fromEmail : $this->_fromEmail;
        $transport = new MailTransport();

        return $mail
            ->setTransport($transport)
            ->setTemplate($this->_tpl)
            ->setEmailFormat($this->_format)
            ->setFrom($fromEmail, $fromName)
            ->setTo($to)
            ->setSubject($subject)
            ->setViewVars(['page_title' => $subject])
            ->send($content);
    }
1267744
function mergeClassNames(from, to) {
    const classNames = from.classList;
    for (let i = 0; i < classNames.length; i++) {
        to.addClass(classNames[i]);
    }

    return to;
}
986973
public function from($from)
    {
        $this->from = is_object($from) ? $from->getKey() : $from;

        return $this;
    }
902304
public static function fromClass(string $className) : Mapping
    {
        /* @var ApiMapping $instance */
        $className = '\\'.ltrim($className, '\\');
        if (!class_exists($className, true)) {
            throw new MappingException(
                \sprintf('Provided class %s could not be loaded.', $className)
            );
        }
        $instance = new $className();

        if (!in_array(ApiMapping::class, \class_implements($instance, true))) {
            throw new MappingException(
                \sprintf('Class %s must implement %s.', \ltrim($className, '\\'), ApiMapping::class)
            );
        }

        $mappedClass = [
            static::CLASS_KEY => $instance->getClass(),
            static::ALIAS_KEY => $instance->getAlias(),
            static::ALIASED_PROPERTIES_KEY => $instance->getAliasedProperties(),
            static::HIDE_PROPERTIES_KEY => $instance->getHideProperties(),
            static::ID_PROPERTIES_KEY => $instance->getIdProperties(),
            static::URLS_KEY => $instance->getUrls(),
        ];

        if (\in_array(HalMapping::class, \class_implements($instance, true))) {
            $mappedClass[static::CURIES_KEY] = $instance->getCuries();
        }

        if (\in_array(JsonApiMapping::class, \class_implements($instance, true))) {
            $mappedClass[static::RELATIONSHIPS_KEY] = $instance->getRelationships();
        }

        return static::fromArray($mappedClass);
    }
912893
public function from($from, $from_name = '')
    {
        $this->from      = $from;
        $this->from_name = $from_name;
        return $this;
    }
1191656
public function aliasNamespace($from, $to)
	{
		$from = trim($from, '\\');
		$to = trim($to, '\\');

		$this->namespaces[] = [$from, $to];
	}
222416
public function betweenStrict($from, $to)
    {
        if (!is_int($from) && !is_float($from)) {
            throw new InvalidIntOrFloatException('from', $from);
        } elseif (!is_int($to) && !is_float($to)) {
            throw new InvalidIntOrFloatException('to', $to);
        } elseif ($from > $to) {
            throw new NumberNotLessStrictlyException('from', $from, $to);
        }

        if (!is_int($this->value) && !is_float($this->value)) {
            throw new InvalidIntOrFloatException($this->name, $this->value);
        } elseif ($this->value <= $from || $this->value >= $to) {
            throw new NumberNotBetweenStrictlyException($this->name, $this->value, $from, $to);
        }

        return $this;
    }
166794
public function from(string $from) : self
    {
        // $from can either be
        // a) a field name indicating a reference to a different document. Currently, only REFERENCE_STORE_AS_ID is supported
        // b) a Class name
        // c) a collection name
        // In cases b) and c) the local and foreign fields need to be filled
        if ($this->class->hasReference($from)) {
            return $this->fromReference($from);
        }

        // Check if mapped class with given name exists
        try {
            $this->targetClass = $this->dm->getClassMetadata($from);
        } catch (BaseMappingException $e) {
            $this->from = $from;
            return $this;
        }

        if ($this->targetClass->isSharded()) {
            throw MappingException::cannotUseShardedCollectionInLookupStages($this->targetClass->name);
        }

        $this->from = $this->targetClass->getCollection();
        return $this;
    }
167468
private function copyFromTo($from, $to)
    {
        $directory = dirname($to);
        if (!is_dir($directory)) {
            mkdir($directory, 0777, true);
        }

        copy($from, $to);
    }