@param string $schema

@return \Reliese\Meta\Schema
552518
public function make($schema)
    {
        if (array_key_exists($schema, $this->schemas)) {
            return $this->schemas[$schema];
        }

        return $this->schemas[$schema] = $this->makeMapper($schema);
    }
784359
protected function add_additional_fields_schema( $schema ) {
		if ( empty( $schema['title'] ) ) {
			return $schema;
		}

		/**
		 * Can't use $this->get_object_type otherwise we cause an inf loop.
		 */
		$object_type = $schema['title'];

		$additional_fields = $this->get_additional_fields( $object_type );

		foreach ( $additional_fields as $field_name => $field_options ) {
			if ( ! $field_options['schema'] ) {
				continue;
			}

			$schema['properties'][ $field_name ] = $field_options['schema'];
		}

		return $schema;
	}
1357856
protected function applyCallback(stdClass $schema): stdClass
    {
        if (is_callable($this->callback)) {
            $result = call_user_func_array($this->callback, [Convert::objectToArray($schema)]);

            if (is_null($result)) {
                throw new InvalidArgumentException('Callback returned `null`. Did you forget to `return $schema;`?');
            }

            if ($result !== false) {
                return Convert::arrayToObject($result);
            }
        }

        return $schema;
    }
104735
protected function writeSchemaHelp($schema) {
        // Write the command description.
        $meta = Cli::val(Cli::META, $schema, []);
        $description = Cli::val('description', $meta);

        if ($description) {
            echo implode("\n", Cli::breakLines($description, 80, false)).PHP_EOL.PHP_EOL;
        }

        unset($schema[Cli::META]);

        // Add the help.
        $schema['help'] = [
            'description' => 'Display this help.',
            'type' => 'boolean',
            'short' => '?'
        ];

        echo Cli::bold('OPTIONS').PHP_EOL;

        ksort($schema);

        $table = new Table();
        $table->setFormatOutput($this->formatOutput);

        foreach ($schema as $key => $definition) {
            $table->row();

            // Write the keys.
            $keys = "--{$key}";
            if ($shortKey = Cli::val('short', $definition, false)) {
                $keys .= ", -$shortKey";
            }
            if (Cli::val('required', $definition)) {
                $table->bold($keys);
            } else {
                $table->cell($keys);
            }

            // Write the description.
            $table->cell(Cli::val('description', $definition, ''));
        }

        $table->write();
        echo PHP_EOL;

        $args = Cli::val(Cli::ARGS, $meta, []);
        if (!empty($args)) {
            echo Cli::bold('ARGUMENTS').PHP_EOL;

            $table = new Table();
            $table->setFormatOutput($this->formatOutput);

            foreach ($args as $argName => $arg) {
                $table->row();

                if (Cli::val('required', $arg)) {
                    $table->bold($argName);
                } else {
                    $table->cell($argName);
                }

                $table->cell(Cli::val('description', $arg, ''));
            }
            $table->write();
            echo PHP_EOL;
        }
    }
1370665
private function constructLdapSchema($schema)
    {
        // Set all the LDAP attributes
        $this->setAttribute('l', $schema->getAttribute('address_city'));

        $this->setAttribute('postalCode', $schema->getAttribute('address_code'));

        $this->setAttribute('c', $schema->getAttribute('address_country'));

        $this->setAttribute('postOfficeBox', $schema->getAttribute('address_pobox'));

        $this->setAttribute('st', $schema->getAttribute('address_state'));

        $this->setAttribute('streetAddress', $schema->getAttribute('address_street'));

        $this->setAttribute('company', $schema->getAttribute('company'));

        $this->setAttribute('pwdLastSet', ($schema->getAttribute('change_password') == 0) ? -1 : 0);

        $this->setAttribute('department', $schema->getAttribute('department'));

        $this->setAttribute('description', $schema->getAttribute('description'));

        $this->setAttribute('displayName', $schema->getAttribute('display_name'));

        $this->setAttribute('mail', $schema->getAttribute('email'));

        $this->setAttribute('employeeId', $schema->getAttribute('employee_id'));

        $this->setAttribute('accountExpires', $schema->getAttribute('expires'));

        $this->setAttribute('givenName', $schema->getAttribute('firstname'));

        $this->setAttribute('homeDirectory', $schema->getAttribute('home_directory'));

        $this->setAttribute('homeDrive', $schema->getAttribute('home_drive'));

        $this->setAttribute('initials', $schema->getAttribute('initials'));

        $this->setAttribute('userPrincipalName', $schema->getAttribute('logon_name'));

        $this->setAttribute('manager', $schema->getAttribute('manager'));

        $this->setAttribute('physicalDeliveryOfficeName', $schema->getAttribute('office'));

        $this->setAttribute('unicodePwd', $schema->getAttribute('password'));

        $this->setAttribute('profilepath', $schema->getAttribute('profile_path'));

        $this->setAttribute('scriptPath', $schema->getAttribute('script_path'));

        $this->setAttribute('sn', $schema->getAttribute('surname'));

        $this->setAttribute('title', $schema->getAttribute('title'));

        $this->setAttribute('telephoneNumber', $schema->getAttribute('telephone'));

        $this->setAttribute('mobile', $schema->getAttribute('mobile'));

        $this->setAttribute('pager', $schema->getAttribute('pager'));

        $this->setAttribute('ipphone', $schema->getAttribute('ipphone'));

        $this->setAttribute('wWWHomePage', $schema->getAttribute('web_page'));

        $this->setAttribute('facsimileTelephoneNumber', $schema->getAttribute('fax'));

        $this->setAttribute('userAccountControl', $schema->getAttribute('enabled'));

        $this->setAttribute('homephone', $schema->getAttribute('homephone'));

        // Distribution List specific schema
        $this->setAttribute('dlMemSubmitPerms', $schema->getAttribute('group_sendpermission'));

        $this->setAttribute('dlMemRejectPerms', $schema->getAttribute('group_rejectpermission'));

        // Exchange Schema
        $this->setAttribute('homeMDB', $schema->getAttribute('exchange_homemdb'));

        $this->setAttribute('mailNickname', $schema->getAttribute('exchange_mailnickname'));

        $this->setAttribute('proxyAddresses', $schema->getAttribute('exchange_proxyaddress'));

        $this->setAttribute('mDBUseDefaults', $schema->getAttribute('exchange_usedefaults'));

        $this->setAttribute('msExchPoliciesExcluded', $schema->getAttribute('exchange_policyexclude'));

        $this->setAttribute('msExchPoliciesIncluded', $schema->getAttribute('exchange_policyinclude'));

        $this->setAttribute('showInAddressBook', $schema->getAttribute('exchange_addressbook'));

        $this->setAttribute('altRecipient', $schema->getAttribute('exchange_altrecipient'));

        $this->setAttribute('deliverAndRedirect', $schema->getAttribute('exchange_deliverandredirect'));

        // This schema is designed for contacts
        $this->setAttribute('msExchHideFromAddressLists', $schema->getAttribute('exchange_hidefromlists'));

        $this->setAttribute('targetAddress', $schema->getAttribute('contact_email'));

        return $this;
    }
