Add entries to the components array.
Allow single add (with a string arg) and bulk adding (with an array arg).
@param  string|array $components
@return bool
8290
public function addComponents($components)
  {
    // if a string was supplied, check for valid component name
    if (ThrottlerHelper::validateName($components)) {
      $components = array($components);
    }
    // ensure elements to add are not already in components
    if (is_array($components) && !$this->allInComponents($components) &&
        ThrottlerHelper::validateComponentsName($components))
    {
      for ($i = 0; $i < count($components); $i++) {
        $this->addComponent($components[$i]);
      }
      return true;
    }
    return false;
  }
358655
public function setComponents(array $components)
    {
        foreach ($components as $id => $properties) {
            $this->setComponent($id, $properties);
        }
    }
142720
public function addAssets(array $assets)
    {
        foreach ($assets as $asset) {
            if (!is_array($asset)) {
                throw new \InvalidArgumentException('Each element needs to be an array.');
            }
            $this->addAsset($asset);
        }
    }
872675
private function getComponentXml(array $components)
    {
        $componentXml = '';
        foreach ($components as $component) {
            $componentXml .= $component->asXml();
        }
        return $componentXml;
    }
685781
public function addTo (Component $parent)
    {
        $parent->add($this);
        $this->parent = $parent;
        return $this;
    }
860834
def add_component(self, component):
        '''
        
        '''
        if component not in self._components:
            self._components.append(component)
        else:  # Replace Component
            self._components[self._components.index(component)] = component
1200788
public function add(array $themes) {

        foreach($themes as $themeId => $label) {
            $prefixedId =  $this->getPrefixedThemeId($themeId);
            if($this->themeExists($prefixedId)) {
                continue;
            }
            $this->register($themeId, $label);
        }

        $this->logInfo('Item themes registered: ' . implode(',', array_keys($themes)));
        return true;
    }
266018
public static function add(array ...$arrays): array
    {
        self::checkArrayLengths($arrays);

        $number_of_arrays = count($arrays);
        $length_of_arrays = count($arrays[0]);
        $sums             = array_fill(0, $length_of_arrays, 0);

        for ($i = 0; $i < $length_of_arrays; $i++) {
            for ($j = 0; $j < $number_of_arrays; $j++) {
                $sums[$i] += $arrays[$j][$i];
            }
        }

        return $sums;
    }
768034
public function setComponents(ComponentCollection $components)
    {
        return parent::setComponents($components->map(function (Component $component) {
            return $component->setZone($this);
        }));
    }
948545
public function addComponent($componentName): bool
    {
        if (is_array($componentName)) {
            foreach ($componentName as $cn) {
                $this->addComponent($cn);
            }

            return true;
        }
        $componentFile = 'app/components/' . Inflector::underscore($componentName) . '.js';

        if (file_exists(JS . DS . $componentFile)) {
            $this->_addDependency($componentFile);

            return true;
        }

        return false;
    }
616776
public function add(array $emails)
    {
        if(!empty ($emails) ){
            foreach ($emails as $key => $values) {
                $this->set($key, $values);
            }
        }
    }
785186
public function add($objects) {
        if (is_array($objects)) {
            foreach ($objects as $object) {
                $this->BuildAddDbConfig($object);
            }
        } else {
            $this->BuildAddDbConfig($objects);
        }
        return $this->BindParametersAndExecute(null);
    }
654491
public void add(Collection<PluginComponent> components)
    {
        for(PluginComponent component : components)
            this.components.put(component.getId(), component);
    }
1242280
public function addValues(array $values)
    {
        // Check if this is a multi-dimensional array
        $isMultiDimensional = 0 == count($values) || (isset($values[0]) && is_array($values[0]));

        if ($isMultiDimensional) {
            $this->insertRows = array_merge($this->insertRows, $values);
        } else {
            // If a single row is provided then it is added
            // to the last row, or a new row if there are none.
            // This is done to maintain BC
            if (count($this->insertRows) > 0) {
                $k = count($this->insertRows) - 1;
                $this->insertRows[$k] = array_replace($this->insertRows[$k], $values);
            } else {
                $this->insertRows = [$values];
            }
        }

        return $this;
    }
1118358
private function serializeComponents(array $components): string
    {
        return implode('|', array_map(function ($name, $value) {
            return sprintf('%s:%s', $name, $value);
        }, array_keys($components), $components));
    }
473249
public void add(UIComponent... components)
	{
		for (UIComponent component : components)
		{
			if (component != null && component != this)
			{
				content.components.add(component);
				component.setParent(this);
				component.register(this);
			}
		}
		onContentUpdate();
	}
1237904
protected function __add( array $tokens )
	{
		$updated = false;

		foreach ( $tokens as $token ) {
			if ( ! $this->__contains( $token ) ) {
				$this->tokens[] = $token;
				$updated = true;
			}
		}

		if ( $updated ) {
			$this->__update();
		}

		return $this;
	}