Transfers config values stored inside the $config property directly
on to the root object properties. If no properties are defined
all config will be transferred if it finds a matching property.
@param array $properties
@return void
336743
protected function fillFromConfig($properties = null)
    {
        if ($properties === null) {
            $properties = array_keys((array) $this->config);
        }

        foreach ($properties as $property) {
            if (property_exists($this, $property)) {
                $this->{$property} = $this->getConfig($property, $this->{$property});
            }
        }
    }
1243221
public function setConfig(&$config)
    {
        $this->_checkConfig($config);

        $this->config = $config;
        $this->init();
    }
483182
protected function applyRoles(array $config) : void
    {
        $this->stdout("Init roles: " . count($config) . "\n", Console::FG_YELLOW);
        foreach ($config as $item) {
            if ($role = $this->applyRole($item)) {
                $this->stdout("\t- success: " . $role->name . "\n", Console::FG_GREEN);
            } else {
                $this->stdout("\t- error config role: " . Json::encode($item) . "\n", Console::FG_RED);
            }
        }
    }
976447
public function replaceWith($properties)
    {
        $removed = array_diff(array_keys($this->_values), array_keys($properties));
        foreach ($removed as $k) {
            unset($this->$k);
        }

        foreach ($properties as $k => $v) {
            $this->$k = $v;
        }
    }
1091748
public static function setPropertiesValues($object, array $propertiesValues)
    {
        /*
         * No properties?
         * Nothing to do
         */
        if (empty($propertiesValues)) {
            return;
        }

        foreach ($propertiesValues as $property => $value) {
            static::setPropertyValue($object, $property, $value);
        }
    }
510153
public function initialize(array $config)
    {
        $this->_controller = $this->_registry->getController();
        $this->_request    = $this->_controller->request;

        parent::initialize($config);
    }
1058623
public function initAnnotation(array $properties) {
		if (isset ( $properties [0] )) {
			$this->name = $properties [0];
			unset ( $properties [0] );
			if (isset ( $properties [1] )) {
				$this->code = $properties [1];
				unset ( $properties [1] );
			}
		}
		parent::initAnnotation ( $properties );
	}
237295
public function configure($config)
    {
        foreach ((array)$config as $key => $value) {
            $this->setConfig($key, $value);
        }
    }
671960
public function initialize(array $config = []) {
		if (empty($this->_config['fields'])) {
			$schema = $this->getTable()->getSchema();

			$fields = [];
			foreach ($schema->columns() as $field) {
				$v = $schema->getColumn($field);
				if (!in_array($v['type'], ['string', 'text'])) {
					continue;
				}
				if (!empty($v['key'])) {
					continue;
				}
				if (isset($v['length']) && $v['length'] === 1) { // TODO: also skip UUID (lenght 36)?
					continue;
				}
				$fields[] = $field;
			}
			$this->_config['fields'] = $fields;
		}
		if ($this->_config['mergeQuotes'] === true) {
			$this->_config['mergeQuotes'] = '"';
		}
	}
1369855
public static function setAll($config)
	{
		foreach ($config as $key => $value) {
			self::set($key, $value);
		}

	}
61531
public function configure(array $properties)
    {
        foreach ($properties as $name => $value) {
            $methodName = 'set' . ucfirst(strtolower($name));
            if (method_exists($this, $methodName)) {
                $this->$methodName($value);
            }
        }
    }
716739
public function initialize(array $config)
    {
        if ($this->_config['referenceName'] == null) {
            $this->_config['referenceName'] = $this->_referenceName();
        }
        $this->setupFieldAssociations($this->_config['versionTable']);
    }
54004
public function modify(array $properties)
  {
    $properties["clid"] = $this->getId();

    $this->execute("clientedit", $properties);
    $this->resetNodeInfo();
  }
656846
public function processConfig($config = array())
    {
        foreach (array_keys($config) as $setting) {
            if (array_key_exists($setting, $this->settings)) {
                $prop = $this->settings[$setting];
                $this->$prop = $config[$setting];
            }
        }
    }
131933
public function initialize(array $config)
    {
        parent::initialize($config);

        $_config = [
            'context'  => __d('core', 'record'),
            'redirect' => [
                'action'     => 'index',
                'prefix'     => $this->_request->getParam('prefix'),
                'plugin'     => $this->_request->getParam('plugin'),
                'controller' => $this->_request->getParam('controller'),
            ],
            'messages' => [
                'no_action' => __d('core', 'Action not found.'),
                'no_choose' => __d('core', 'Please choose only one item.'),
            ]
        ];

        $config = Hash::merge($_config, $config);
        $this->setConfig($config);
    }
494208
protected function setProperties(array $properties = [])
    {
        foreach ($properties as $name => $value) {
            // set property
            if (property_exists($this, $name)) {
                $this->$name = $value;

            // unknown property found
            } else {
                trigger_error(
                    sprintf(
                        'unknown property "%s" for "%s"',
                        $name,
                        get_class($this)
                    ),
                    E_USER_WARNING
                );
            }
        }
    }
1201724
public function setPropertiesAsArray($properties)
    {
        if (\is_array($properties)) {
            if (\array_key_exists('id', $properties)) {
                unset($properties['id']);
            }

            foreach ($properties as $propertyName => $value) {
                $this->setProperty($propertyName, $value);
            }
        }
    }