Behaviour setup

@param Model $model The current model being used
@param array $settings Setup array with options

@return void
4173
public function setup(Model $model, $settings = array()) {
		$default = array(
			'fields' => 'title',
			'scope' => false,
			'conditions' => false,
			'slugfield' => 'slug',
			'separator' => '-',
			'overwrite' => false,
			'length' => 256,
			'lower' => true
		);

		$this->__settings[$model->alias] = (!empty($settings)) ? $settings + $default : $default;
	}
352810
protected function addModelSettings(array &$settings)
    {
        $empty = $this->util->getTranslated()->getEmptyDropdownArray();

        $settings['elementClass'] = 'Select';
        $settings['multiOptions'] = $empty + $this->util->getDbLookup()->getUserConsents();
    }
817491
public function setUp ( Model $Model, $options	 = array() ) {
		 
		 if ( !empty($options['fieldsParaSumatoria']) ) {
		 	$this->fieldsParaSumatoria = $options['fieldsParaSumatoria'];
		 }

		 if ( !empty($options['fechaField']) ) {
		 	$this->fechaField = $options['fechaField'];
		 }
	}
564347
public function setAssociationCounts(Model $model) {
        $counts = array();

        foreach (array($model->hasMany, $model->hasAndBelongsToMany) as $property) {
            foreach ($property as $alias => $assoc) {
                $class = isset($assoc['with']) ? $assoc['with'] : $assoc['className'];

                $counts[$alias] = Admin::introspectModel($class)->find('count', array(
                    'conditions' => array($assoc['foreignKey'] => $model->id),
                    'contain' => false
                ));
            }
        }

        $this->Controller->set('counts', $counts);
    }
715152
public function setModel(\Illuminate\Database\Eloquent\Model $model) {
        $this->model = $model;
        if ($this->model instanceof ResourceInterface) {
            $this->enableAutoEagerLoading = true;
        }
    }
136528
protected function addModelSettings(array &$settings)
    {
        $concatter = new \MUtil_Model_Type_ConcatenatedRow(parent::FIELD_SEP, ' ', false);
        $multi     = explode(parent::FIELD_SEP, $this->_fieldDefinition['gtf_field_values']);
        $settings  = $concatter->getSettings() + $settings;

        $settings['elementClass'] = 'MultiCheckbox';
        $settings['multiOptions'] = array_combine($multi, $multi);
    }
716043
public function beforeValidate(Model $model, $options = array()) {
        if (empty($this->settings[$model->alias])) {
            return true;
        }

        foreach ($this->settings[$model->alias] as $field => $rules) {
            $validations = array();

            foreach ($rules as $rule => $setting) {
                $set = $this->_defaults[$rule];

                // Parse out values
                if (!is_array($setting) || !isset($setting['value'])) {
                    $setting = array('value' => $setting);
                }

                switch ($rule) {
                    case 'required':
                        $arg = (bool) $setting['value'];
                    break;
                    case 'type':
                    case 'mimeType':
                    case 'extension':
                        $arg = (array) $setting['value'];
                    break;
                    default:
                        $arg = (int) $setting['value'];
                    break;
                }

                if (!isset($setting['rule'])) {
                    $setting['rule'] = array($rule, $arg);
                }

                if (isset($setting['error'])) {
                    $setting['message'] = $setting['error'];
                    unset($setting['error']);
                }

                unset($setting['value']);

                // Merge settings
                $set = array_merge($set, $setting);

                // Apply validations
                if (is_array($arg)) {
                    $arg = implode(', ', $arg);
                }

                $set['message'] = __d('uploader', $set['message'], $arg);

                $validations[$rule] = $set;
            }

            if ($validations) {
                if (!empty($model->validate[$field])) {
                    $currentRules = $model->validate[$field];

                    // Fix single rule validate
                    if (isset($currentRules['rule'])) {
                        $currentRules = array(
                            $currentRules['rule'] => $currentRules
                        );
                    }

                    $validations = $currentRules + $validations;
                }

                // Remove notEmpty for uploads
                if (isset($model->data[$model->alias][$field]['tmp_name']) && isset($validations['notEmpty'])) {
                    unset($validations['notEmpty']);
                }

                $this->_validations[$field] = $validations;
                $model->validate[$field] = $validations;
            }
        }

        return true;
    }
603907
protected function setSettings(array $settings): void
    {
        $this->server->set(array_merge($this->defaultSettings, $this->settings, $settings));
    }
1196356
public function saved(Model $model)
    {
        $attributes = $this->processAttributes(Request::input('attributes'));
        $this->syncAttributes($model, $attributes);
    }
1139110
public function addSettings(array $settings)
    {
        foreach ($settings as $key => $value) {
            $this->addSetting($key, $value);
        }
    }
807997
protected function configureSettings(InputInterface $input, OutputInterface $output, array $settings)
    {
        $configuration = Configuration::getInstance();

        foreach ($settings as $name => $value) {
            $configuration->setValue($name, $value);
        }
    }
684419
public function setModel(Model $model)
    {
        $this->model = $model;
        $this->class = get_class($model);

        return $this;
    }
1048971
public function setup(Model $model, $settings = array()) {
        if (isset($model->enum)) {
            $enum = $model->enum;
            $parent = $model;

            // Grab the parent enum and merge
            while ($parent = get_parent_class($parent)) {
                $props = get_class_vars($parent);

                if (isset($props['enum'])) {
                    $enum = $enum + $props['enum'];
                }
            }

            $this->_enums[$model->alias] = $enum;
        }

        $this->_set($settings);
    }
1007903
private function setSettings($settings)
    {
        if ($settings) {
            foreach ($this->settings as $key => &$value) {
                if (!empty($settings->{$key}) && $settings->{$key}) {
                    if (is_object($settings->{$key})) {
                        $value = array_merge(
                            $value,
                            json_decode(json_encode($settings->{$key}, JSON_FORCE_OBJECT), true)
                        );
                    } else {
                        $value = $settings->{$key};
                    }
                }
            }
        }
    }
87833
public function creating(Model $model)
    {
        $model->created_at = time();
        $model->created_by = $this->guard->check() ? $this->guard->user()->getId() : null;
    }
565181
public function setModel($model)
    {
        if(!($model instanceof ModelInterface))
        {
            if(is_string($model) && strpos($model, '.') === false )
            {
                // Model names are always plural
                if(StringInflector::isSingular($model)) {
                    $model = StringInflector::pluralize($model);
                }

                $identifier         = $this->getIdentifier()->toArray();
                $identifier['path'] = array('model');
                $identifier['name'] = $model;

                $identifier = $this->getIdentifier($identifier);
            }
            else $identifier = $this->getIdentifier($model);

            $model = $identifier;
        }

        $this->_model = $model;

        return $this->_model;
    }
1243830
protected function connect(array $settings): void
  {
    $host     = $this->getSetting($settings, true, 'database', 'host');
    $user     = $this->getSetting($settings, true, 'database', 'user');
    $password = $this->getSetting($settings, true, 'database', 'password');
    $database = $this->getSetting($settings, true, 'database', 'database');

    MetadataDataLayer::setIo($this->io);
    MetadataDataLayer::connect($host, $user, $password, $database);
  }