Adds list of methods for the plugin based on the plugin interface.

@param &$data
The data for a single plugin type.
2826
protected function addPluginMethods(&$data) {
    // Set an empty array at the least.
    $data['plugin_interface_methods'] = [];

    if (empty($data['plugin_interface'])) {
      // If we didn't find an interface for the plugin, we can't do anything
      // here.
      return;
    }

    // Analyze the interface, if there is one.
    $reflection = new \ReflectionClass($data['plugin_interface']);
    $methods = $reflection->getMethods();

    $data['plugin_interface_methods'] = [];

    // Check each method from the plugin interface for suitability.
    foreach ($methods as $method_reflection) {
      // Start by assuming we won't include it.
      $include_method = FALSE;

      // Get the actual class/interface that declares the method, as the
      // plugin interface will in most cases inherit from one or more
      // interfaces.
      $declaring_class = $method_reflection->getDeclaringClass()->getName();
      // Get the namespace of the component the class belongs to.
      $declaring_class_component_namespace = $this->getClassComponentNamespace($declaring_class);

      if ($declaring_class_component_namespace == $data['service_component_namespace']) {
        // The plugin interface method is declared in the same component as
        // the plugin manager service.
        // Add it to the list of methods a plugin should implement.
        $include_method = TRUE;
      }
      else {
        // The plugin interface method is declared in a namespace other
        // than the plugin manager. Therefore it's something from a base
        // interface, e.g. from PluginInspectionInterface, and we shouldn't
        // add it to the list of methods a plugin should implement...
        // except for a few special cases.

        if ($declaring_class == 'Drupal\Core\Plugin\PluginFormInterface') {
          $include_method = TRUE;
        }
        if ($declaring_class == 'Drupal\Core\Cache\CacheableDependencyInterface') {
          $include_method = TRUE;
        }
      }

      if ($include_method) {
        $data['plugin_interface_methods'][$method_reflection->getName()] = $this->methodCollector->getMethodData($method_reflection);
      }
    }
  }
151290
protected static function _addManifestCallback($plugin)
    {
        $data = Plugin::getData($plugin);
        foreach ($data as $name => $callback) {
            if (self::_isCallablePluginData($name, $plugin, $callback) && $plugin !== 'Core') {
                self::$_eventList[$name][$plugin] = $callback;
            }
        }
    }
222861
public function mergeData(array $data)
	{
		$args = func_get_args();
		while (list(,$v) = each($args)) {
			if (is_array($v)) {
				$this->data = array_merge($this->data, $v);
			}
		}
	}
659979
public function add( $data )
	{
		$enclosure = $this->_enclosure;

		foreach( (array) $data as $key => $entry )
		{
			$entry = str_replace( $this->_lineend, $this->_endsubst, $entry );
			$data[$key] = $enclosure . str_replace( $enclosure, $this->_escape . $enclosure, $entry ) . $enclosure;
		}

		if( fwrite( $this->_fh, implode( $this->_separator, $data ) . $this->_lineend ) === false ) {
			throw new MW_Container_Exception( sprintf( 'Unable to add content to file "%1$s"', $this->getName() ) );
		}
	}
1161149
private function initializeType(array $data)
    {
        if (isset($data['type']) === false) {
            return;
        }

        if ($data['type'] === 'error') {
            $this->type = self::TYPE_ERROR;
        } elseif ($data['type'] === 'info') {
            if (isset($data['subType']) === true &&
                $data['subType'] === 'warning'
            ) {
                $this->type = self::TYPE_WARNING;
            } else {
                $this->type = self::TYPE_INFO;
            }
        }
    }
487035
public function AddDiscussionColumns($Data) {
		// Change discussions based on archiving.
		$Result = &$Data->Result();
		foreach($Result as &$Discussion) {
         $this->Calculate($Discussion);
		}
	}