972653
public function setSchema($schema)
    {
        $schema = func_get_args();
        
        $schema = "'".implode("','", $schema)."'";
        
        $query = $this->getUtilityQuery()->setSchema($schema);
        $this->query($query);
        
        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);
    }
1289901
public function parseSchema(\stdClass $schema, Context $context)
    {
        if ($this->isProcessed($schema, $this->parsedSchemas)) {
            return $schema;
        }

        $version = $this->getVersion($schema);
        $constraints = $this->registry->getConstraints($version);
        $constraints = $this->filterConstraintsForSchema($constraints, $schema);

        foreach ($constraints as $constraint) {
            $constraint->normalize($schema, $context, $this);
        }

        return $schema;
    }
1173576
public function upgradeSchema(Schema $schema)
    {
        $stacks = $schema->getTable('Stacks');
        if ($stacks->hasColumn('siteTreeID')) {
            $stacks->dropColumn('siteTreeID');
        }
    }
1212441
public function schema(array $schema)
    {
        $this->root = key($schema);

        $this->schema = current($schema);

        return $this;
    }
1297049
public function addAllowedSchema(SchemaInterface $schema)
    {
        $exists = false;
        foreach ($this->allowedSchemas as $allowedSchema) {
            if ($allowedSchema->getId() == $schema->getId()) {
                $exists = true;
            }
        }

        if (!$exists) {
            $this->allowedSchemas[] = $schema;
        }

        return $this;
    }
610342
public function parse($schema)
    {
        $fields = $this->splitIntoFields($schema);

        foreach ($fields as $field) {
            $segments = $this->parseSegments($field);

            if ($this->fieldNeedsForeignConstraint($segments)) {
                unset($segments['options']['foreign']);

                // If the user wants a foreign constraint, then
                // we'll first add the regular field.
                $this->addField($segments);

                // And then add another field for the constraint.
                $this->addForeignConstraint($segments);

                continue;
            }

            $this->addField($segments);
        }

        return $this->schema;
    }
1182650
public function getSchemaTables(Schema $schema)
    {
        $tables = [];
        foreach ($this->tables->keys() as $name) {
            /** @var BaseTable $table */
            $table = $this->tables[$name];
            $tables[$name] = $table->buildTable($schema, $name, $this->charset, $this->collate);
        }

        return $tables;
    }
728347
public function setSchema($schema)
    {
        $this->connect();
        $this->_connection->exec('SET search_path TO ' . $this->_connection->quote($schema));
    }
1374334
public function create($schema, $meta)
    {
        $up = $this->createSchemaForUpMethod($schema, $meta);
        $down = $this->createSchemaForDownMethod($schema, $meta);

        return compact('up', 'down');
    }
1302054
public function normalize(Schema $schema): array
    {
        $this->schema = $schema;
        $schemaDesc = [];
        $schemaDesc['tables'] = [];
        foreach ($schema->getTables() as $table) {
            $schemaDesc['tables'][$table->getName()] = $this->normalizeTable($table);
        }
        return $schemaDesc;
    }
562646
protected function execSchema(Schema $schema)
    {
        $query = $schema->build($this->database);

        return $this->database->exec(trim($query));
    }