Mongolid\DataMapper\SchemaMapper::clearDynamic PHP Method

clearDynamic() protected method

If the schema is not dynamic, remove all non specified fields.
protected clearDynamic ( array &$data ) : void
$data array Reference of the fields. The passed array will be modified.
return void
    protected function clearDynamic(array &$data)
    {
        if (!$this->schema->dynamic) {
            $data = array_intersect_key($data, $this->schema->fields);
        }
    }