Sets the schema events
@chainable
321579
public function events($map)
    {
        foreach($map as $name=>$callback)
            $this->_events->register($name, $callback);

        return $this;
    }
1343991
function (schema, process) {
		var that = this;

		if (!(schema instanceof Schema)) {
			throw new Error('first argument must be instance of Schema');
		}

		if (process) {
			var r = process.call(this, schema);

			if (r != null && !r) {
				return this;
			}
		}

		_.each(schema.fields, function (fieldSchema, fieldName) {
			that.field(fieldName).like(fieldSchema, process);
		});

		if (process) {
			return this;
		}

		_.each(schema, function (value, key) {
			if (/^(_.*|fields)$/.test(key)) {
				return;
			}

			that[key] = _.cloneDeep(value);
		});

		return this;
	}
167045
public function events($events=array())
    {
        if (!isset($this->_events)) {
            $this->_events = new Events(array(), self::schema()->events());
            $this->_registerDefaultEventHandlers();
        }

        if(count($events))
            foreach($events as $event=>$callback)
                $this->_events->register($event, $callback);

        return $this->_events;
    }
914359
protected function setDbColumns()
    {
        $connection = $this->model()->eloquent()->getConnectionName();

        $this->dbColumns = collect(Schema::connection($connection)->getColumnListing($this->model()->getTable()));
    }
157865
function() {
  this._schemas = {};
  this._missingSchemas = {};

  // register embedded schemas
  var keys = Object.keys(EMBEDDED_SCHEMAS);
  keys.forEach(function(key) { this.register(EMBEDDED_SCHEMAS[key]); }, this);
}
417189
public function setSchema($schema) {
        if(!$this->setModified('schema', $schema)->isModified()) {
            return $this;
        }
		$this->schema = $schema;
		return $this;
    }
972653
public function setSchema($schema)
    {
        $schema = func_get_args();
        
        $schema = "'".implode("','", $schema)."'";
        
        $query = $this->getUtilityQuery()->setSchema($schema);
        $this->query($query);
        
        return $this;
    }
613563
def set_slug(apps, schema_editor):
    
    Event = apps.get_model('spectator_events', 'Event')

    for e in Event.objects.all():
        e.slug = generate_slug(e.pk)
        e.save(update_fields=['slug'])
759159
public function setEventClasses($events)
    {
        foreach ($events as $iface => $cls) {
            $this->setEventClass($iface, $cls);
        }
    }
465439
protected function _setSchemaCache($model = null, $schema = null) {
		if (empty($model)) {
			return;
		}

		$this->_schemaCache[$model] = $schema;
	}
1076247
def setCurrentSchema( self, schema ):
        
        if ( not schema in self._schemas ):
            return False
        
        index = self._schemas.index(schema)
        self.setCurrentIndex(index)
        return True
85211
public function setEvent($event)
  {
    if ($event === '?' || $event === '') {
      $this->event = null;
    } else {
      $event = Util::foreignLettersToEnglishLetters($event);
      $event = Util::titleCaseIfCurrentlyAllCaps($event);
      $this->event = $event === '?' ? null : $event;
    }
  }
686333
public function setSchema($schema)
    {
        if ($schema === $this->schema) {
            return;
        }

        $this->schema = $schema;
        if ($schema && !$this->package && $this->getBuildProperty('schemaAutoPackage')) {
            $this->package = $schema;
            $this->packageOverridden = true;
        }

        if ($schema && !$this->namespace && $this->getBuildProperty('generator.schema.autoNamespace')) {
            $this->namespace = $schema;
        }
    }
