src/Model.php
public function setSchema($entry, $keys, $value, $reset = false, $reset_value = null)
    {
        // Reset existing values in the schema.
        if ($reset) {
            $current = $this->getSchema($entry);
            foreach ($current as $key => $value) {
                if (is_null($reset_value)) {
                    unset($this->schema[$key][$entry]);
                    continue;
                }

                array_set($this->model_schema, $key.'.'.$entry, $reset_value);
            }
        }

        // Keys can be a single string attribute.
        if (!is_array($keys)) {
            $keys = [$keys];
        }

        // Update each of the keys.
        foreach ($keys as $key) {
            array_set($this->model_schema, $key.'.'.$entry, $value);
        }

        // Break the cache.
        $this->breakSchemaCache($entry.'_0');
        $this->breakSchemaCache($entry.'_1');

        return $this;
    }
public function setSchema($entry, $keys, $value, $reset = false, $reset_value = null)
    {
        // Reset existing values in the schema.
        if ($reset) {
            $current = $this->getSchema($entry);
            foreach ($current as $key => $value) {
                if (is_null($reset_value)) {
                    unset($this->schema[$key][$entry]);
                    continue;
                }

                array_set($this->model_schema, $key.'.'.$entry, $reset_value);
            }
        }

        // Keys can be a single string attribute.
        if (!is_array($keys)) {
            $keys = [$keys];
        }

        // Update each of the keys.
        foreach ($keys as $key) {
            array_set($this->model_schema, $key.'.'.$entry, $value);
        }

        // Break the cache.
        $this->breakSchemaCache($entry.'_0');
        $this->breakSchemaCache($entry.'_1');

        return $this;
    }
public function setSchema ( $ entry , $ keys , $ value , $ reset = false , $ reset_value = null ) { // Reset existing values in the schema. if ( $ reset ) { $ current = $ this -> getSchema ( $ entry ) ; foreach ( $ current as $ key => $ value ) { if ( is_null ( $ reset_value ) ) { unset ( $ this -> schema [ $ key ] [ $ entry ] ) ; continue ; } array_set ( $ this -> model_schema , $ key . '.' . $ entry , $ reset_value ) ; } } // Keys can be a single string attribute. if ( ! is_array ( $ keys ) ) { $ keys = [ $ keys ] ; } // Update each of the keys. foreach ( $ keys as $ key ) { array_set ( $ this -> model_schema , $ key . '.' . $ entry , $ value ) ; } // Break the cache. $ this -> breakSchemaCache ( $ entry . '_0' ) ; $ this -> breakSchemaCache ( $ entry . '_1' ) ; return $ this ; }
Set an entry within the schema.

@param string       $entry
@param string|array $keys
@param bool         $reset
@param mixed        $reset_value

@return array
Set an entry within the schema .