1126383
@Override
  public void add(Object data, Class<?>... typeSpecs) {
    //    if (data == null) return;
    //
    //    typeSpecs = determineTypeSpecs(data, typeSpecs);
    //    if (this.getDefaultDataType() == null) this.setDefaultDataType(typeSpecs);
    //
    //    mReps.put(this.getSpecsAsString(typeSpecs), data);
    Representation representation = new Representation(data, typeSpecs);
    mReps.put(representation.getTypeSpecsString(), representation);
  }
1116134
function _append($data)
	{
		if (strlen($data) - 4 > $this->_limit) {
			$data = $this->_addContinue($data);
		}
		$this->_data		.= $data;
		$this->_datasize	+= strlen($data);
	}
886866
public function update_config(&$data) {
        if (!empty($data->criteria_duration)) {
            $this->course = $data->id;
            $this->enrolperiod = $data->criteria_duration_days;
            $this->insert();
        }
    }
632561
public function addData($data){
        foreach( $data as $key => $value ){
            $this->setData($key, $value);
        }
        return $this;
    }
1342888
protected function _addPluginData( MShop_Common_Manager_Interface $pluginManager, array $data )
	{
		$this->_msg( 'Adding data for MShop plugins', 1 );

		$types = array();
		$manager = $pluginManager->getSubManager( 'type' );

		foreach( $manager->searchItems( $manager->createSearch() ) as $item ) {
			$types[ 'plugin/' . $item->getCode() ] = $item;
		}

		$num = $total = 0;
		$item = $pluginManager->createItem();

		foreach( $data as $key => $dataset )
		{
			$total++;

			if( !isset( $types[ $dataset['typeid'] ] ) ) {
				throw new Exception( sprintf( 'No plugin type "%1$s" found', $dataset['typeid'] ) );
			}

			$item->setId( null );
			$item->setTypeId( $types[ $dataset['typeid'] ]->getId() );
			$item->setProvider( $dataset['provider'] );
			$item->setLabel( $dataset['label'] );
			$item->setConfig( $dataset['config'] );
			$item->setStatus( $dataset['status'] );

			if( isset( $dataset['position'] ) ) {
				$item->setPosition( $dataset['position'] );
			}

			try {
				$pluginManager->saveItem( $item );
				$num++;
			} catch( Exception $e ) { ; } // if plugin configuration was already available
		}

		$this->_status( $num > 0 ? $num . '/' . $total : 'OK' );
	}
86618
public function update($data)
    {
        if (count($this) == 0) {
            return;
        }
        $ids = $this->getPrimaryKeyList();
        $updater = new $this->className();
        $updater->in($updater->getPrimaryKey(), $ids)->update($data);
    }
1342346
public function update_config(&$data) {
        if (!empty($data->criteria_self)) {
            $this->course = $data->id;
            $this->insert();
        }
    }
1280101
public function update_config(&$data) {
        if (!empty($data->criteria_unenrol)) {
            $this->course = $data->id;
            $this->insert();
        }
    }
160789
public function addColumn($data)
    {
        if ($data instanceof Column) {
            $column = $data;
            $this->columns[] = $column->getName();
            if ($column->getSize()) {
                $this->columnsSize[$column->getName()] = $column->getSize();
            }
            $this->columnObjects[] = $column;
        } else {
            $this->columns[] = $name = $data['name'];
            if (isset($data['size']) && $data['size'] > 0) {
                $this->columnsSize[$name] = $data['size'];
            }
            if ($this->getTable()) {
                $this->columnObjects[] = $this->getTable()->getColumn($name);
            }
        }
    }
859491
protected function addUpdateMethods(&$script)
    {
        $this->addDoInsert($script);
        $this->addDoUpdate($script);
        $this->addDoDeleteAll($script);
        $this->addDoDelete($script);
        if ($this->isDeleteCascadeEmulationNeeded()) {
            $this->addDoOnDeleteCascade($script);
        }
        if ($this->isDeleteSetNullEmulationNeeded()) {
            $this->addDoOnDeleteSetNull($script);
        }
        $this->addDoValidate($script);
    }
4459
public function addRows($data)
    {
        foreach ($data as $key => $row) {
            $this->addRow($row, isset($row['id']) ? $row['id'] : $key);
        }

        return $this;
    }