360924
function ReloadSchema() {
		// Sanity checks on schema {{{
		if (!$this->schema)
			trigger_error("No schema returned for model {$this->model} from DefineSchema()") && die();
		if (!isset($this->schema['_id']))
			trigger_error("_id is unset for model {$this->model} via DefineSchema. It must be a string pointer to the ID or the schema structure.") && die();

		if (isset($this->schema['_model'])) {
			$this->model = $this->schema['_model'];
			unset($this->schema['_model']);
		} elseif (!$this->model)
			trigger_error("Model is not set") && die();

		if (isset($this->schema['_table'])) {
			$this->table = $this->schema['_table'];
			unset($this->schema['_table']);
		} elseif (!$this->table)
			trigger_error("Table is not set for model {$this->model}") && die();
		// }}}
		$this->Trigger('setschema', $this->schema);
		// Map _id to whatever its pointing at {{{
		if (isset($this->schema['_id']) && is_string($this->schema['_id'])) {
			if (!isset($this->schema[$this->schema['_id']]))
				trigger_error("_id for model {$this->model} pointing to non-existant field {$this->schema['_id']}") && die();
			$this->schema['_id'] =& $this->schema[$this->schema['_id']];
		}
		// }}}
		// Process the $this->schema array {{{
		$this->_hides = array();
		foreach ($this->schema as $key => $attrib) {
			if (substr($key,0,1) == '_') // Is a meta field - skip
				continue;
			$this->schema[$key]['field'] = $key; // Map 'field' to the ID of each field

			// Deal with types {{{
			if (!isset($this->schema[$key]['type'])) {
				$this->schema[$key]['type'] = 'varchar';
			} else if ($this->schema[$key]['type'] == 'pk') { // All PK fields automatically become readonly
				$this->schema[$key]['allowcreate'] = false;
				$this->schema[$key]['allowsave'] = false;
			}
			// }}}

			// .readonly {{{
			if (isset($this->schema[$key]['readonly']) && $this->schema[$key]['readonly']) { // readonly is an alias for allowsave
				$this->schema[$key]['allowsave'] = false;
				unset($this->schema[$key]['readonly']);
			}
			// }}}

			// .hide {{{
			if (isset($this->schema[$key]['hide']) && $this->schema[$key]['hide']) { // hide is an alias for allowget
				$this->schema[$key]['allowget'] = false;
				unset($this->schema[$key]['hide']);
			}
			// }}}

			// .allowget {{{
			if (isset($this->schema[$key]['allowget']) && !$this->schema[$key]['allowget'])
				$this->_hides[] = $key;
			// }}}
		}
		// }}}
	}
325391
public function initialize($schema, $table=null)
    {
        $mapper = $this->_mapper($schema);
        $table = $table ? $this->_connection($schema)->table($table) : $mapper->table();

        $sequencePool = $this->_connection($schema)->sequencePool();
        $sequencePool->initialize();

        $columns = array();

        // build a map of properties to create
        foreach ($schema->properties() as $prop) {
            $columns[$prop->name] = $prop->type;

            // reset sequences as we go
            if (property_exists($prop->type, 'sequence')) {
                $sequencePool->delete($mapper->sequenceName($prop));
            }
        }

        $table->create($columns);

        return $this;
    }
1122598
public function setSchema($schema)
    {
        $oldSchema = $this->schema;
        if ($this->schema !== $schema && $this->getPlatform()) {
            $schemaDelimiter = $this->getPlatform()->getSchemaDelimiter();
            $fixHash = function (&$array) use ($schema, $oldSchema, $schemaDelimiter) {
                foreach ($array as $k => $v) {
                    if ($schema && $this->getPlatform()->supportsSchemas()) {
                        if (false === strpos($k, $schemaDelimiter)) {
                            $array[$schema . $schemaDelimiter . $k] = $v;
                            unset($array[$k]);
                        }
                    } elseif ($oldSchema) {
                        if (false !== strpos($k, $schemaDelimiter)) {
                            $array[explode($schemaDelimiter, $k)[1]] = $v;
                            unset($array[$k]);
                        }
                    }
                }
            };

            $fixHash($this->tablesByName);
            $fixHash($this->tablesByLowercaseName);
        }
        parent::setSchema($schema);
    }
929516
function(event, model, collection, options) {
      if ((event === 'add' || event === 'remove') && collection !== this) return;
      if (event === 'destroy') this.remove(model, options);
      if (event === 'change') {
        var prevId = this.modelId(model.previousAttributes());
        var id = this.modelId(model.attributes);
        if (prevId !== id) {
          if (prevId != null) delete this._byId[prevId];
          if (id != null) this._byId[id] = model;
        }
      }
      this.trigger.apply(this, arguments);
    }